arrow-recursion-data / arrow.recursion

Package arrow.recursion

Types

Algebra typealias Algebra<F, A> = (Kind<F, A>) -> A
AlgebraM typealias AlgebraM<F, M, A> = (Kind<F, A>) -> Kind<M, A>
Coalgebra typealias Coalgebra<F, A> = (A) -> Kind<F, A>
CoalgebraM typealias CoalgebraM<F, M, A> = (A) -> Kind<M, Kind<F, A>>
CVAlgebra typealias CVAlgebra<F, A> = (Kind<F, Cofree<F, A>>) -> A
CVAlgebraM typealias CVAlgebraM<F, M, A> = (Kind<F, Cofree<F, A>>) -> Kind<M, A>
CVCoalgebra typealias CVCoalgebra<F, A> = (A) -> Kind<F, FreeR<F, A>>
CVCoalgebraM typealias CVCoalgebraM<F, M, A> = (A) -> Kind<M, Kind<F, FreeR<F, A>>>
RAlgebra typealias RAlgebra<F, T, A> = (Kind<F, Tuple2<T, A>>) -> A
RAlgebraM typealias RAlgebraM<F, M, T, A> = (Kind<F, Tuple2<T, A>>) -> Kind<M, A>
RCoalgebra typealias RCoalgebra<F, T, A> = (A) -> Kind<F, Either<T, A>>
RCoalgebraM typealias RCoalgebraM<F, M, T, A> = (A) -> Kind<M, Kind<F, Either<T, A>>>

Functions

chrono Combination of futu and histofun <F, A, B> A.chrono(alg: CVAlgebra<F, B>, coalg: CVCoalgebra<F, A>, FF: Functor<F>): B
chronoM Monadic version of chronofun <F, M, A, B> A.chronoM(alg: CVAlgebraM<F, M, B>, coalg: CVCoalgebraM<F, M, A>, TF: Traverse<F>, MM: Monad<M>): Kind<M, B>
coelgot Refold but may short circuit at any time during deconstructionfun <F, A, B> A.coelgot(f: (Tuple2<A, Eval<Kind<F, B>>>) -> B, coalg: Coalgebra<F, A>, FF: Functor<F>): B
coelgotM Monadic version of coelgotfun <F, M, A, B> A.coelgotM(f: (Tuple2<A, Eval<Kind<M, Kind<F, B>>>>) -> Kind<M, B>, coalg: CoalgebraM<F, M, A>, TF: Traverse<F>, MM: Monad<M>): Kind<M, B>
dyna Combination of ana + histofun <F, A, B> A.dyna(alg: CVAlgebra<F, B>, coalg: Coalgebra<F, A>, FF: Functor<F>): B
dynaM Monadic version of dynafun <F, M, A, B> A.dynaM(alg: CVAlgebraM<F, M, B>, coalg: CoalgebraM<F, M, A>, TF: Traverse<F>, MM: Monad<M>): Kind<M, B>
elgot Refold, but with the ability to short circuit during constructionfun <F, A, B> B.elgot(alg: Algebra<F, A>, f: (B) -> Either<A, Kind<F, B>>, FF: Functor<F>): A
elgotM Monadic version of elgotfun <F, M, A, B> B.elgotM(alg: AlgebraM<F, M, A>, f: (B) -> Kind<M, Either<A, Kind<F, B>>>, TF: Traverse<F>, MM: Monad<M>): Kind<M, A>
hylo Combination of cata and ana.fun <F, A, B> A.hylo(alg: Algebra<F, B>, coalg: Coalgebra<F, A>, FF: Functor<F>): B
hyloC Hylomorphism over a composed functorfun <F, W, A, B> A.hyloC(alg: (Kind<F, Kind<W, B>>) -> B, coalg: (A) -> Kind<F, Kind<W, A>>, FF: Functor<F>, WF: Functor<W>): B
hyloM Monadic hylomorphism, can be used to gain stacksafety when using a stack safe monad, but it requires a traverse instance and not just a functor.fun <F, M, A, B> A.hyloM(alg: AlgebraM<F, M, B>, coalg: CoalgebraM<F, M, A>, TF: Traverse<F>, MM: Monad<M>): Kind<M, B>
hyloMC Monadic hylomorphism over composed traversablesfun <F, W, M, A, B> A.hyloMC(alg: (Kind<F, Kind<W, B>>) -> Kind<M, B>, coalg: (A) -> Kind<M, Kind<F, Kind<W, A>>>, TF: Traverse<F>, TW: Traverse<W>, MM: Monad<M>): Kind<M, B>