arrow-fx / arrow.fx / IO / Companion
companion object ~~Companion~~ :
IOParMap
,
IORace
Deprecated: The IO datatype and it’s related type classes will disappear in Arrow 0.13.0. All useful operations are offered directly over suspend functions by Arrow Fx Coroutines. https://arrow-kt.io/docs/fx/async/
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 > |
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 | fun <A> ~~cancelable~~(cb: ((Either< Throwable , A>) -> Unit ) -> CancelToken < ForIO >): IO <A> |
cancelableF | fun <A> ~~cancelableF~~(cb: ((Either< Throwable , A>) -> Unit ) -> IOOf < CancelToken < ForIO >>): IO <A> |
cancellable | Creates a cancellable 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> cancellable(cb: ((Either< Throwable , A>) -> Unit ) -> CancelToken < ForIO >): IO <A> |
cancellableF | Creates a cancellable 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> cancellableF(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> |
effectEither | Delay a suspended effect which results in an Either.fun <E : Throwable , A> effectEither(f: suspend () -> EitherOf<E, A>): IO <A> Delay a suspended effect which results in an Either on provided CoroutineContext. fun <E : Throwable , A> effectEither(ctx: CoroutineContext , f: suspend () -> EitherOf<E, 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?
✖