| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Ether.Abbr
Description
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.
Instances
| type ReifyAbbr ((-->) tag r) m = MonadReader tag r m |
Denotes MonadWriter. The mnemonic is that you write values of w
to the writer accumulator tagged by tag, thus the arrows points
from w to tag.
Instances
| type ReifyAbbr ((<--) tag w) m = MonadWriter tag w m |
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 = MonadState tag s m |
Denotes MonadExcept.
Instances
| type ReifyAbbr ((-!-) tag e) m = MonadExcept tag e m |
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 atype family ReifyAbbr abbr m :: Constraint Source
Turns an abbreviation into an actual constraint.
Instances
| type ReifyAbbr (E e) m = MonadExcept e m | |
| type ReifyAbbr (S s) m = MonadState s m | |
| type ReifyAbbr (W w) m = MonadWriter w m | |
| type ReifyAbbr (R r) m = MonadReader r m | |
| type ReifyAbbr ((-!-) tag e) m = MonadExcept tag e m | |
| type ReifyAbbr ((<->) tag s) m = MonadState tag s m | |
| type ReifyAbbr ((<--) tag w) m = MonadWriter tag w m | |
| type ReifyAbbr ((-->) tag r) m = MonadReader tag r m |