Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Implementation of Eff
monad as described by "Freer Monads, More Extensible Effects" by Oleg
Kiselyov and Hiromi Ishii.
- data Union r v where
- decomp :: Union (t ': r) v -> Either (Union r v) (t v)
- class Member' (FindElem t r) t r => Member t r
- type Arrs r a b = TAQueue (Eff r) a b
- data Eff r a
- send :: Member t r => t v -> Eff r v
- kApp :: Arrs r a b -> a -> Eff r b
- run :: Eff '[] a -> a
- runM :: Monad m => Eff '[m] a -> m a
- data TAQueue f a b where
- singleton :: (a -> f b) -> TAQueue f a b
- snoc :: TAQueue f a x -> (x -> f b) -> TAQueue f a b
- append :: TAQueue f a x -> TAQueue f x b -> TAQueue f a b
- data ViewL f a b where
- viewl :: TAQueue f a b -> ViewL f a b
Documentation
r
is a type-level list of effect labels and v
is type of return value. Union r v
is an
effectful value that returns v
.
decomp :: Union (t ': r) v -> Either (Union r v) (t v) Source #
From a union get a request labelled t
or a smaller union without t
.
type Arrs r a b = TAQueue (Eff r) a b Source #
Composition of effectful functions. Final function maps a
to b
and also does effects
denoted by r
.