Safe Haskell | Safe |
---|---|
Language | Haskell98 |
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
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)
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 # | |
:: (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 .)