Safe Haskell | None |
---|---|
Language | Haskell2010 |
Abbreviations for constraints.
- data tag --> r
- data tag <-- w
- data tag <-> s
- data tag -!- e
- type family Ether abbrs m :: Constraint
- type family ReifyAbbr abbr m :: Constraint
Documentation
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
.
type ReifyAbbr ((-->) tag r) m = MonadReader tag r m 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
.
type ReifyAbbr ((<--) tag w) m = MonadWriter tag w m Source |
Denotes MonadState
. The mnemonic is that you can both read from and
write into the state, thus the arrow points in both directions.
type ReifyAbbr ((<->) tag s) m = MonadState tag s m Source |
Denotes MonadExcept
.
type ReifyAbbr ((-!-) tag e) m = MonadExcept tag e m Source |
type family Ether abbrs m :: Constraint 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
type family ReifyAbbr abbr m :: Constraint Source
Turns an abbreviation into an actual constraint.
type ReifyAbbr (E e) m = MonadExcept e m Source | |
type ReifyAbbr (S s) m = MonadState s m Source | |
type ReifyAbbr (W w) m = MonadWriter w m Source | |
type ReifyAbbr (R r) m = MonadReader r m Source | |
type ReifyAbbr ((-!-) tag e) m = MonadExcept tag e m Source | |
type ReifyAbbr ((<->) tag s) m = MonadState tag s m Source | |
type ReifyAbbr ((<--) tag w) m = MonadWriter tag w m Source | |
type ReifyAbbr ((-->) tag r) m = MonadReader tag r m Source |