ixmonad-0.56: 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 m| and |Unit m| |

Minimal complete definition

return, (>>=)

Associated Types

type Unit m :: k Source

type Plus m f g :: k Source

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 m f g' |

(>>) :: 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