Trait

scalaz.zio

ZIOFunctions

Related Doc: package zio

Permalink

trait ZIOFunctions extends Serializable

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

Type Members

  1. abstract type LowerR

    Permalink
  2. abstract type UpperE

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def absolve[R >: LowerR, E <: UpperE, A](v: ZIO[R, E, Either[E, A]]): ZIO[R, E, A]

    Permalink

    Submerges the error case of an Either into the ZIO.

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

  5. final def access[R >: LowerR]: AccessPartiallyApplied[R]

    Permalink

    Accesses the environment of the effect.

    Accesses the environment of the effect.

    val portNumber = effect.access(_.config.portNumber)
  6. final def accessM[R >: LowerR]: AccessMPartiallyApplied[R]

    Permalink

    Effectfully accesses the environment of the effect.

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. final def bracket[R >: LowerR, E <: UpperE, A, A1 >: A, A2 >: A, B](acquire: ZIO[R, E, A], release: (A) ⇒ ZIO[R, Nothing, _], use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]

    Permalink

    Uncurried version.

    Uncurried version. Doesn't offer curried syntax and have worse type-inference characteristics, but guarantees no extra allocations of intermediate scalaz.zio.ZIO.BracketAcquire and scalaz.zio.ZIO.BracketRelease objects.

  9. final def bracket[R >: LowerR, E <: UpperE, A](acquire: ZIO[R, E, A]): BracketAcquire[R, E, A]

    Permalink

    When this effect represents acquisition of a resource (for example, opening a file, launching a thread, etc.), bracket can be used to ensure the acquisition is not interrupted and the resource is always released.

    When this effect represents acquisition of a resource (for example, opening a file, launching a thread, etc.), bracket can be used to ensure the acquisition is not interrupted and the resource is always released.

    The function does two things:

    1. Ensures this effect, which acquires the resource, will not be interrupted. Of course, acquisition may fail for internal reasons (an uncaught exception). 2. Ensures the release effect will not be interrupted, and will be executed so long as this effect successfully acquires the resource.

    In between acquisition and release of the resource, the use effect is executed.

    If the release effect fails, then the entire effect will fail even if the use effect succeeds. If this fail-fast behavior is not desired, errors produced by the release effect can be caught and ignored.

    openFile("data.json").bracket(closeFile) { file =>
      for {
        header <- readHeader(file)
        ...
      } yield result
    }
  10. final def bracketExit[R >: LowerR, E <: UpperE, E1 >: E, E2 >: E <: E1, A, B](acquire: ZIO[R, E, A], release: (A, Exit[E1, B]) ⇒ ZIO[R, Nothing, _], use: (A) ⇒ ZIO[R, E2, B]): ZIO[R, E2, B]

    Permalink

    Uncurried version.

    Uncurried version. Doesn't offer curried syntax and have worse type-inference characteristics, but guarantees no extra allocations of intermediate scalaz.zio.ZIO.BracketExitAcquire and scalaz.zio.ZIO.BracketExitRelease objects.

  11. final def bracketExit[R >: LowerR, E <: UpperE, A](acquire: ZIO[R, E, A]): BracketExitAcquire[R, E, A]

    Permalink

    Acquires a resource, uses the resource, and then releases the resource.

    Acquires a resource, uses the resource, and then releases the resource. Neither the acquisition nor the release will be interrupted, and the resource is guaranteed to be released, so long as the acquire effect succeeds. If use fails, then after release, the returned effect will fail with the same error.

  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def collectAll[R >: LowerR, E <: UpperE, A](in: Iterable[ZIO[R, E, A]]): ZIO[R, E, List[A]]

    Permalink

    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 a parallel version, see collectAllPar.

  14. final def collectAllPar[R >: LowerR, E <: UpperE, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, E, List[A]]

    Permalink

    Evaluate each effect in the structure in parallel, and collect the results.

    Evaluate each effect in the structure in parallel, and collect the results. For a sequential version, see collectAll.

  15. final def collectAllParN[R >: LowerR, E <: UpperE, A](n: Long)(as: Iterable[ZIO[R, E, A]]): ZIO[R, E, List[A]]

    Permalink

    Evaluate each effect in the structure in parallel, and collect the results.

    Evaluate each effect in the structure in parallel, and collect the results. For a sequential version, see collectAll.

    Unlike foreachAllPar, this method will use at most n fibers.

  16. final def descriptor: UIO[Descriptor]

    Permalink

    Returns information about the current fiber, such as its fiber identity.

  17. final def die(t: Throwable): UIO[Nothing]

    Permalink

    Returns an effect that dies with the specified Throwable.

    Returns an effect that dies with the specified Throwable. This method can be used for terminating a fiber because a defect has been detected in the code.

  18. final def dieMessage(message: String): UIO[Nothing]

    Permalink

    Returns an effect that dies with a java.lang.RuntimeException having the specified text message.

    Returns an effect that dies with a java.lang.RuntimeException having the specified text message. This method can be used for terminating a fiber because a defect has been detected in the code.

  19. final def done[E <: UpperE, A](r: Exit[E, A]): IO[E, A]

    Permalink

    Returns an effect from a scalaz.zio.Exit value.

  20. final def effectAsync[E <: UpperE, A](register: ((ZIO[Any, E, A]) ⇒ Unit) ⇒ Unit): ZIO[Any, E, A]

    Permalink

    Imports an asynchronous effect into a pure ZIO value.

    Imports an asynchronous effect into a pure ZIO value. See effectAsyncMaybe for the more expressive variant of this function that can return a value synchronously.

  21. final def effectAsyncInterrupt[R >: LowerR, E <: UpperE, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Either[Canceler, ZIO[R, E, A]]): ZIO[R, E, A]

    Permalink

    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.

  22. final def effectAsyncM[E <: UpperE, A](register: ((IO[E, A]) ⇒ Unit) ⇒ UIO[_]): IO[E, A]

    Permalink

    Imports an asynchronous effect into a pure ZIO value.

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

  23. final def effectAsyncMaybe[E <: UpperE, A](register: ((ZIO[Any, E, A]) ⇒ Unit) ⇒ Option[IO[E, A]]): ZIO[Any, E, A]

    Permalink

    Imports an asynchronous effect into a pure ZIO value, possibly returning the value synchronously.

  24. final def effectTotal[A](effect: ⇒ A): UIO[A]

    Permalink

    Imports a total synchronous effect into a pure ZIO value.

    Imports a total synchronous effect into a pure ZIO value. The effect must not throw any exceptions. If you wonder if the effect throws exceptions, then do not use this method, use Task.effect, IO.effect, or ZIO.effect.

    val nanoTime: UIO[Long] = IO.effectTotal(System.nanoTime())
  25. final def effectTotalWith[A](effect: (Platform) ⇒ A): UIO[A]

    Permalink

    Imports a total synchronous effect into a pure ZIO value.

    Imports a total synchronous effect into a pure ZIO value. This variant of effectTotal lets the impure code use the platform capabilities.

    The effect must not throw any exceptions. If you wonder if the effect throws exceptions, then do not use this method, use Task.effect, IO.effect, or ZIO.effect.

    val nanoTime: UIO[Long] = IO.effectTotal(System.nanoTime())
  26. final def environment[R >: LowerR]: ZIO[R, Nothing, R]

    Permalink

    Accesses the whole environment of the effect.

  27. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def fail[E <: UpperE](error: E): IO[E, Nothing]

    Permalink

    Returns an effect that models failure with the specified error.

    Returns an effect that models failure with the specified error. The moral equivalent of throw for pure code.

  30. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  31. final def flatten[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, ZIO[R, E, A]]): ZIO[R, E, A]

    Permalink

    Returns an effect that first executes the outer effect, and then executes the inner effect, returning the value from the inner effect, and effectively flattening a nested effect.

  32. final def foldLeft[R >: LowerR, E, S, A](in: Iterable[A])(zero: S)(f: (S, A) ⇒ ZIO[R, E, S]): ZIO[R, E, S]

    Permalink

    Folds an Iterable[A] using an effectful function f, working sequentially.

  33. final def foreach[R >: LowerR, E <: UpperE, A, B](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, List[B]]

    Permalink

    Applies the function f to each element of the Iterable[A] and returns the results in a new List[B].

    Applies the function f to each element of the Iterable[A] and returns the results in a new List[B].

    For a parallel version of this method, see foreachPar.

  34. final def foreachPar[R >: LowerR, E <: UpperE, A, B](as: Iterable[A])(fn: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, List[B]]

    Permalink

    Applies the function f to each element of the Iterable[A] in parallel, and returns the results in a new List[B].

    Applies the function f to each element of the Iterable[A] in parallel, and returns the results in a new List[B].

    For a sequential version of this method, see foreach.

  35. final def foreachParN[R >: LowerR, E <: UpperE, A, B](n: Long)(as: Iterable[A])(fn: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, List[B]]

    Permalink

    Applies the function f to each element of the Iterable[A] in parallel, and returns the results in a new List[B].

    Applies the function f to each element of the Iterable[A] in parallel, and returns the results in a new List[B].

    Unlike foreachPar, this method will use at most up to n fibers.

  36. final def forkAll[R >: LowerR, E <: UpperE, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, Nothing, Fiber[E, List[A]]]

    Permalink

    Returns an effect that forks all of the specified values, and returns a composite fiber that produces a list of their results, in order.

  37. final def forkAll_[R >: LowerR, E <: UpperE, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, Nothing, Unit]

    Permalink

    Returns an effect that forks all of the specified values, and returns a composite fiber that produces unit.

    Returns an effect that forks all of the specified values, and returns a composite fiber that produces unit. This version is faster than forkAll in cases where the results of the forked fibers are not needed.

  38. final def fromEither[E <: UpperE, A](v: ⇒ Either[E, A]): IO[E, A]

    Permalink

    Lifts an Either into a ZIO value.

  39. final def fromFiber[E <: UpperE, A](fiber: ⇒ Fiber[E, A]): IO[E, A]

    Permalink

    Creates a ZIO value that represents the exit value of the specified fiber.

  40. final def fromFiberM[E <: UpperE, A](fiber: IO[E, Fiber[E, A]]): IO[E, A]

    Permalink

    Creates a ZIO value that represents the exit value of the specified fiber.

  41. final def fromFunction[R >: LowerR, A](f: (R) ⇒ A): ZIO[R, Nothing, A]

    Permalink

    Lifts a function R => A into a ZIO[R, Nothing, A].

  42. final def fromFunctionM[R >: LowerR, E, A](f: (R) ⇒ IO[E, A]): ZIO[R, E, A]

    Permalink

    Lifts an effectful function whose effect requires no environment into an effect that requires the input to the function.

  43. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  44. final def halt[E <: UpperE](cause: Cause[E]): IO[E, Nothing]

    Permalink

    Returns an effect that models failure with the specified Cause.

  45. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  46. final val interrupt: UIO[Nothing]

    Permalink

    Returns an effect that is interrupted.

  47. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  48. final def lock[R >: LowerR, E <: UpperE, A](executor: Executor)(zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Returns an effect that will execute the specified effect fully on the provided executor, before returning to the default executor.

  49. final def mergeAll[R >: LowerR, E <: UpperE, A, B](in: Iterable[ZIO[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZIO[R, E, B]

    Permalink

    Merges an Iterable[IO] to a single IO, working sequentially.

  50. final def mergeAllPar[R >: LowerR, E <: UpperE, A, B](in: Iterable[ZIO[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZIO[R, E, B]

    Permalink

    Merges an Iterable[IO] to a single IO, working in parallel.

  51. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  52. final val never: UIO[Nothing]

    Permalink

    Returns a effect that will never produce anything.

    Returns a effect that will never produce anything. The moral equivalent of while(true) {}, only without the wasted CPU cycles.

  53. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  54. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  55. final def provide[R >: LowerR, E <: UpperE, A](r: R): (ZIO[R, E, A]) ⇒ IO[E, A]

    Permalink

    Given an environment R, returns a function that can supply the environment to programs that require it, removing their need for any specific environment.

    Given an environment R, returns a function that can supply the environment to programs that require it, removing their need for any specific environment.

    This is similar to dependency injection, and the provide function can be thought of as inject.

  56. final def raceAll[R >: LowerR, R1 >: LowerR <: R, E <: UpperE, A](zio: ZIO[R, E, A], ios: Iterable[ZIO[R1, E, A]]): ZIO[R1, E, A]

    Permalink

    Races an IO[E, A] against zero or more other effects.

    Races an IO[E, A] against zero or more other effects. Yields either the first success or the last failure.

  57. final def reduceAll[R >: LowerR, R1 >: LowerR <: R, E <: UpperE, A](a: ZIO[R, E, A], as: Iterable[ZIO[R1, E, A]])(f: (A, A) ⇒ A): ZIO[R1, E, A]

    Permalink

    Reduces an Iterable[IO] to a single IO, working sequentially.

  58. final def reduceAllPar[R >: LowerR, R1 >: LowerR <: R, E <: UpperE, A](a: ZIO[R, E, A], as: Iterable[ZIO[R1, E, A]])(f: (A, A) ⇒ A): ZIO[R1, E, A]

    Permalink

    Reduces an Iterable[IO] to a single IO, working in parallel.

  59. final def require[E <: UpperE, A](error: E): (IO[E, Option[A]]) ⇒ IO[E, A]

    Permalink

    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.

  60. final def runtime[R >: LowerR]: ZIO[R, Nothing, Runtime[R]]

    Permalink

    Returns an effect that accesses the runtime, which can be used to (unsafely) execute tasks.

    Returns an effect that accesses the runtime, which can be used to (unsafely) execute tasks. This is useful for integration with non-functional code that must call back into functional code.

  61. final def succeed[A](a: A): UIO[A]

    Permalink

    Returns an effect that models success with the specified strictly- evaluated value.

  62. final def succeedLazy[A](a: ⇒ A): UIO[A]

    Permalink

    Returns an effect that models success with the specified lazily-evaluated value.

    Returns an effect that models success with the specified lazily-evaluated value. This method should not be used to capture effects. See ZIO.effectTotal for capturing total effects, and ZIO.effect for capturing partial effects.

  63. final def supervise[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Returns an effect that supervises the specified effect, ensuring that all fibers that it forks are interrupted as soon as the supervised effect completes.

  64. final def superviseWith[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A])(supervisor: (Iterable[Fiber[_, _]]) ⇒ UIO[_]): ZIO[R, E, A]

    Permalink

    Returns an effect that supervises the specified effect, ensuring that all fibers that it forks are passed to the specified supervisor as soon as the supervised effect completes.

  65. final def suspend[R >: LowerR, E <: UpperE, A](io: ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. This is a shortcut for flatten(effectTotal(io)).

  66. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  67. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  68. final def unit[R >: LowerR]: ZIO[R, Nothing, Unit]

    Permalink

    Strictly-evaluated unit lifted into the ZIO monad.

  69. final def unsandbox[R >: LowerR, E <: UpperE, A](v: ZIO[R, Cause[E], A]): ZIO[R, E, A]

    Permalink

    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]

  70. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  71. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  72. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. final def when[R >: LowerR, E <: UpperE](b: Boolean)(zio: ZIO[R, E, _]): ZIO[R, E, Unit]

    Permalink

    The moral equivalent of if (p) exp

  74. final def whenM[R >: LowerR, E <: UpperE](b: ZIO[R, E, Boolean])(zio: ZIO[R, E, _]): ZIO[R, E, Unit]

    Permalink

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

  75. final val yieldNow: UIO[Unit]

    Permalink

    Returns an effect that yields to the runtime system, starting on a fresh stack.

    Returns an effect that yields to the runtime system, starting on a fresh stack. Manual use of this method can improve fairness, at the cost of overhead.

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped