Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This should probably be a separate library, but it provides a number of functor type classes between various categories.
Documentation
class DFunctor (d :: (* -> *) -> *) where Source #
A functor from the category of endofunctors to *Hask*. The D
is meant to
be a mnemonic for “down”, as we’re “lowering” from endofunctors to types.
firstMap :: (DFunctor d, Bifunctor f) => (a -> b) -> d (f a) -> d (f b) Source #
This isn’t a Functor instance because of the position of the a
, but you
can use it like:
> newtype List a = List (Mu (XNor a))
> instance Functor List where
> fmap f (List mu) = List (firstMap f mu)
class HFunctor (h :: (* -> *) -> * -> *) where Source #
An endofunctor in the category of endofunctors.
NB: This is similar to MFunctor
/
hoist
from mmorph, but without the Monad
constraint on f
.
Instances
HFunctor MaybeT Source # | |
HFunctor Lift Source # | |
HFunctor (IdentityT :: (Type -> Type) -> Type -> Type) Source # | |
HFunctor (ExceptT e) Source # | |
HFunctor (StateT s) Source # | |
HFunctor (Backwards :: (Type -> Type) -> Type -> Type) Source # | |
HFunctor (ReaderT r) Source # | |
HFunctor (StateT s) Source # | |
HFunctor (WriterT w) Source # | |
HFunctor (WriterT w) Source # | |
HFunctor (Product f) Source # | |
Functor f => HFunctor (Compose f :: (Type -> Type) -> Type -> Type) Source # | |
HFunctor (RWST r w s) Source # | |
HFunctor (RWST r w s) Source # | |