| Safe Haskell | Safe |
|---|---|
| Language | Haskell98 |
Control.MFunctor
Contents
Description
This module temporarily holds this class until it can find a better home.
Functors over Monads
class MFunctor t where Source #
A functor in the category of monads
hoist f . hoist g = hoist (f . g) hoist id = id
If f is a monad morphism, then hoist f is a monad morphism, meaning that
hoistK f = (hoist f .) defines a functor between Kleisli categories:
hoistK f k1 >=> hoistK f k2 = hoistK f (k1 >=> k2) hoistK f return = return
Minimal complete definition
Methods
hoist :: Monad m => (forall a. m a -> n a) -> t m b -> t n b Source #
Lift a monad morphism from m to n into a monad morphism from
(t m) to (t n)
Instances
| MFunctor MaybeT Source # | |
| MFunctor (WriterT w) Source # | |
| MFunctor (WriterT w) Source # | |
| MFunctor (StateT s) Source # | |
| MFunctor (StateT s) Source # | |
| MFunctor (IdentityT *) Source # | |
| MFunctor (ReaderT * r) Source # | |
| MFunctor (RWST r w s) Source # | |
| MFunctor (ProxyFast a' a b' b) Source # | |
| MFunctor (ProxyCorrect a' a b' b) Source # | |
| Proxy p => MFunctor (IdentityP p a' a b' b) Source # | |
| Proxy p => MFunctor (MaybeP p a' a b' b) Source # | |
| Proxy p => MFunctor (EitherP e p a' a b' b) Source # | |
| Proxy p => MFunctor (ReaderP i p a' a b' b) Source # | |
| Proxy p => MFunctor (StateP s p a' a b' b) Source # | |
| Proxy p => MFunctor (WriterP w p a' a b' b) Source # | |
Arguments
| :: (Monad m, MFunctor t) | |
| => (forall a. m a -> n a) | Monad morphism |
| -> (b' -> t m b) | Kleisli arrow |
| -> b' -> t n b |
Convenience function equivalent to (hoist f .)