object IO extends Serializable
- Alphabetic
- By Inheritance
- IO
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final class AsyncEffect[E, A] extends IO[E, A]
- final class Ensuring[E, A] extends IO[E, A]
- final class Fail[E] extends IO[E, Nothing]
- final class FlatMap[E, A0, A] extends IO[E, A]
- final class Fork[E, A] extends IO[Nothing, Fiber[E, A]]
- final class Lock[E, A] extends IO[E, A]
- final class Point[A] extends IO[Nothing, A]
- final class Redeem[E, E2, A, B] extends IO[E2, B] with Function[A, IO[E2, B]]
- final class Strict[A] extends IO[Nothing, A]
- final class Supervise[E, A] extends IO[E, A]
- final class SyncEffect[A] extends IO[Nothing, A]
- final class Uninterruptible[E, A] extends IO[E, A]
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
absolve[E, A](v: IO[E, Either[E, A]]): IO[E, A]
Submerges the error case of an
Eitherinto theIO.Submerges the error case of an
Eitherinto theIO. The inverse operation ofIO.attempt. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
async[E, A](register: ((IO[E, A]) ⇒ Unit) ⇒ Unit): IO[E, A]
Imports an asynchronous effect into a pure
IOvalue.Imports an asynchronous effect into a pure
IOvalue. Seeasync0for the more expressive variant of this function that can return a value synchronously. -
final
def
async0[E, A](register: ((IO[E, A]) ⇒ Unit) ⇒ Async[E, A]): IO[E, A]
Imports an asynchronous effect into a pure
IOvalue, possibly returning the value synchronously. -
final
def
asyncInterrupt[E, A](register: ((IO[E, A]) ⇒ Unit) ⇒ Either[Canceler, IO[E, A]]): IO[E, A]
Imports an asynchronous effect into a pure
IOvalue.Imports an asynchronous effect into a pure
IOvalue. The effect has the option of returning the value synchronously, which is useful in cases where it cannot be determined if the effect is synchronous or asynchronous until the effect is actually executed. The effect also has the option of returning a canceler, which will be used by the runtime to cancel the asynchronous effect if the fiber executing the effect is interrupted. -
final
def
asyncM[E, A](register: ((IO[E, A]) ⇒ Unit) ⇒ IO[Nothing, _]): IO[E, A]
Imports an asynchronous effect into a pure
IOvalue.Imports an asynchronous effect into a pure
IOvalue. This formulation is necessary when the effect is itself expressed in terms ofIO. -
final
def
blocking[A](effect: ⇒ A): IO[Throwable, A]
Imports a synchronous effect that does blocking IO into a pure value.
Imports a synchronous effect that does blocking IO into a pure value.
If the returned
IOis interrupted, the blocked thread running the synchronous effect will be interrupted viaThread.interrupt. -
final
def
bracket[E, A, B](acquire: IO[E, A])(release: (A) ⇒ IO[Nothing, _])(use: (A) ⇒ IO[E, B]): IO[E, B]
Acquires a resource, do some work with it, and then release that resource.
Acquires a resource, do some work with it, and then release that resource.
bracketwill release the resource no matter the outcome of the computation, and will re-throw any exception that occurred in between. -
final
def
bracket0[E, A, B](acquire: IO[E, A])(release: (A, Exit[E, B]) ⇒ IO[Nothing, _])(use: (A) ⇒ IO[E, B]): IO[E, B]
Acquires a resource, do some work with it, and then release that resource.
Acquires a resource, do some work with it, and then release that resource. With
bracket0not only is the acquired resource be cleaned up, the outcome of the computation is also reified for processing. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
collectAll[E, A](in: Iterable[IO[E, A]]): IO[E, List[A]]
Evaluate each effect in the structure from left to right, and collect the results.
Evaluate each effect in the structure from left to right, and collect the results. For parallelism use
collectAllPar. -
final
def
collectAllPar[E, A](as: Iterable[IO[E, A]]): IO[E, List[A]]
Evaluate each effect in the structure in parallel, and collect the results.
Evaluate each effect in the structure in parallel, and collect the results. This is the parallel version of
collectAll. -
final
def
collectAllParN[E, A](n: Long)(as: Iterable[IO[E, A]]): IO[E, List[A]]
Evaluate each effect in the structure in parallel, and collect the results.
Evaluate each effect in the structure in parallel, and collect the results. Only up to
ntasks run in parallel. This is a version ofcollectAllPar, with a throttle. -
final
def
descriptor: IO[Nothing, Descriptor]
Returns information about the current fiber, such as its fiber identity.
-
final
def
die(t: Throwable): IO[Nothing, Nothing]
Returns an
IOthat terminates with the specifiedThrowable. -
final
def
done[E, A](r: Exit[E, A]): IO[E, A]
Creates an
IOvalue fromExit -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
fail[E](error: E): IO[E, Nothing]
Creates an
IOvalue that represents failure with the specified error.Creates an
IOvalue that represents failure with the specified error. The moral equivalent ofthrowfor pure code. -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
flatten[E, A](io: IO[E, IO[E, A]]): IO[E, A]
Flattens a nested action.
-
final
def
foldLeft[E, S, A](in: Iterable[A])(zero: S)(f: (S, A) ⇒ IO[E, S]): IO[E, S]
Folds an
Iterable[A]using an effectful functionf.Folds an
Iterable[A]using an effectful functionf. Works in sequence. -
final
def
foreach[E, A, B](in: Iterable[A])(fn: (A) ⇒ IO[E, B]): IO[E, List[B]]
Apply the function fn to each element of the
Iterable[A]and return the results in a newList[B].Apply the function fn to each element of the
Iterable[A]and return the results in a newList[B]. For parallelism useforeachPar. -
final
def
foreachPar[E, A, B](as: Iterable[A])(fn: (A) ⇒ IO[E, B]): IO[E, List[B]]
Evaluate the elements of an
Iterable[A]in parallel and collect the results.Evaluate the elements of an
Iterable[A]in parallel and collect the results. This is the parallel version offoreach. -
final
def
foreachParN[E, A, B](n: Long)(as: Iterable[A])(fn: (A) ⇒ IO[E, B]): IO[E, List[B]]
Evaluate the elements of a traversable data structure in parallel and collect the results.
Evaluate the elements of a traversable data structure in parallel and collect the results. Only up to
ntasks run in parallel. This is a version offoreachPar, with a throttle. -
final
def
forkAll[E, A](as: Iterable[IO[E, A]]): IO[Nothing, Fiber[E, List[A]]]
Forks all of the specified values, and returns a composite fiber that produces a list of their results, in order.
-
final
def
forkAll_[E, A](as: Iterable[IO[E, A]]): IO[Nothing, Unit]
Forks all of the specified values, and returns a composite fiber that produces a list of their results, in order.
-
final
def
fromEither[E, A](v: Either[E, A]): IO[E, A]
Lifts an
Eitherinto anIO. -
final
def
fromFiber[E, A](fiber: Fiber[E, A]): IO[E, A]
Creates an
IOvalue that represents the exit value of the specified fiber. -
final
def
fromFiberM[E, A](fiber: IO[E, Fiber[E, A]]): IO[E, A]
Creates an
IOvalue that represents the exit value of the specified fiber. -
final
def
fromOption[A](v: Option[A]): IO[Unit, A]
Lifts an
Optioninto anIO. -
final
def
fromTry[A](effect: ⇒ Try[A]): IO[Throwable, A]
Imports a
Tryinto anIO. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
halt[E](cause: Cause[E]): IO[E, Nothing]
Returns an
IOthat fails with the specifiedCause. -
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
interrupt: IO[Nothing, Nothing]
Returns an
IOthat is interrupted. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
lock[E, A](executor: Executor)(io: IO[E, A]): IO[E, A]
Locks the
ioto the specified executor. -
final
def
mergeAll[E, A, B](in: Iterable[IO[E, A]])(zero: B)(f: (B, A) ⇒ B): IO[E, B]
Merges an
Iterable[IO]to a single IO, works in parallel. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
val
never: IO[Nothing, Nothing]
Returns a action that will never produce anything.
Returns a action that will never produce anything. The moral equivalent of
while(true) {}, only without the wasted CPU cycles. -
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
raceAll[E, A](io: IO[E, A], ios: Iterable[IO[E, A]]): IO[E, A]
Races an
IO[E, A]against elements of aIterable[IO[E, A]].Races an
IO[E, A]against elements of aIterable[IO[E, A]]. Yields either the first success or the last failure. -
final
def
reduceAll[E, A](a: IO[E, A], as: Iterable[IO[E, A]])(f: (A, A) ⇒ A): IO[E, A]
Reduces an
Iterable[IO]to a single IO, works in parallel. -
final
def
require[E, A](error: E): (IO[E, Option[A]]) ⇒ IO[E, A]
Requires that the given
IO[E, Option[A]]contain a value.Requires that the given
IO[E, Option[A]]contain a value. If there is no value, then the specified error will be raised. -
final
def
sleep(duration: Duration): IO[Nothing, Unit]
Sleeps for the specified duration.
Sleeps for the specified duration. This is always asynchronous.
-
final
def
succeed[A](a: A): IO[Nothing, A]
Lifts a strictly evaluated value into the
IOmonad. -
final
def
succeedLazy[A](a: ⇒ A): IO[Nothing, A]
Lifts a non-strictly evaluated value into the
IOmonad.Lifts a non-strictly evaluated value into the
IOmonad. Do not use this function to capture effectful code. The result is undefined but may include duplicated effects. -
final
def
supervise[E, A](io: IO[E, A]): IO[E, A]
Supervises the specified action, which ensures that any actions directly forked by the action are killed upon the action's own termination.
-
final
def
superviseWith[E, A](io: IO[E, A])(supervisor: (Iterable[Fiber[_, _]]) ⇒ IO[Nothing, _]): IO[E, A]
Supervises the specified action's spawned fibers.
-
final
def
supervisor: IO[Nothing, (Cause[Nothing]) ⇒ IO[Nothing, _]]
Retrieves the supervisor associated with the fiber running the action returned by this method.
-
final
def
suspend[E, A](io: ⇒ IO[E, A]): IO[E, A]
Lazily produces an
IOvalue whose construction may have actional costs that should be deferred until evaluation.Lazily produces an
IOvalue whose construction may have actional costs that should be deferred until evaluation.Do not use this method to effectfully construct
IOvalues. The results will be undefined and most likely involve the physical explosion of your computer in a heap of rubble. -
final
def
sync[A](effect: ⇒ A): IO[Nothing, A]
Imports a synchronous effect into a pure
IOvalue.Imports a synchronous effect into a pure
IOvalue.val nanoTime: IO[Nothing, Long] = IO.sync(System.nanoTime())
-
final
def
sync0[A](effect: (Env) ⇒ A): IO[Nothing, A]
Imports a synchronous effect into a pure
IOvalue.Imports a synchronous effect into a pure
IOvalue. This variant ofsynclets you use the execution environment of the fiber.val nanoTime: IO[Nothing, Long] = IO.sync(System.nanoTime())
-
final
def
syncCatch[E, A](effect: ⇒ A)(f: PartialFunction[Throwable, E]): IO[E, A]
Safely imports an exception-throwing synchronous effect into a pure
IOvalue, translating the specified throwables intoEwith the provided user-defined function. -
final
def
syncException[A](effect: ⇒ A): IO[Exception, A]
Imports a synchronous effect into a pure
IOvalue, translating any exceptions into anExceptionfailure in the returned value.Imports a synchronous effect into a pure
IOvalue, translating any exceptions into anExceptionfailure in the returned value.def putStrLn(line: String): IO[Exception, Unit] = IO.syncException(println(line))
-
final
def
syncExec[A](effect: (Executor) ⇒ A): IO[Nothing, A]
Imports a synchronous effect into a pure
IOvalue.Imports a synchronous effect into a pure
IOvalue. This variant ofsynclets you use the current executor of the fiber. -
final
def
syncThrowable[A](effect: ⇒ A): IO[Throwable, A]
Imports a synchronous effect into a pure
IOvalue, translating any throwables into aThrowablefailure in the returned value.Imports a synchronous effect into a pure
IOvalue, translating any throwables into aThrowablefailure in the returned value.def putStrLn(line: String): IO[Throwable, Unit] = IO.syncThrowable(println(line))
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
val
unit: IO[Nothing, Unit]
Strictly-evaluated unit lifted into the
IOmonad. -
final
def
unsandbox[E, A](v: IO[Cause[E], A]): IO[E, A]
The inverse operation
IO.sandboxedThe inverse operation
IO.sandboxedTerminates with exceptions on the
Leftside of theEithererror, if it exists. Otherwise extracts the containedIO[E, A] -
final
def
unyielding[E, A](io: IO[E, A]): IO[E, A]
A combinator that allows you to identify long-running
IOvalues to the runtime system for improved scheduling. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
when[E](b: Boolean)(io: IO[E, Unit]): IO[E, Unit]
The moral equivalent of
if (p) exp -
final
def
whenM[E](b: IO[Nothing, Boolean])(io: IO[E, Unit]): IO[E, Unit]
The moral equivalent of
if (p) expwhenphas side-effects -
final
def
yieldNow: IO[Nothing, Unit]
Yields to the runtime system, starting on a fresh stack.
- object Descriptor extends IO[Nothing, Descriptor]
- object Tags
- object Yield extends IO[Nothing, Unit]