Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | sjoerd@w3future.com |
Safe Haskell | None |
A cofree functor is right adjoint to a forgetful functor. In this package the forgetful functor forgets class constraints.
- data Cofree c b where
- counit :: Cofree c b -> b
- leftAdjunct :: c a => (a -> b) -> a -> Cofree c b
- leftAdjunctF :: ForallF c f => (f a -> b) -> f a -> Cofree c b
- unit :: c b => b -> Cofree c b
- rightAdjunct :: (a -> Cofree c b) -> a -> b
- convert :: (c (w a), Comonad w) => w a -> Cofree c a
Documentation
The cofree functor for constraint c
.
leftAdjunct :: c a => (a -> b) -> a -> Cofree c bSource
leftAdjunctF :: ForallF c f => (f a -> b) -> f a -> Cofree c bSource
rightAdjunct :: (a -> Cofree c b) -> a -> bSource
rightAdjunct f = counit . f