arrow-typeclasses / arrow.typeclasses / Bimonad

Bimonad

interface Bimonad<F> : Monad<F>, Comonad<F>

Inherited Functions

ap open fun <A, B> Kind<F, A>.ap(ff: Kind<F, (A) -> B>): Kind<F, B>
binding open fun <A> ~~binding~~(c: suspend MonadContinuation<F, *>.() -> A): Kind<F, A>
Entry point for monad bindings which enables for comprehension. The underlying implementation is based on coroutines. A coroutine is initiated and suspended inside MonadErrorContinuation yielding to Monad.flatMap. Once all the flatMap binds are completed the underlying monad is returned from the act of executing the coroutine
coflatMap abstract fun <A, B> Kind<F, A>.coflatMap(f: (Kind<F, A>) -> B): Kind<F, B>
duplicate open fun <A> Kind<F, A>.duplicate(): Kind<F, Kind<F, A>>
effectM open fun <A, B> Kind<F, A>.effectM(f: (A) -> Kind<F, B>): Kind<F, A>
extract abstract fun <A> Kind<F, A>.extract(): A
flatMap abstract fun <A, B> Kind<F, A>.flatMap(f: (A) -> Kind<F, B>): Kind<F, B>
flatten open fun <A> Kind<F, Kind<F, A>>.flatten(): Kind<F, A>
followedBy open fun <A, B> Kind<F, A>.followedBy(fb: Kind<F, B>): Kind<F, B>
followedByEval open fun <A, B> Kind<F, A>.followedByEval(fb: Eval<Kind<F, B>>): Kind<F, B>
forEffect open fun <A, B> Kind<F, A>.forEffect(fb: Kind<F, B>): Kind<F, A>
forEffectEval open fun <A, B> Kind<F, A>.forEffectEval(fb: Eval<Kind<F, B>>): Kind<F, A>
ifM open fun <B> Kind<F, Boolean>.ifM(ifTrue: () -> Kind<F, B>, ifFalse: () -> Kind<F, B>): Kind<F, B>
map open fun <A, B> Kind<F, A>.map(f: (A) -> B): Kind<F, B>
Transform the F wrapped value A into B preserving the F structure Kind<F, A> -> Kind<F, B>
mproduct open fun <A, B> Kind<F, A>.mproduct(f: (A) -> Kind<F, B>): Kind<F, Tuple2<A, B>>
select open fun <A, B> Kind<F, Either<A, B>>.select(f: Kind<F, (A) -> B>): Kind<F, B>
selectM open fun <A, B> Kind<F, Either<A, B>>.selectM(f: Kind<F, (A) -> B>): Kind<F, B>
tailRecM abstract fun <A, B> tailRecM(a: A, f: (A) -> Kind<F, Either<A, B>>): Kind<F, B>

Extension Functions

cobinding fun <F, B : Any> Comonad<F>.cobinding(c: suspend ComonadContinuation<F, *>.() -> B): B
Entry point for monad bindings which enables for comprehension. The underlying impl is based on coroutines. A coroutine is initiated and inside MonadContinuation suspended yielding to flatMap once all the flatMap binds are completed the underlying monad is returned from the act of executing the coroutine
compose fun <F, G> Invariant<F>.compose(GF: Invariant<G>): Invariant<Nested<F, G>>
fun <F, G> Functor<F>.compose(GF: Functor<G>): Functor<Nested<F, G>>
fun <F, G> Applicative<F>.compose(GA: Applicative<G>): Applicative<Nested<F, G>>
composeContravariant fun <F, G> Invariant<F>.composeContravariant(GF: Contravariant<G>): Invariant<Nested<F, G>>
fun <F, G> Functor<F>.composeContravariant(GF: Contravariant<G>): Contravariant<Nested<F, G>>
composeFunctor fun <F, G> Invariant<F>.composeFunctor(GF: Functor<G>): Invariant<Nested<F, G>>

Type Class Hierarchy