arrow-fx / arrow.fx / IO / Companion

Companion

companion object Companion : IOParMap, IORace

Companion Object Properties

lazy A lazy IO value of Unit.val lazy: IO<Unit>
never A pure IO value that never returns. Useful when you need to model non-terminating cases.val never: IO<Nothing>
unit A pure IO value of Unit.val unit: IO<Unit>

Companion Object Functions

async Create an IO that executes an asynchronous process on evaluation. This combinator can be used to wrap callbacks or other similar impure code that require no cancellation code.fun <A> async(k: IOProc<A>): IO<A>
asyncF Create an IO that executes an asynchronous process on evaluation. This combinator can be used to wrap callbacks or other similar impure code that require no cancellation code.fun <A> asyncF(k: IOProcF<A>): IO<A>
cancelable Creates a cancelable instance of IO that executes an asynchronous process on evaluation. This combinator can be used to wrap callbacks or other similar impure code that requires cancellation code.fun <A> cancelable(cb: ((Either<Throwable, A>) -> Unit) -> CancelToken<ForIO>): IO<A>
cancelableF Creates a cancelable instance of IO that executes an asynchronous process on evaluation. This combinator can be used to wrap callbacks or other similar impure code that requires cancellation code.fun <A> cancelableF(cb: ((Either<Throwable, A>) -> Unit) -> IOOf<CancelToken<ForIO>>): IO<A>
defer Defer a computation that results in an IO value.fun <A> defer(f: () -> IOOf<A>): IO<A>
effect Delay a suspended effect.fun <A> effect(f: suspend () -> A): IO<A>
Delay a suspended effect on provided CoroutineContext.fun <A> effect(ctx: CoroutineContext, f: suspend () -> A): IO<A>
eval Evaluates an Eval instance within a safe IO context.fun <A> eval(eval: Eval<A>): IO<A>
invoke operator fun <A> invoke(ctx: CoroutineContext, f: suspend () -> A): IO<A>
operator fun <A> invoke(f: suspend () -> A): IO<A>
just Just wrap a pure value A into IO.fun <A> just(a: A): IO<A>
later Wraps a function into IO to execute it later.fun <A> later(f: () -> A): IO<A>
raiseError Raise an error in a pure way without actually throwing.fun <A> raiseError(e: Throwable): IO<A>
sleep Sleeps for a given duration without blocking a thread.fun sleep(duration: Duration, continueOn: CoroutineContext = IODispatchers.CommonPool): IO<Unit>
tailRecM Perform a recursive operation in a stack-safe way, by checking the inner Either value. If you want to continue the recursive operation return Either.Left with the intermediate result A, Either.Right indicates the terminal event and must thus return the resulting value B.fun <A, B> tailRecM(a: A, f: (A) -> IOOf<Either<A, B>>): IO<B>

Do you like Arrow?

Arrow Org
<