- module Control.Monad
- class (Functor f, Monad m) => MonadFree f m where
- data Free f a
- isPure :: Free t t1 -> Bool
- isImpure :: Free t t1 -> Bool
- foldFree :: Functor f => (a -> b) -> (f b -> b) -> Free f a -> b
- evalFree :: (a -> b) -> (f (Free f a) -> b) -> Free f a -> b
- mapFree :: (Functor f, Functor g) => (f (Free g a) -> g (Free g a)) -> Free f a -> Free g a
- mapFreeM :: (Traversable f, Functor g, Monad m) => (f (Free g a) -> m (g (Free g a))) -> Free f a -> m (Free g a)
- mapFreeM' :: (Functor f, Traversable g, Monad m) => (forall a. f a -> m (g a)) -> Free f a -> m (Free g a)
- foldFreeM :: (Traversable f, Monad m) => (a -> m b) -> (f b -> m b) -> Free f a -> m b
- induce :: (Functor f, Monad m) => (forall a. f a -> m a) -> Free f a -> m a
- newtype FreeT f m a = FreeT {}
- foldFreeT :: (Traversable f, Monad m) => (a -> m b) -> (f b -> m b) -> FreeT f m a -> m b
- foldFreeT' :: (Traversable f, Monad m) => (a -> b) -> (f b -> b) -> FreeT f m a -> m b
- mapFreeT :: (Functor f, Functor m) => (forall a. m a -> m' a) -> FreeT f m a -> FreeT f m' a
- trans :: (Functor f, Monad m) => Free f a -> FreeT f m a
- trans' :: (Functor f, Monad m) => m (Free f a) -> FreeT f m a
- untrans :: (Traversable f, Monad m) => FreeT f m a -> m (Free f a)
- liftFree :: (Functor f, Monad m) => (a -> Free f b) -> a -> FreeT f m b
Documentation
module Control.Monad
Free Monads
class (Functor f, Monad m) => MonadFree f m whereSource
This type class generalizes over encodings of Free Monads.
:: m a | |
-> m (Either a (f (m a))) |
|
:: f (m a) | |
-> m a | Wraps a side effect into a monadic computation |
Functor f => MonadFree f (Free f) | |
Functor f => MonadFree f (C (Free f)) | |
Functor f => Monad (Free f) | |
Functor f => Functor (Free f) | |
(Functor f, Foldable f) => Foldable (Free f) | |
Traversable f => Traversable (Free f) | |
(Eq a, Eq (f (Free f a))) => Eq (Free f a) | |
(Ord a, Ord (f (Free f a))) => Ord (Free f a) | |
(Show a, Show (f (Free f a))) => Show (Free f a) | |
(NFData a, NFData (f (Free f a))) => NFData (Free f a) |
mapFreeM :: (Traversable f, Functor g, Monad m) => (f (Free g a) -> m (g (Free g a))) -> Free f a -> m (Free g a)Source
mapFreeM' :: (Functor f, Traversable g, Monad m) => (forall a. f a -> m (g a)) -> Free f a -> m (Free g a)Source
Monad Morphisms
foldFreeM :: (Traversable f, Monad m) => (a -> m b) -> (f b -> m b) -> Free f a -> m bSource
Free Monad Transformers
(Functor f, Monad m) => MonadFree f (FreeT f m) | |
Functor f => MonadTrans (FreeT f) | |
(Functor f, Monad m) => Monad (FreeT f m) | |
(Functor f, Functor m) => Functor (FreeT f m) | |
(Traversable m, Traversable f) => Foldable (FreeT f m) | |
(Traversable m, Traversable f) => Traversable (FreeT f m) |
foldFreeT :: (Traversable f, Monad m) => (a -> m b) -> (f b -> m b) -> FreeT f m a -> m bSource
foldFreeT' :: (Traversable f, Monad m) => (a -> b) -> (f b -> b) -> FreeT f m a -> m bSource