| Portability | see LANGUAGE pragmas (... GHC) |
|---|---|
| Stability | experimental |
| Maintainer | nicolas.frisby@gmail.com |
Data.Yoko.Algebra
Description
Algebras and catamorphisms for mutually-recursive datatypes.
- type Alg m t = AnRMNUni m (DCs t) -> Med m t
- newtype Algebra m t = Alg (Alg m t)
- type Algebras ts m = Each ts (Algebra m)
- type SiblingAlgs t m = Algebras (Siblings t) m
- algebras :: forall ts m. ts ::: (All (ReduceD m)) => Proxy (KS m) -> Algebras ts m
- data CataD ts m t where
- catas :: forall m ts. ts ::: (All (CataD ts m)) => Algebras ts m -> Each ts (FromAt m IdM)
- cata :: t ::: (CataD (Siblings t) m) => SiblingAlgs t m -> t -> Med m t
- module Data.Yoko.Reduce
Documentation
type Alg m t = AnRMNUni m (DCs t) -> Med m tSource
A t-algebra maps a sum of a t's constructors into a mediation of t.
type SiblingAlgs t m = Algebras (Siblings t) mSource
t inhabits CataD ts m if
cata :: t ::: (CataD (Siblings t) m) => SiblingAlgs t m -> t -> Med m tSource
Uses the m-mediated algebras for t's siblings to reduce a t to Med
m t.
module Data.Yoko.Reduce