arrow-recursion-data / arrow.recursion.typeclasses / Corecursive


interface Corecursive<T, F>

Typeclass for types that can be generically unfolded with coalgebras.


ana Unfold to a structure F given any seed fun <A> A.ana(coalg: Coalgebra<F, A>): T
anaM Unfold monadically given any seed fun <M, A> A.anaM(TF: Traverse<F>, MM: Monad<M>, coalg: CoalgebraM<F, M, A>): Kind<M, T>
apo Unfold with the option to short circuit (by passing a Left) at any timeopen fun <A> A.apo(coalg: RCoalgebra<F, T, A>): T
apoM Monadic version of apoopen fun <M, A> A.apoM(TF: Traverse<F>, MM: Monad<M>, coalg: RCoalgebraM<F, M, T, A>): Kind<M, T>
embed Creates a algebra given a fun embed(): Algebra<F, T>
embedT Implementation for embed.abstract fun Kind<F, T>.embedT(): T
FF abstract fun FF(): Functor<F>
futu Unfold multiple layers of structure at a time. As opposed to apo (which gave us binary control over continuing the unfold or not) futu gives the option to unfold any number of fun <A> A.futu(coalg: CVCoalgebra<F, A>): T
futuM Monadic version of futuopen fun <M, A> A.futuM(TF: Traverse<F>, MM: Monad<M>, coalg: CVCoalgebraM<F, M, A>): Kind<M, T>
postPro Unfold using a normal algebra but apply a natural transformation (FunctionK) at each levelopen fun <A> A.postPro(trans: FunctionK<F, F>, coalg: Coalgebra<F, A>): T


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

Type Class Hierarchy

Do you like Arrow?

Arrow Org