arrow-recursion-data / arrow.recursion.typeclasses / Recursive

Recursive

interface Recursive<T, F>

Typeclass for types that can be generically folded with algebras.

Functions

cata Fold over any datatype using that datatypes base-functor.open fun <A> T.cata(alg: Algebra<F, A>): A
cataM Fold monadically over any datatype using that datatypes base-functor.open fun <M, A> T.cataM(TF: Traverse<F>, MM: Monad<M>, alg: (Kind<F, A>) -> Kind<M, A>): Kind<M, A>
FF abstract fun FF(): Functor<F>
histo Fold over any datatype using that datatypes base functor. Also gives access to all previous folds inside Cofree.open fun <A> T.histo(alg: CVAlgebra<F, A>): A
histoM Fold monadically over any datatype using that datatypes base functor. Also gives access to all previous folds inside Cofree.open fun <M, A> T.histoM(TF: Traverse<F>, MM: Monad<M>, alg: CVAlgebraM<F, M, A>): Kind<M, A>
para Fold over any datatype using that datatypes base-functor. Also gives access to the current element and not only the fold.open fun <A> T.para(alg: RAlgebra<F, T, A>): A
paraM Fold monadically over any datatype using that datatypes base-functor. Also gives access to the current element and not only the fold.open fun <M, A> T.paraM(TF: Traverse<F>, MM: Monad<M>, alg: RAlgebraM<F, M, T, A>): Kind<M, A>
prepro Fold over a structure with a normal algebra, but applies a natural transformation (FunctionK) before the foldopen fun <A> T.prepro(trans: FunctionK<F, F>, alg: Algebra<F, A>): A
project Creates a coalgebra given a functor.open fun project(): Coalgebra<F, T>
projectT Implementation for project.abstract fun T.projectT(): Kind<F, T>

Inheritors

Birecursive interface Birecursive<T, F> : Recursive<T, F>, Corecursive<T, F>

Type Class Hierarchy

Do you like Arrow?

Arrow Org
<