effect-monad-0.6: Embeds effect systems into Haskell using parameteric effect monads

Safe HaskellNone
LanguageHaskell98

Control.Effect

Synopsis

Documentation

class Effect m where Source

Specifies "parametric effect monads" which are essentially monads but annotated by a type-level monoid formed by Plus and Unit

Minimal complete definition

return, (>>=)

Associated Types

type Unit m :: k Source

Effect of a trivially effectful computation |

type Plus m f g :: k Source

Cominbing effects of two subcomputations |

type Inv m f g :: Constraint Source

Inv provides a way to give instances of Effect their own constraints for >>=

Methods

return :: a -> m (Unit m) a Source

Effect-parameterised version of return. Annotated with the 'Unit m' effect, denoting pure compuation

(>>=) :: Inv m f g => m f a -> (a -> m g b) -> m (Plus m f g) b Source

Effect-parameterise version of >>= (bind). Combines two effect annotations f and g on its parameter computations into Plus

(>>) :: Inv m f g => m f a -> m g b -> m (Plus m f g) b Source

class Subeffect m f g where Source

Specifies subeffecting behaviour

Methods

sub :: m f a -> m g a Source

Instances

Subset s t => Subeffect [*] Reader s t

If s is a subset of t then, s is a subeffect of t

Superset s t => Subeffect [*] Writer s t