Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This *is* monad coproducts (due to Luth and Ghani) unlike the other thing.
Synopsis
- module Control.Monad.EtaInverse
- module Control.Monad.Free.Class
- module Data.Functor.Sum
- data Free' f f2 t
- toF2 :: MonadFree f m => Free' f m a -> m a
- execCoproduct :: (EtaInverse f, EtaInverse f2, MonadFree (Sum f f2) f3) => Free (Sum f f2) t -> Free' (Sum f f2) f3 t
Documentation
module Control.Monad.EtaInverse
module Control.Monad.Free.Class
module Data.Functor.Sum
A modified free monad giving efficient access to the topmost layer;
but otherwise using the machinery of the free monad f2
.
Instances
(Functor f, MonadFree f f2) => MonadFree f (Free' f f2) Source # | |
Defined in Control.Monad.Coproducts3 | |
(Functor f, MonadFree f f2) => Monad (Free' f f2) Source # | |
(Functor f, Functor f2) => Functor (Free' f f2) Source # | |
(Functor f, MonadFree f f2) => Applicative (Free' f f2) Source # | |
Defined in Control.Monad.Coproducts3 | |
(Show1 f, Show1 f2) => Show1 (Free' f f2) Source # | |
(Show (f (f2 t)), Show (f2 t), Show t) => Show (Free' f f2 t) Source # | |
toF2 :: MonadFree f m => Free' f m a -> m a Source #
A projection into the underlying free monad construction.
execCoproduct :: (EtaInverse f, EtaInverse f2, MonadFree (Sum f f2) f3) => Free (Sum f f2) t -> Free' (Sum f f2) f3 t Source #
Given a free construction construct a representation of the monad coproduct in a free mona; it picks out one representative element of each equivalence class in the defining quotient of the monad coproduct.