arrow-effects-extensions / arrow.effects.extensions / ResourceMonad

ResourceMonad

@extension interface ResourceMonad<F, E> : Monad<ResourcePartialOf<F, E>>, ResourceSelective<F, E>

Functions

ap open fun <A, B> ResourceOf<F, E, A>.ap(ff: Kind<ResourcePartialOf<F, E>, (A) -> B>): Resource<F, E, B>
BR abstract fun BR(): Bracket<F, E>
flatMap open fun <A, B> ResourceOf<F, E, A>.flatMap(f: (A) -> ResourceOf<F, E, B>): Resource<F, E, B>
map open fun <A, B> Kind<ResourcePartialOf<F, E>, A>.map(f: (A) -> B): Resource<F, E, B>
select open fun <A, B> ResourceOf<F, E, Either<A, B>>.select(f: Kind<ResourcePartialOf<F, E>, (A) -> B>): Resource<F, E, B>
tailRecM open fun <A, B> tailRecM(a: A, f: (A) -> Kind<ResourcePartialOf<F, E>, Either<A, B>>): Resource<F, E, B>

Extension Functions

just fun <A> A.just(): IO<A>
just fun <F, E, A> A.just(BR: Bracket<F, E>): Resource<F, E, A>