multirec-0.1: Generic programming with systems of recursive datatypesSource codeContentsIndex
Generics.MultiRec.Fold
Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Contents
Generic fold and unfold
Creating an algebra
Description
The definition of generic fold.
Synopsis
type Algebra s r = forall ix. Ix s ix => s ix -> PF s s r ix -> r ix
fold :: (Ix s ix, HFunctor (PF s)) => Algebra s r -> ix -> r ix
type CoAlgebra s r = forall ix. Ix s ix => s ix -> r ix -> PF s s r ix
unfold :: (Ix s ix, HFunctor (PF s)) => CoAlgebra s r -> r ix -> ix
type ParaAlgebra s r = forall ix. Ix s ix => s ix -> PF s s r ix -> ix -> r ix
para :: (Ix s ix, HFunctor (PF s)) => ParaAlgebra s r -> ix -> r ix
type AlgPart a s r ix = a s r ix -> r ix
type :-> f g s r ix = f s r ix -> g s r ix
(&) :: (AlgPart a :-> (AlgPart b :-> AlgPart (a :+: b))) s r ix
tag :: AlgPart a s r ix -> AlgPart (a :>: ix) s r ix'
Generic fold and unfold
type Algebra s r = forall ix. Ix s ix => s ix -> PF s s r ix -> r ixSource
fold :: (Ix s ix, HFunctor (PF s)) => Algebra s r -> ix -> r ixSource
type CoAlgebra s r = forall ix. Ix s ix => s ix -> r ix -> PF s s r ixSource
unfold :: (Ix s ix, HFunctor (PF s)) => CoAlgebra s r -> r ix -> ixSource
type ParaAlgebra s r = forall ix. Ix s ix => s ix -> PF s s r ix -> ix -> r ixSource
para :: (Ix s ix, HFunctor (PF s)) => ParaAlgebra s r -> ix -> r ixSource
Creating an algebra
type AlgPart a s r ix = a s r ix -> r ixSource
type :-> f g s r ix = f s r ix -> g s r ixSource
(&) :: (AlgPart a :-> (AlgPart b :-> AlgPart (a :+: b))) s r ixSource
tag :: AlgPart a s r ix -> AlgPart (a :>: ix) s r ix'Source
Produced by Haddock version 2.4.2