License | BSD-style (see the file LICENSE) |
---|---|
Maintainer | sjoerd@w3future.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
A cofree functor is right adjoint to a forgetful functor. In this package the forgetful functor forgets class constraints.
Compared to Data.Functor.Cofree
we're going up a level.
These free functors go between categories of functors and the natural
transformations between them.
- type (:~>) f g = forall b. f b -> g b
- data HCofree c g a where
- counit :: HCofree c g :~> g
- leftAdjunct :: (c f, Functor f) => (f :~> g) -> f :~> HCofree c g
- unit :: (c g, Functor g) => g :~> HCofree c g
- rightAdjunct :: (f :~> HCofree c g) -> f :~> g
- hfmap :: (f :~> g) -> HCofree c f :~> HCofree c g
- liftCofree :: (c f, Functor f) => f a -> HCofree c f a
- lowerCofree :: HCofree c f a -> f a
- convert :: (c (t f), Functor (t f), Comonad f, ComonadTrans t) => t f a -> HCofree c f a
- coiter :: c Identity => (forall b. b -> f b) -> a -> HCofree c f a
- unwrap :: HCofree Comonad g a -> g (HCofree Comonad g a)
Documentation
rightAdjunct :: (f :~> HCofree c g) -> f :~> g Source
rightAdjunct f = counit . f
liftCofree :: (c f, Functor f) => f a -> HCofree c f a Source
lowerCofree :: HCofree c f a -> f a Source