effect-monad-0.7.0.0: Embeds effect systems into Haskell using graded monads

Safe HaskellNone
LanguageHaskell98

Control.Coeffect

Synopsis

Documentation

class Coeffect c where Source #

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

Minimal complete definition

extract, extend

Associated Types

type Inv c (s :: k) (t :: k) :: Constraint Source #

type Unit c :: k Source #

type Plus c (s :: k) (t :: k) :: k Source #

Methods

extract :: c (Unit c) a -> a Source #

Coeffect-parameterised version of extract, annotated with the 'Unit m' effect, denoting pure contexts

extend :: Inv c s t => (c t a -> b) -> c (Plus c s t) a -> c s b Source #

Coeffect-parameterise version of extend. The two coeffec annotations s and t on its parameter computations get combined in the parameter computation by Plus

Instances

Coeffect [Mapping Symbol *] IxCoreader Source # 

Associated Types

type Inv IxCoreader (c :: IxCoreader -> * -> *) (s :: IxCoreader) (t :: IxCoreader) :: Constraint Source #

type Unit IxCoreader (c :: IxCoreader -> * -> *) :: k Source #

type Plus IxCoreader (c :: IxCoreader -> * -> *) (s :: IxCoreader) (t :: IxCoreader) :: k Source #

Methods

extract :: c (Unit IxCoreader c) a -> a Source #

extend :: Inv IxCoreader c s t => (c t a -> b) -> c (Plus IxCoreader c s t) a -> c s b Source #

class CoeffectZip c where Source #

Zips two coeffecting computations together

Minimal complete definition

czip

Associated Types

type Meet c (s :: k) (t :: k) :: k Source #

type CzipInv c (s :: k) (t :: k) :: Constraint Source #

Methods

czip :: CzipInv c s t => c s a -> c t b -> c (Meet c s t) (a, b) Source #

Instances

CoeffectZip [Mapping Symbol *] IxCoreader Source # 

Associated Types

type Meet IxCoreader (c :: IxCoreader -> * -> *) (s :: IxCoreader) (t :: IxCoreader) :: k Source #

type CzipInv IxCoreader (c :: IxCoreader -> * -> *) (s :: IxCoreader) (t :: IxCoreader) :: Constraint Source #

Methods

czip :: CzipInv IxCoreader c s t => c s a -> c t b -> c (Meet IxCoreader c s t) (a, b) Source #

class Subcoeffect c s t where Source #

Specifies sub-coeffecting behaviour

Minimal complete definition

subco

Methods

subco :: c s a -> c t a Source #