Packages

object IO extends Serializable

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IO
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class AsyncEffect[E, A] extends IO[E, A]
  2. final class Descriptor extends IO[Nothing, Fiber.Descriptor]
  3. final class Ensuring[E, A] extends IO[E, A]
  4. final class Fail[E] extends IO[E, Nothing]
  5. final class FlatMap[E, A0, A] extends IO[E, A]
  6. final class Fork[E, A] extends IO[Nothing, Fiber[E, A]]
  7. final class Point[A] extends IO[Nothing, A]
  8. final class Redeem[E, E2, A, B] extends IO[E2, B] with Function[A, IO[E2, B]]
  9. final class Sleep extends IO[Nothing, Unit]
  10. final class Strict[A] extends IO[Nothing, A]
  11. final class Supervise[E, A] extends IO[E, A]
  12. final class SyncEffect[A] extends IO[Nothing, A]
  13. final class Uninterruptible[E, A] extends IO[E, A]

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def absolve[E, A](v: IO[E, Either[E, A]]): IO[E, A]

    Submerges the error case of an Either into the IO.

    Submerges the error case of an Either into the IO. The inverse operation of IO.attempt.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. final def async[E, A](register: (Callback[E, A]) ⇒ Unit): IO[E, A]

    Imports an asynchronous effect into a pure IO value.

    Imports an asynchronous effect into a pure IO value. See async0 for the more expressive variant of this function.

  7. final def async0[E, A](register: (Callback[E, A]) ⇒ Async[E, A]): IO[E, A]

    Imports an asynchronous effect into a pure IO value.

    Imports an asynchronous effect into a pure IO value. 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.

  8. final def asyncPure[E, A](register: (Callback[E, A]) ⇒ IO[Nothing, Unit]): IO[E, A]

    Imports an asynchronous effect into a pure IO value.

    Imports an asynchronous effect into a pure IO value. This formulation is necessary when the effect is itself expressed in terms of IO.

  9. 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. bracket will release the resource no matter the outcome of the computation, and will re-throw any exception that occurred in between.

  10. 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 bracket0 not only is the acquired resource be cleaned up, the outcome of the computation is also reified for processing.

  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  12. final def collectParN[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 n tasks run in parallel. This is a version of collectPar, with a throttle.

  13. final def done[E, A](r: ExitResult[E, A]): IO[E, A]

    Creates an IO value from ExitResult

  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. final def fail[E](error: E): IO[E, Nothing]

    Creates an IO value that represents failure with the specified error.

    Creates an IO value that represents failure with the specified error. The moral equivalent of throw for pure code.

  17. final def fail0[E](cause: Cause[E]): IO[E, Nothing]

    Terminates the fiber executing this action with the specified cause, running all finalizers.

  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def flatten[E, A](io: IO[E, IO[E, A]]): IO[E, A]

    Flattens a nested action.

  20. 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 n tasks run in parallel. This is a version of foreachPar, with a throttle.

  21. 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.

  22. 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.

  23. final def fromEither[E, A](v: Either[E, A]): IO[E, A]

    Lifts an Either into an IO.

  24. final def fromOption[A](v: Option[A]): IO[Unit, A]

    Lifts an Option into an IO.

  25. final def fromTry[A](effect: ⇒ Try[A]): IO[Throwable, A]

    Imports a Try into an IO.

  26. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. final def interrupt: IO[Nothing, Nothing]

    Interrupts the fiber executing this action, running all finalizers.

  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. 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.

  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. 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.

  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. final def now[A](a: A): IO[Nothing, A]

    Lifts a strictly evaluated value into the IO monad.

  36. 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.

  37. final 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 of traverse.

  38. final def point[A](a: ⇒ A): IO[Nothing, A]

    Lifts a non-strictly evaluated value into the IO monad.

    Lifts a non-strictly evaluated value into the IO monad. Do not use this function to capture effectful code. The result is undefined but may include duplicated effects.

  39. 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 a Iterable[IO[E, A]].

    Races an IO[E, A] against elements of a Iterable[IO[E, A]]. Yields either the first success or the last failure.

  40. 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.

  41. 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.

  42. 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.

  43. 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
  44. final def shift: IO[Nothing, Unit]

    Shifts execution to a thread in the default ExecutionContext.

  45. final def sleep(duration: Duration): IO[Nothing, Unit]

    Sleeps for the specified duration.

    Sleeps for the specified duration. This is always asynchronous.

  46. 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.

  47. 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.

  48. final def supervisor: IO[Nothing, (Cause[Nothing]) ⇒ IO[Nothing, Unit]]

    Retrieves the supervisor associated with the fiber running the action returned by this method.

  49. final def suspend[E, A](io: ⇒ IO[E, A]): IO[E, A]

    Lazily produces an IO value whose construction may have actional costs that should be deferred until evaluation.

    Lazily produces an IO value whose construction may have actional costs that should be deferred until evaluation.

    Do not use this method to effectfully construct IO values. The results will be undefined and most likely involve the physical explosion of your computer in a heap of rubble.

  50. final def sync[A](effect: ⇒ A): IO[Nothing, A]

    Imports a synchronous effect into a pure IO value.

    Imports a synchronous effect into a pure IO value.

    val nanoTime: IO[Nothing, Long] = IO.sync(System.nanoTime())
  51. final def syncCatch[E, A](effect: ⇒ A)(f: PartialFunction[Throwable, E]): IO[E, A]

    Safely imports an exception-throwing synchronous effect into a pure IO value, translating the specified throwables into E with the provided user-defined function.

  52. final def syncException[A](effect: ⇒ A): IO[Exception, A]

    Imports a synchronous effect into a pure IO value, translating any exceptions into an Exception failure in the returned value.

    Imports a synchronous effect into a pure IO value, translating any exceptions into an Exception failure in the returned value.

    def putStrLn(line: String): IO[Exception, Unit] = IO.syncException(println(line))
  53. final def syncSubmit[A](effect: (ExecutionContext) ⇒ A): IO[Nothing, A]

    Imports a synchronous effect into a pure IO value.

    Imports a synchronous effect into a pure IO value. This variant of sync lets you reuse the current execution context of the fiber.

    val nanoTime: IO[Nothing, Long] = IO.sync(System.nanoTime())
  54. final def syncThrowable[A](effect: ⇒ A): IO[Throwable, A]

    Imports a synchronous effect into a pure IO value, translating any throwables into a Throwable failure in the returned value.

    Imports a synchronous effect into a pure IO value, translating any throwables into a Throwable failure in the returned value.

    def putStrLn(line: String): IO[Throwable, Unit] = IO.syncThrowable(println(line))
  55. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  56. final def terminate(t: Throwable): IO[Nothing, Nothing]

    Terminates the fiber executing this action with the specified error, running all finalizers.

  57. def toString(): String
    Definition Classes
    AnyRef → Any
  58. 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 new List[B].

    Apply the function fn to each element of the Iterable[A] and return the results in a new List[B]. For parallelism use parTraverse.

  59. final val unit: IO[Nothing, Unit]

    Strictly-evaluated unit lifted into the IO monad.

  60. final def unsandbox[E, A](v: IO[Cause[E], A]): IO[E, A]

    The inverse operation IO.sandboxed

    The inverse operation IO.sandboxed

    Terminates with exceptions on the Left side of the Either error, if it exists. Otherwise extracts the contained IO[E, A]

  61. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  64. final def when[E](b: Boolean)(io: IO[E, Unit]): IO[E, Unit]

    The moral equivalent of if (p) exp

  65. final def whenM[E](b: IO[Nothing, Boolean])(io: IO[E, Unit]): IO[E, Unit]

    The moral equivalent of if (p) exp when p has side-effects

  66. object Tags

Deprecated Value Members

  1. final def sequenceParN[E, A](n: Long)(as: Iterable[IO[E, A]]): IO[E, List[A]]

    Alias for collectParN

    Alias for collectParN

    Annotations
    @deprecated
    Deprecated

    (Since version scalaz-zio 0.3.3) Use collectParN

  2. final def traverseParN[E, A, B](n: Long)(as: Iterable[A])(fn: (A) ⇒ IO[E, B]): IO[E, List[B]]

    Alias for foreachParN

    Alias for foreachParN

    Annotations
    @deprecated
    Deprecated

    (Since version scalaz-zio 0.3.3) Use foreachParN

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped