arrow-free-data / / Free


@higherkind sealed class Free<S, out A>


FlatMapped data class FlatMapped<S, out A, C> : Free<S, A>
Pure data class Pure<S, out A> : Free<S, A>
Suspend data class Suspend<S, out A> : Free<S, A>


foldStep A combination of step and foldfun <B, C> foldStep(onPure: (A) -> B, onSuspend: (Kind<S, A>) -> B, onFlatMapped: (Kind<S, C>, (C) -> Free<S, A>) -> B): B
resume Evaluate a single layer of the free monadfun resume(SF: Functor<S>): Either<Kind<S, Free<S, A>>, A>
run fun run(M: Monad<S>): Kind<S, A>
toString open fun toString(): String
transform abstract fun <O, B> transform(f: (A) -> B, fs: FunctionK<S, O>): Free<O, B>

Companion Object Functions

defer fun <S, A> defer(value: () -> Free<S, A>): Free<S, A>
just fun <S, A> just(a: A): Free<S, A>
liftF fun <S, A> liftF(fa: Kind<S, A>): Free<S, A>
roll fun <S, A> roll(value: Kind<S, Kind<<ERROR CLASS><S>, A>>): Free<S, A>

Extension Functions

foldMap fun <M, S, A> Free<S, A>.foldMap(f: FunctionK<S, M>, MM: Monad<M>): Kind<M, A>
runT fun <A> TrampolineF<A>.runT(): A
step Takes one evaluation step in the Free monad, re-associating left-nested binds in the process.tailrec fun <S, A> Free<S, A>.step(): Free<S, A>

Do you like Arrow?

Arrow Org