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.

- 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
- type Product c m n = Cofree c (m, n)
- product :: c a => (a -> m) -> (a -> n) -> a -> Product c m n
- outL :: Product c m n -> m
- outR :: Product c m n -> n
- type TerminalObject c = Cofree c ()
- terminal :: c a => a -> TerminalObject c

# Documentation

leftAdjunct :: c a => (a -> b) -> a -> Cofree c b Source #

leftAdjunctF :: ForallF c f => (f a -> b) -> f a -> Cofree c b Source #

rightAdjunct :: (a -> Cofree c b) -> a -> b Source #

rightAdjunct f = counit . f

# Products

type TerminalObject c = Cofree c () Source #

terminal :: c a => a -> TerminalObject c Source #