Control.Effect

Synopsis

# Documentation

class Effect (m :: k -> * -> *) 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

Associated Types

type Unit m :: k Source #

Effect of a trivially effectful computation |

type Plus m (f :: k) (g :: k) :: k Source #

Cominbing effects of two subcomputations |

type Inv m (f :: k) (g :: k) :: 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 #

Instances

class Subeffect (m :: k -> * -> *) f g where Source #

Specifies subeffecting behaviour

Minimal complete definition

sub

Methods

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

Instances

 Submap s t => Subeffect [Mapping Symbol *] Reader s t Source # If s is a subset of t then, s is a subeffect of t Methodssub :: s t a -> s g a Source # Supermap s t => Subeffect [Mapping Symbol *] Writer s t Source # Methodssub :: s t a -> s g a Source #