arrow-mtl-data / arrow.mtl / OptionT

OptionT

@higherkind data class OptionT<F, A> : OptionTOf<F, A>, OptionTKindedJ<F, A>

OptionT<F, A> is a light wrapper on an F<Option<A>> with some convenient methods for working with this nested structure.

It may also be said that OptionT is a monad transformer for Option.

Constructors

<init> OptionT<F, A> is a light wrapper on an F<Option<A>> with some convenient methods for working with this nested structure.OptionT(value: Kind<F, Option<A>>)

Functions

ap fun <B> ap(MF: Monad<F>, ff: OptionTOf<F, (A) -> B>): OptionT<F, B>
cata fun <B> cata(FF: Functor<F>, default: () -> B, f: (A) -> B): Kind<F, B>
filter fun filter(FF: Functor<F>, p: (A) -> Boolean): OptionT<F, A>
filterMap fun <B> filterMap(FF: Functor<F>, f: (A) -> OptionOf<B>): OptionT<F, B>
flatMap fun <B> flatMap(MF: Monad<F>, f: (A) -> OptionTOf<F, B>): OptionT<F, B>
flatMapF fun <B> flatMapF(MF: Monad<F>, f: (A) -> Kind<F, Option<B>>): OptionT<F, B>
fold fun <B> fold(FF: Functor<F>, default: () -> B, f: (A) -> B): Kind<F, B>
forall fun forall(FF: Functor<F>, p: (A) -> Boolean): Kind<F, Boolean>
getOrElse fun getOrElse(FF: Functor<F>, default: () -> A): Kind<F, A>
getOrElseF fun getOrElseF(MF: Monad<F>, default: () -> Kind<F, A>): Kind<F, A>
isDefined fun isDefined(FF: Functor<F>): Kind<F, Boolean>
isEmpty fun isEmpty(FF: Functor<F>): Kind<F, Boolean>
liftF fun <B> liftF(FF: Functor<F>, fa: Kind<F, B>): OptionT<F, B>
map fun <B> map(FF: Functor<F>, f: (A) -> B): OptionT<F, B>
orElse fun orElse(MF: Monad<F>, default: () -> OptionT<F, A>): OptionT<F, A>
orElseF fun orElseF(MF: Monad<F>, default: () -> Kind<F, Option<A>>): OptionT<F, A>
semiflatMap fun <B> semiflatMap(MF: Monad<F>, f: (A) -> Kind<F, B>): OptionT<F, B>
subflatMap fun <B> subflatMap(FF: Functor<F>, f: (A) -> OptionOf<B>): OptionT<F, B>
toLeft fun <R> toLeft(FF: Functor<F>, default: () -> R): EitherT<A, F, R>
toRight fun <L> toRight(FF: Functor<F>, default: () -> L): EitherT<L, F, A>
transform fun <B> transform(FF: Functor<F>, f: (Option<A>) -> Option<B>): OptionT<F, B>
value fun value(): Kind<F, Option<A>>

Companion Object Functions

fromOption fun <F, A> fromOption(AF: Applicative<F>, value: Option<A>): OptionT<F, A>
invoke operator fun <F, A> invoke(value: Kind<F, Option<A>>): OptionT<F, A>
just fun <F, A> just(AF: Applicative<F>, a: A): OptionT<F, A>
liftF fun <F, A> liftF(FF: Functor<F>, fa: Kind<F, A>): OptionT<F, A>
none fun <F> none(AF: Applicative<F>): OptionT<F, Nothing>
tailRecM fun <F, A, B> tailRecM(MF: Monad<F>, a: A, f: (A) -> OptionTOf<F, Either<A, B>>): OptionT<F, B>

Do you like Arrow?

Arrow Org
<