The catamorphism (generalized fold) for the generic F-algebra f
with carrier object B
.
The catamorphism (generalized fold) for the generic F-algebra f
with carrier object B
.
This recursively computes a result of type B
from this
instance of Cofree[F, A]
.
carrier object of f
and result type of the catamorphism
generic F-algebra to apply to the head of this instance and the partial results available for the children of this instance
the result of applying the catamorphism to this instance of
Cofree[F, A]
The paramorphism (generalized catamorphism) for the morphism p
.
The paramorphism (generalized catamorphism) for the morphism p
.
This recursively computes a result of type B
from this
instance of Cofree[F, A]
by applying p
to the head and tail
of this instance and the partial results available for the children.
Note that this is the only place with explicit recursion in this
example.
carrier object of p
and result type of the paramorphism
morphism to apply to the partial results available for the children of this instance
the result of applying the paramorphism to this instance of
Cofree[F, A]
Wraps a value
self
and provides catamorphism and related recursion patterns for injection intoCofree
.branching endofunctor of this structure
generic item type of this structure