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 => (f :~> g) -> f :~> HCofree c g
- unit :: c g => g :~> HCofree c g
- rightAdjunct :: (f :~> HCofree c g) -> f :~> g
- transform :: (forall r. c r => (r :~> f) -> r :~> g) -> HCofree c f :~> HCofree c g
- hfmap :: (f :~> g) -> HCofree c f :~> HCofree c g
- hextend :: (HCofree c f :~> g) -> HCofree c f :~> HCofree c g
- liftCofree :: c f => f a -> HCofree c f a
- lowerCofree :: HCofree c f a -> f a
- convert :: (c (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
data HCofree c g a where Source #
The higher order cofree functor for constraint c
.
SuperClass1 (* -> *) Functor c => Functor (HCofree c g) Source # | |
SuperClass1 (* -> *) Foldable c => Foldable (HCofree c g) Source # | |
SuperClass1 (* -> *) Traversable c => Traversable (HCofree c g) Source # | |
SuperClass1 (* -> *) Comonad c => Comonad (HCofree c g) Source # | The cofree comonad of a functor. |
liftCofree :: c f => f a -> HCofree c f a Source #
lowerCofree :: HCofree c f a -> f a Source #