ether-0.4.1.0: Monad transformers and classes

Safe HaskellNone
LanguageHaskell2010

Control.Ether.Abbr

Description

Abbreviations for constraints.

Synopsis

Documentation

data tag --> r Source #

Denotes MonadReader. The mnemonic is that you read values of type r from the reader environment tagged by tag, thus the arrows points from tag to r.

Instances

type ReifyAbbr ((-->) tag r) m Source # 
type ReifyAbbr ((-->) tag r) m = MonadReader * tag r m

data tag <-- w Source #

Denotes MonadWriter. The mnemonic is that you write values of type w to the writer accumulator tagged by tag, thus the arrows points from w to tag.

Instances

type ReifyAbbr ((<--) tag w) m Source # 
type ReifyAbbr ((<--) tag w) m = MonadWriter * tag w m

data tag <-> s Source #

Denotes MonadState. The mnemonic is that you can both read from and write into the state, thus the arrow points in both directions.

Instances

type ReifyAbbr ((<->) tag s) m Source # 
type ReifyAbbr ((<->) tag s) m = MonadState * tag s m

data tag -!- e Source #

Denotes MonadExcept.

Instances

type ReifyAbbr ((-!-) tag e) m Source # 
type ReifyAbbr ((-!-) tag e) m = MonadExcept * tag e m

type family Ether (abbrs :: [*]) m :: Constraint where ... Source #

Reify a list of constraint abbreviations.

f :: Ether '[Foo --> r, Bar <-- w, Baz <-> s, Quux -!- e] m => m a

expands into

f :: ( MonadReader Foo  r m
     , MonadWriter Bar  w m
     , MonadState  Baz  s m
     , MonadExcept Quux e m
     ) => m a

Equations

Ether '[] m = () 
Ether (abbr ': abbrs) m = (ReifyAbbr abbr m, Ether abbrs m) 

type family ReifyAbbr (abbr :: *) (m :: * -> *) :: Constraint Source #

Turns an abbreviation into an actual constraint.

Instances

type ReifyAbbr (E e) m Source # 
type ReifyAbbr (E e) m = MonadExcept e m
type ReifyAbbr (S s) m Source # 
type ReifyAbbr (S s) m = MonadState s m
type ReifyAbbr (W w) m Source # 
type ReifyAbbr (W w) m = MonadWriter w m
type ReifyAbbr (R r) m Source # 
type ReifyAbbr (R r) m = MonadReader r m
type ReifyAbbr ((-!-) tag e) m Source # 
type ReifyAbbr ((-!-) tag e) m = MonadExcept * tag e m
type ReifyAbbr ((<->) tag s) m Source # 
type ReifyAbbr ((<->) tag s) m = MonadState * tag s m
type ReifyAbbr ((<--) tag w) m Source # 
type ReifyAbbr ((<--) tag w) m = MonadWriter * tag w m
type ReifyAbbr ((-->) tag r) m Source # 
type ReifyAbbr ((-->) tag r) m = MonadReader * tag r m