|
Control.Comonad.Cofree | Portability | portable | Stability | experimental | Maintainer | dan.doel@gmail.com |
|
|
|
Description |
An implementation of the cofree comonad of a functor, used in
histomorphisms and chronomorphisms in Control.Recursion. The
cofree comonad can also be seen as a stream parameterized by a
functor that controls its branching factor.
|
|
Synopsis |
|
|
|
Documentation |
|
|
The cofree comonad of a functor h (also known as an H-branching stream).
Various comonads are a special instance of the cofree comonad:
- Cofree Identity is an infinite stream
- Cofree Maybe is a non-empty stream
- Cofree [] is a rose tree
formally:
Cofree H A = nu X. A * HX
| Constructors | Cofree | | unCofree :: (a, h (Cofree h a)) | |
|
| Instances | |
|
|
|
|
|
|
|
anamorphism for building a cofree comonad from a seed
|
|
|
Converts a value of the cofree comonad over Maybe into a non-empty list.
|
|
|
Lifts a distributive law of f over h to a distributive law
of f over Cofree h.
|
|
Produced by Haddock version 2.3.0 |