arrow-free-data /



Cofree data class Cofree<S, A> : CofreeOf<S, A>, CofreeKindedJ<S, A>, Functor<S>
Coyoneda data class Coyoneda<F, P, A> : CoyonedaOf<F, P, A>, CoyonedaKindedJ<F, P, A>
ForCofree class ForCofree
ForCoyoneda class ForCoyoneda
ForFree class ForFree
ForFreeApplicative class ForFreeApplicative
ForYoneda class ForYoneda
Free sealed class Free<S, out A> : FreeOf<S, A>
FreeApplicative sealed class FreeApplicative<F, out A> : FreeApplicativeOf<F, A>
See https//
FreeSyntax interface FreeSyntax<F>
StackSafeMonadContinuation open class StackSafeMonadContinuation<F, A> : Continuation<Free<F, A>>, Monad<F>, BindSyntax<F>, StackSafeSyntax<F>
StackSafeSyntax interface StackSafeSyntax<F> : MonadSyntax<F>, FreeSyntax<F>
Trampoline object Trampoline : TrampolineFunctions
TrampolineFunctions interface TrampolineFunctions
Yoneda abstract class Yoneda<F, A> : YonedaOf<F, A>, YonedaKindedJ<F, A>

Type Aliases

CofreeEval typealias CofreeEval<S, A> = Kind<S, Cofree<S, A>>
CofreeKindedJ typealias CofreeKindedJ<S, A> = HkJ2<ForCofree, S, A>
CofreeOf typealias CofreeOf<S, A> = Kind2<ForCofree, S, A>
CofreePartialOf typealias CofreePartialOf<S> = Kind<ForCofree, S>
CoyonedaKindedJ typealias CoyonedaKindedJ<F, P, A> = HkJ3<ForCoyoneda, F, P, A>
CoyonedaOf typealias CoyonedaOf<F, P, A> = Kind3<ForCoyoneda, F, P, A>
CoyonedaPartialOf typealias CoyonedaPartialOf<F, P> = Kind2<ForCoyoneda, F, P>
FreeApplicativeOf typealias FreeApplicativeOf<F, A> = Kind2<ForFreeApplicative, F, A>
FreeApplicativePartialOf typealias FreeApplicativePartialOf<F> = Kind<ForFreeApplicative, F>
FreeOf typealias FreeOf<S, A> = Kind2<ForFree, S, A>
FreePartialOf typealias FreePartialOf<S> = Kind<ForFree, S>
TrampolineF typealias TrampolineF<A> = Free<ForFunction0, A>
Trampoline is often used to emulate tail recursion. The idea is to have some step code that can be trampolined itself to emulate recursion. The difference with standard recursion would be that there is no need to rewind the whole stack when we reach the end of the stack, since the first value returned that is not a trampoline would be directly returned as the overall result value for the whole function chain. That means Trampoline emulates what tail recursion does.
YonedaKindedJ typealias YonedaKindedJ<F, A> = HkJ2<ForYoneda, F, A>
YonedaOf typealias YonedaOf<F, A> = Kind2<ForYoneda, F, A>
YonedaPartialOf typealias YonedaPartialOf<F> = Kind<ForYoneda, F>

Extensions for External Classes



cataM fun <F, M, A, B> Cofree<F, A>.cataM(MM: Monad<M>, TF: Traverse<F>, inclusion: FunctionK<ForEval, M>, folder: (A, Kind<F, B>) -> Kind<M, B>): Kind<M, B>
foldMap fun <M, S, A> Free<S, A>.foldMap(f: FunctionK<S, M>, MM: Monad<M>): Kind<M, A>
free fun <S, A> Free<S, A>
freeAp fun <S, A> A.freeAp(): FreeApplicative<S, A>
runT fun <A> TrampolineF<A>.runT(): A
step tailrec fun <S, A> Free<S, A>.step(): Free<S, A>
Takes one evaluation step in the Free monad, re-associating left-nested binds in the process.