The operations here are very similar to those in Recursive and Corecursive.
The usual names (cata, ana, etc.) are prefixed with trans and behave
generally the same, except
1. the A of the [un]fold is restricted to T[G], but
2. the [co]algebra shape is like F[A] => G[A] rather than F[A] => A.
In exchange, the [un]folds are available to more types (EG, folds available
to Free and unfolds available to Cofree).
There are two additional operations – transCataT and transAnaT. The
distinction between these and transCata/transAna is that this allows
the algebra to return the context (the outer T) to be used, whereas
transCata always uses the original context of the argument to f.
This is noticable when T is Cofree. In this function, the result may
have any head the algebra desires, whereas in transCata, it can only
have the head of the argument to f.
Docs for operations, since they seem to break scaladoc if put in the right
place:
- map – very roughly like Uniplate’s descend
- transCataT – akin to Uniplate’s transform
- transAnaT – akin to Uniplate’s topDownTransform
- transCata – akin to Fixplate’s restructure
The operations here are very similar to those in Recursive and Corecursive. The usual names (
cata
,ana
, etc.) are prefixed withtrans
and behave generally the same, except 1. theA
of the [un]fold is restricted toT[G]
, but 2. the [co]algebra shape is likeF[A] => G[A]
rather thanF[A] => A
.In exchange, the [un]folds are available to more types (EG, folds available to
Free
and unfolds available toCofree
).There are two additional operations –
transCataT
andtransAnaT
. The distinction between these andtransCata
/transAna
is that this allows the algebra to return the context (the outerT
) to be used, whereastransCata
always uses the original context of the argument tof
.This is noticable when
T
isCofree
. In this function, the result may have anyhead
the algebra desires, whereas intransCata
, it can only have thehead
of the argument tof
.Docs for operations, since they seem to break scaladoc if put in the right place:
-
map
– very roughly like Uniplate’sdescend
-transCataT
– akin to Uniplate’stransform
-transAnaT
– akin to Uniplate’stopDownTransform
-transCata
– akin to Fixplate’srestructure