Safe Haskell | Safe-Infered |
---|

- newtype Fix fT = In {}
- compos :: Functor f => (Fix f -> Fix f) -> Fix f -> Fix f
- type Algebra fT aT = fT aT -> aT
- cata :: Functor fT => Algebra fT aT -> Fix fT -> aT
- type Coalgebra fT aT = aT -> fT aT
- ana :: Functor fT => Coalgebra fT aT -> aT -> Fix fT
- type ErrorAlgebra fT eT aT = fT aT -> Either eT aT
- cascade :: (Traversable fT, Monoid eT) => ErrorAlgebra fT eT aT -> Algebra fT (Except eT aT)

# Fixed points of functors

Fixpoint of functors.

compos :: Functor f => (Fix f -> Fix f) -> Fix f -> Fix fSource

Apply a transformation to a tree's direct children.

cata :: Functor fT => Algebra fT aT -> Fix fT -> aTSource

Reduces a tree to a value according to the algebra.

ana :: Functor fT => Coalgebra fT aT -> aT -> Fix fTSource

Constructs a tree from a value according to the coalgebra.

type ErrorAlgebra fT eT aT = fT aT -> Either eT aTSource

Algebras for error catamorphisms.

cascade :: (Traversable fT, Monoid eT) => ErrorAlgebra fT eT aT -> Algebra fT (Except eT aT)Source

Reduces a tree to a value according to the algebra, propagating potential errors.