| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Control.Monad.Freer
Description
This module defines the freer monad Freer, which allows manipulating
effectful computations algebraically.
Documentation
data Freer (f :: Type -> Type) a where Source #
Freer monads.
A freer monad Freer f a represents an effectful computation that returns a
value of type a. The parameter f :: * -> * is a effect signature that
defines the effectful operations allowed in the computation. Freer f a is
called a freer monad in that it's a Monad given any f.
Constructors
| Return :: forall a (f :: Type -> Type). a -> Freer f a | A pure computation. |
| Do :: forall (f :: Type -> Type) b a. f b -> (b -> Freer f a) -> Freer f a | An effectful computation where the first argument |
interpFreer :: Monad m => (forall a1. f a1 -> m a1) -> Freer f a -> m a Source #
Interpret the effects in a freer monad in terms of another monad.