Map f
over each subtree of the computation.
Replace each node in the computation with the subtree from that node downwards
Alias for head.
Evaluate the entire Cofree tree.
Evaluate just the tail.
Map over head and inner S[_]
branches.
Transform the branching functor at the root of the Cofree tree.
Transform the branching functor, using the S functor to perform the recursion.
Transform the branching functor, using the T functor to perform the recursion.
Evaluates and returns the tail of the computation.
Applies f
to the head and g
to the tail.
A free comonad for some branching functor
S
. Branching is done lazily using Eval. A tree with data at the branches, as opposed to Free which is a tree with data at the leaves. Not an instruction set functor made into a program monad as in Free, but an instruction set's outputs as a functor made into a tree of the possible worlds reachable using the instruction set.This Scala implementation of
Cofree
and its usages are derived from Scalaz's Cofree, originally written by Rúnar Bjarnason.