Portability | non-portable |
---|---|

Stability | experimental |

Maintainer | sjoerd@w3future.com |

Safe Haskell | Safe-Infered |

A cofree functor is right adjoint to a forgetful functor. In this package the forgetful functor forgets class constraints.

- data Cofree c b where
- leftAdjunct :: c a => (a -> b) -> a -> Cofree c b
- rightAdjunct :: (a -> Cofree c b) -> a -> b
- leftAdjunct' :: ForallF c f => (f a -> b) -> f a -> Cofree c 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

rightAdjunct :: (a -> Cofree c b) -> a -> bSource

leftAdjunct' :: ForallF c f => (f a -> b) -> f a -> Cofree c bSource