Module containing the main typeclasses and recursion schemes on them.
- zygo : Recursive f
t =>
(f b ->
b) ->
(f (b,
a) ->
a) ->
t ->
a
Zygomorphism (see here for a neat example)
- prepro : Recursive f
t =>
Corecursive f
t =>
(f t ->
f t) ->
(f a ->
a) ->
t ->
a
Prepromorphism. Fold a structure while applying a natural transformation at each step.
- postpro : Recursive f
t =>
Corecursive f
t =>
(f t ->
f t) ->
(a ->
f a) ->
a ->
t
Postpromorphism. Unfold a structure, applying a natural transformation along the way.
- para : Recursive f
t =>
Corecursive f
t =>
(f (t,
a) ->
a) ->
t ->
a
Paramorphism
- mutu : Recursive f
t =>
(f (a,
a) ->
a) ->
(f (a,
a) ->
a) ->
t ->
a
Mutumorphism
- hylo : Functor f =>
(f b ->
b) ->
(a ->
f a) ->
a ->
b
Hylomorphism; equivalent to a catamorphism and an anamorphism taken together.
- histo : Recursive f
t =>
(f (Cofree f
a) ->
a) ->
t ->
a
Histomorphism
- ghylo : Functor f =>
Comonad w =>
Monad m =>
(k : f (w b9) ->
w (f b9)) ->
(l : m (f c) ->
f (m c)) ->
(f' : f (w b) ->
b) ->
(g' : a ->
f (m a)) ->
a ->
b
Generalized hylomorphism
- k
A distributive law on f
- l
A distributive law on l
- f'
A (f . w)-algebra
- g'
A (f . m)-coalgebra
- gcata : Recursive f
t =>
Comonad w =>
(k : f (w b) ->
w (f b)) ->
(g : f (w a) ->
a) ->
t ->
a
Generalized catamorphism
- k
A distributive law
- g
A (f . w)-algebra
- gana : Corecursive f
t =>
Monad m =>
(k : m (f b) ->
f (m b)) ->
(g : a ->
f (m a)) ->
a ->
t
Generalized Anamorphism
- k
A distributive law
- g
A (f . m)-coalgebra
- futu : Corecursive f
t =>
(a ->
f (Free f
a)) ->
a ->
t
Futumorphism
- distHisto : Functor f =>
f (Cofree f
a) ->
Cofree f
(f a)
Distributive law for histomorphisms
- distFutu : Functor f =>
Free f
(f a) ->
f (Free f
a)
Distributive law for futumorphisms.
- distCata : Functor f =>
f (Identity a) ->
Identity (f a)
Distributive law for catamorphisms
- distAna : Functor f =>
Identity (f a) ->
f (Identity a)
Distributive law for anamorphisms.
- dicata : Recursive f
b =>
Recursive f
a =>
(f (b,
a) ->
b) ->
(f (b,
a) ->
a) ->
b ->
a
Catamorphism interweaving two data types.
- chrono : Functor f =>
(f (Cofree f
b) ->
b) ->
(a ->
f (Free f
a)) ->
a ->
b
Chronomorphism
- cata : Recursive f
t =>
(f a ->
a) ->
t ->
a
Catamorphism. Folds a structure. (see here)
- ana : Corecursive f
t =>
(a ->
f a) ->
a ->
t
Anamorphism, meant to build up a structure recursively.
- interface Recursive
Recursive types correspond to catamorphisms.
- project : Recursive f
t =>
t ->
f t
- interface Corecursive
Interface for corecursive data types. Corecursive types correspond to
anamorphisms.
- embed : Corecursive f
t =>
f t ->
t
- interface Base
This is an interface which does nothing interesting, but it functions as a
way of saying "f is a base functor with underlying type t"