arrow-effects-rx2-data / arrow.effects.rx2 / MaybeK

MaybeK

@higherkind data class MaybeK<A> : MaybeKOf<A>, MaybeKKindedJ<A>

Constructors

<init> MaybeK(maybe: Maybe<A>)

Properties

maybe val maybe: Maybe<A>

Functions

ap fun <B> ap(fa: MaybeKOf<(A) -> B>): MaybeK<B>
bracketCase fun <B> bracketCase(use: (A) -> MaybeKOf<B>, release: (A, ExitCase<Throwable>) -> MaybeKOf<Unit>): MaybeK<B>
A way to safely acquire a resource and release in the face of errors and cancellation. It uses ExitCase to distinguish between different exit cases when releasing the acquired resource.
continueOn fun continueOn(ctx: CoroutineContext): MaybeK<A>
equals fun equals(other: Any?): Boolean
exists fun exists(predicate: Predicate<A>): Boolean
flatMap fun <B> flatMap(f: (A) -> MaybeKOf<B>): MaybeK<B>
fold fun <B> fold(ifEmpty: () -> B, ifSome: (A) -> B): B
foldLeft fun <B> foldLeft(b: B, f: (B, A) -> B): B
foldRight fun <B> foldRight(lb: Eval<B>, f: (A, Eval<B>) -> Eval<B>): Eval<B>
forall fun forall(p: Predicate<A>): Boolean
handleErrorWith fun handleErrorWith(function: (Throwable) -> MaybeKOf<A>): MaybeK<A>
hashCode fun hashCode(): Int
isEmpty fun isEmpty(): Boolean
map fun <B> map(f: (A) -> B): MaybeK<B>
nonEmpty fun nonEmpty(): Boolean
runAsync fun runAsync(cb: (Either<Throwable, A>) -> MaybeKOf<Unit>): MaybeK<Unit>

Companion Object Functions

async fun <A> async(fa: MaybeKProc<A>): MaybeK<A>
Creates a MaybeK that’ll run MaybeKProc.
asyncF fun <A> asyncF(fa: MaybeKProcF<A>): MaybeK<A>
defer fun <A> defer(fa: () -> MaybeKOf<A>): MaybeK<A>
invoke operator fun <A> invoke(fa: () -> A): MaybeK<A>
just fun <A> just(a: A): MaybeK<A>
raiseError fun <A> raiseError(t: Throwable): MaybeK<A>
tailRecM tailrec fun <A, B> tailRecM(a: A, f: (A) -> MaybeKOf<Either<A, B>>): MaybeK<B>

Extension Functions

unsafeRunAsync fun <A> SingleKOf<A>.unsafeRunAsync(cb: (Either<Throwable, A>) -> Unit): Unit
Runs the SingleK asynchronously and then runs the cb. Catches all errors that may be thrown in await. Errors from cb will still throw as expected.
unsafeRunSync fun <A> SingleKOf<A>.unsafeRunSync(): A
Runs this SingleK with Single.blockingGet. Does not handle errors at all, rethrowing them if they happen.