A fix point function for types that adds an additional attribute to each node in the resulting data structure.
A fix point function for types that adds an additional attribute to each node in the resulting data structure.
This is a cofree comonad.
Implemented as an obscured alias:
type Attr[F[_], A] = (A, F[Attr[F, A]])
The companion object can be used to translate between representations.
The pattern functor for Attr.
The pattern functor for Attr.
This is also the environment comonad transformer "EnvT".
Implemented as an obscured alias:
type AttrF[F[_], A, B] = (A, F[B])
The companion object can be used to translate between representations.
A fix point function for types that allows for the replacements of nodes in the data structure with values of a different type.
A fix point function for types that allows for the replacements of nodes in the data structure with values of a different type.
This is the dual of Attr and a very basic free monad.
This implementation is not lazy and is used strictly for data.
Implemented as an obscured alias:
type Coattr[F[_], A] = Either[A, F[Coattr[F, A]]]
The companion object can be used to translate between representations.
The pattern functor for Coattr.
A fix point function for types.
A fix point function for types.
Implemented as an obscured alias:
type Fix[F[_]] = F[Fix[F]]
The companion object can be used to translate between representations.
Mu is the least fixed point of a functor F
.
Mu is the least fixed point of a functor F
. It is a
computation that can consume a inductive noninfinite
structure in one go.
In Haskell this can more aptly be expressed as:
data Mu f = Mu (forall x . (f x -> x) -> x)
Nu is the greatest fixed point of a functor F
.
Nu is the greatest fixed point of a functor F
. It is a
computation that can generate a coinductive infinite
structure on demand.
In Haskell this can more aptly be expressed as:
data Nu g = forall s . Nu (s -> g s) s