object IO
- Alphabetic
- By Inheritance
- IO
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final class AsyncEffect[E, A] extends IO[E, A]
- final class AsyncIOEffect[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 Point[A] extends IO[Nothing, A]
- final class Race[E, A0, A1, A] extends IO[E, A]
- final class Redeem[E1, E2, A, B] extends IO[E2, B] with Function[A, IO[E2, B]]
- final class Sleep extends IO[Nothing, Unit]
- final class Strict[A] extends IO[Nothing, A]
- final class Supervise[E, A] extends IO[E, A]
- final class Supervisor extends IO[Nothing, (Throwable) ⇒ IO[Nothing, Unit]]
- final class Suspend[E, A] extends IO[E, A]
- final class SyncEffect[A] extends IO[Nothing, A]
- final class Terminate extends IO[Nothing, Nothing]
- 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: (Callback[E, A]) ⇒ 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. -
final
def
async0[E, A](register: (Callback[E, A]) ⇒ Async[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
asyncPure[E, A](register: (Callback[E, A]) ⇒ IO[E, Unit]): 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
bracket[E, A, B](acquire: IO[E, A])(release: (A) ⇒ IO[Nothing, Unit])(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 occured in between. -
final
def
bracket0[E, A, B](acquire: IO[E, A])(release: (A, ExitResult[E, B]) ⇒ IO[Nothing, Unit])(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
done[E, A](r: ExitResult[E, A]): IO[E, A]
Creates an
IOvalue fromExitResult -
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
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
fromEither[E, A](v: Either[E, A]): IO[E, A]
Lifts an
Eitherinto anIO. -
final
def
fromOption[A](v: Option[A]): IO[Unit, A]
Lifts an
Optioninto anIO. -
final
def
fromTry[A](v: Try[A]): IO[Throwable, A]
Lifts a
Tryinto anIO. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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
now[A](a: A): IO[Nothing, A]
Lifts a strictly evaluated value into the
IOmonad. -
final
def
parAll[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
sequence. -
def
parTraverse[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 oftraverse. -
final
def
point[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
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
sequence[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
parAll. -
final
def
shift(ec: ExecutionContext): IO[Nothing, Unit]
Shifts the operation to another execution context.
Shifts the operation to another execution context.
IO.shift(myPool) *> myTask
-
final
def
sleep(duration: Duration): IO[Nothing, Unit]
Sleeps for the specified duration.
Sleeps for the specified duration. This is always asynchronous.
-
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, Unit]): IO[E, A]
Supervises the specified action's spawned fibers.
-
final
def
supervisor: IO[Nothing, (Throwable) ⇒ IO[Nothing, Unit]]
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
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
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
-
final
def
terminate(t: Throwable, ts: Throwable*): IO[Nothing, Nothing]
Terminates the fiber executing this action with the specified error(s), running all finalizers.
-
final
def
terminate: IO[Nothing, Nothing]
Terminates the fiber executing this action, running all finalizers.
-
final
def
terminate0(ts: List[Throwable]): IO[Nothing, Nothing]
Terminates the fiber executing this action, running all finalizers.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
traverse[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 useparTraverse. -
final
val
unit: IO[Nothing, Unit]
Strictly-evaluated unit lifted into the
IOmonad. -
final
def
unsandbox[E, A](v: IO[Either[List[Throwable], 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
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( ... )
- object Tags