arrow-core-data / arrow.typeclasses / MonadFilter

MonadFilter

interface MonadFilter<F> : Monad<F>, FunctorFilter<F>

Properties

fx Entry point for monad bindings which enables for comprehension. The underlying implementation is based on coroutines. A coroutine is initiated and suspended inside MonadThrowContinuation yielding to Monad.flatMap. Once all the flatMap binds are completed the underlying monad is returned from the act of executing the coroutineopen val fx: MonadFilterFx<F>

Functions

bindingFilter open fun <B> ~~bindingFilter~~(c: suspend MonadFilterSyntax<F>.() -> B): Kind<F, B>
empty abstract fun <A> empty(): Kind<F, A>
filterMap A combined map and filter. Filtering is handled via Option instead of Boolean such that the output type B can be different than the input type A.open fun <A, B> Kind<F, A>.filterMap(f: (A) -> Option<B>): Kind<F, B>

Inheritors

MonadCombine interface MonadCombine<F> : MonadFilter<F>, Alternative<F>

Type Class Hierarchy

Do you like Arrow?

Arrow Org
<