A variant of fold that allows the specification of the algebra in a convenient way.
- type family Alg f r ix :: *
- type family Comp f r ix :: *
- type Algebra phi r = forall ix. phi ix -> Alg (PF phi) r ix
- class Fold f where
- fold :: forall phi ix r. (Fam phi, HFunctor phi (PF phi), Fold (PF phi)) => Algebra phi r -> phi ix -> ix -> r ix
- (&) :: a -> b -> (a, b)
The type family of convenient algebras.
The algebras passed to the fold have to work for all index types in the family. The additional witness argument is required only to make GHC's typechecker happy.
The class to turn convenient algebras into standard algebras.
The class fold explains how to convert a convenient algebra
Alg back into a function from functor to result, as required
by the standard fold function.
Fold with convenient algebras.