ZPure

zio.prelude.fx.ZPure
See theZPure companion object
sealed trait ZPure[+W, -S1, +S2, -R, +E, +A]

ZPure[W, S1, S2, R, E, A] is a purely functional description of a computation that requires an environment R and an initial state S1 and may either fail with an E or succeed with an updated state S2 and an A along with in either case a log with entries of type W. Because of its polymorphism ZPure can be used to model a variety of effects including context, state, failure, and logging.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ZPure[W, S1, S2, R, E, A]

Members list

Value members

Concrete methods

final def &>[W1 >: W, S3 >: S2 <: S1, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S3, S3, R1, E1, B]): ZPure[W1, S3, S3, R1, E1, B]

A symbolic alias for zipParRight.

A symbolic alias for zipParRight.

Attributes

final def *>[W1 >: W, S3, R1 <: R, E1 >: E, B](that: ZPure[W1, S2, S3, R1, E1, B]): ZPure[W1, S1, S3, R1, E1, B]

A symbolic alias for zipRight.

A symbolic alias for zipRight.

Attributes

final def <&[W1 >: W, S3 >: S2 <: S1, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S3, S3, R1, E1, B]): ZPure[W1, S3, S3, R1, E1, A]

A symbolic alias for zipParLeft.

A symbolic alias for zipParLeft.

Attributes

final def <&>[W1 >: W, S3 >: S2 <: S1, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S3, S3, R1, E1, B])(implicit zippable: Zippable[A, B]): ZPure[W1, S3, S3, R1, E1, zippable.Out]

A symbolic alias for zipPar.

A symbolic alias for zipPar.

Attributes

final def <*[W1 >: W, S3, R1 <: R, E1 >: E, B](that: ZPure[W1, S2, S3, R1, E1, B]): ZPure[W1, S1, S3, R1, E1, A]

A symbolic alias for zipLeft.

A symbolic alias for zipLeft.

Attributes

final def <*>[W1 >: W, S3, R1 <: R, E1 >: E, B](that: ZPure[W1, S2, S3, R1, E1, B])(implicit zippable: Zippable[A, B]): ZPure[W1, S1, S3, R1, E1, zippable.Out]

A symbolic alias for zip.

A symbolic alias for zip.

Attributes

final def <+>[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1, B](that: => ZPure[W1, S0, S3, R1, E1, B])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, Either[A, B]]

A symbolic alias for orElseEither.

A symbolic alias for orElseEither.

Attributes

final def <>[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1, A1 >: A](that: => ZPure[W1, S0, S3, R1, E1, A1])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, A1]

A symbolic alias for orElse.

A symbolic alias for orElse.

Attributes

final def >>=[W1 >: W, S3, R1 <: R, E1 >: E, B](f: A => ZPure[W1, S2, S3, R1, E1, B]): ZPure[W1, S1, S3, R1, E1, B]

A symbolic alias for flatMap.

A symbolic alias for flatMap.

Attributes

final def ??[W1 >: W](w: W1): ZPure[W1, S1, S2, R, E, A]

A symbolic alias for log.

A symbolic alias for log.

Attributes

final def absolve[E1 >: E, B](implicit ev: A <:< Either[E1, B]): ZPure[W, S1, S2, R, E1, B]

Submerges the error case of an Either into the error type of this computation.

Submerges the error case of an Either into the error type of this computation.

Attributes

final def as[B](b: => B): ZPure[W, S1, S2, R, E, B]

Maps the success value of this computation to a constant value.

Maps the success value of this computation to a constant value.

Attributes

final def asSome: ZPure[W, S1, S2, R, E, Option[A]]

Maps the success value of this computation to the optional value.

Maps the success value of this computation to the optional value.

Attributes

final def asSomeError(implicit ev: CanFail[E]): ZPure[W, S1, S2, R, Option[E], A]

Maps the error value of this computation to the optional value.

Maps the error value of this computation to the optional value.

Attributes

final def asState[S3](s: S3): ZPure[W, S1, S3, R, E, A]

Maps the output state to a constant value

Maps the output state to a constant value

Attributes

final def bimap[E1, B](f: E => E1, g: A => B)(implicit ev: CanFail[E]): ZPure[W, S1, S2, R, E1, B]

Returns a computation whose error and success channels have been mapped by the specified functions, f and g.

Returns a computation whose error and success channels have been mapped by the specified functions, f and g.

Attributes

final def catchAll[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1, A1 >: A](f: E => ZPure[W1, S0, S3, R1, E1, A1])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, A1]

Recovers from all errors.

Recovers from all errors.

Attributes

final def catchSome[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1 >: E, A1 >: A](pf: PartialFunction[E, ZPure[W1, S0, S3, R1, E1, A1]])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, A1]

Recovers from some or all of the error cases.

Recovers from some or all of the error cases.

Attributes

final def clearLogOnError: ZPure[W, S1, S2, R, E, A]

Modifies the behavior of the inner computation regarding logs, so that logs written in a failed computation will be cleared.

Modifies the behavior of the inner computation regarding logs, so that logs written in a failed computation will be cleared.

Attributes

final def collect[E1 >: E, B](e: => E1)(pf: PartialFunction[A, B]): ZPure[W, S1, S2, R, E1, B]

Transforms the result of this computation with the specified partial function, failing with the e value if the partial function is not defined for the given input.

Transforms the result of this computation with the specified partial function, failing with the e value if the partial function is not defined for the given input.

Attributes

final def collectM[W1 >: W, S3, R1 <: R, E1 >: E, B](e: => E1)(pf: PartialFunction[A, ZPure[W1, S2, S3, R1, E1, B]]): ZPure[W1, S1, S3, R1, E1, B]

Transforms the result of this computation with the specified partial function which returns a new computation, failing with the e value if the partial function is not defined for the given input.

Transforms the result of this computation with the specified partial function which returns a new computation, failing with the e value if the partial function is not defined for the given input.

Attributes

final def contramapState[S0](f: S0 => S1): ZPure[W, S0, S2, R, E, A]

Transforms the initial state of this computation with the specified function.

Transforms the initial state of this computation with the specified function.

Attributes

final def either[S3 >: S2 <: S1](implicit ev: CanFail[E]): ZPure[W, S3, S3, R, Nothing, Either[E, A]]

Returns a computation whose failure and success have been lifted into an Either. The resulting computation cannot fail, because the failure case has been exposed as part of the Either success case.

Returns a computation whose failure and success have been lifted into an Either. The resulting computation cannot fail, because the failure case has been exposed as part of the Either success case.

Attributes

final def filterOrElse[W1 >: W, S3 >: S2, R1 <: R, E1 >: E, A1 >: A](p: A => Boolean)(f: A => ZPure[W1, S2, S3, R1, E1, A1]): ZPure[W1, S1, S3, R1, E1, A1]

Applies the specified function if the predicate fails.

Applies the specified function if the predicate fails.

Attributes

final def filterOrElse_[W1 >: W, S3 >: S2, R1 <: R, E1 >: E, A1 >: A](p: A => Boolean)(zPure: => ZPure[W1, S2, S3, R1, E1, A1]): ZPure[W1, S1, S3, R1, E1, A1]

Similar to filterOrElse, but instead of a function it accepts the ZPure computation to apply if the predicate fails.

Similar to filterOrElse, but instead of a function it accepts the ZPure computation to apply if the predicate fails.

Attributes

final def filterOrFail[E1 >: E](p: A => Boolean)(e: => E1): ZPure[W, S1, S2, R, E1, A]

Fails with the specified error if the predicate fails.

Fails with the specified error if the predicate fails.

Attributes

final def flatMap[W1 >: W, S3, R1 <: R, E1 >: E, B](f: A => ZPure[W1, S2, S3, R1, E1, B]): ZPure[W1, S1, S3, R1, E1, B]

Extends this computation with another computation that depends on the result of this computation by running the first computation, using its result to generate a second computation, and running that computation.

Extends this computation with another computation that depends on the result of this computation by running the first computation, using its result to generate a second computation, and running that computation.

Attributes

final def flatten[W1 >: W, S3, R1 <: R, E1 >: E, B](implicit ev: A <:< ZPure[W1, S2, S3, R1, E1, B]): ZPure[W1, S1, S3, R1, E1, B]

Flattens a nested computation to a single computation by running the outer computation and then running the inner computation.

Flattens a nested computation to a single computation by running the outer computation and then running the inner computation.

Attributes

final def flip[S3 >: S2 <: S1]: ZPure[W, S3, S3, R, A, E]

Swaps the error and success types of this computation.

Swaps the error and success types of this computation.

Attributes

final def fold[S3 >: S2 <: S1, B](failure: E => B, success: A => B)(implicit ev: CanFail[E]): ZPure[W, S3, S3, R, Nothing, B]

Folds over the failed or successful results of this computation to yield a computation that does not fail, but succeeds with the value of the left or right function passed to fold.

Folds over the failed or successful results of this computation to yield a computation that does not fail, but succeeds with the value of the left or right function passed to fold.

Attributes

final def foldCauseM[W1 >: W, S0 <: S1, S3, R1 <: R, E1, B](failure: (Cause[E]) => ZPure[W1, S0, S3, R1, E1, B], success: A => ZPure[W1, S2, S3, R1, E1, B])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, B]
final def foldM[W1 >: W, S0 <: S1, S3, R1 <: R, E1, B](failure: E => ZPure[W1, S0, S3, R1, E1, B], success: A => ZPure[W1, S2, S3, R1, E1, B])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, B]

Recovers from errors by accepting one computation to execute for the case of an error, and one computation to execute for the case of success.

Recovers from errors by accepting one computation to execute for the case of an error, and one computation to execute for the case of success.

Attributes

final def getState: ZPure[W, S1, S2, R, E, (S2, A)]

Exposes the output state into the value channel.

Exposes the output state into the value channel.

Attributes

final def head[B](implicit ev: A <:< List[B]): ZPure[W, S1, S2, R, Option[E], B]

Returns a successful computation with the head of the list if the list is non-empty or fails with the error None if the list is empty.

Returns a successful computation with the head of the list if the list is non-empty or fails with the error None if the list is empty.

Attributes

final def keepLogOnError: ZPure[W, S1, S2, R, E, A]

Modifies the behavior of the inner computation regarding logs, so that logs written in a failed computation will be kept (this is the default behavior).

Modifies the behavior of the inner computation regarding logs, so that logs written in a failed computation will be kept (this is the default behavior).

Attributes

final def left[B, C](implicit ev: A <:< Either[B, C]): ZPure[W, S1, S2, R, Option[E], B]

Returns a successful computation if the value is Left, or fails with error None.

Returns a successful computation if the value is Left, or fails with error None.

Attributes

final def leftOrFail[B, C, E1 >: E](e: => E1)(implicit ev: A <:< Either[B, C]): ZPure[W, S1, S2, R, E1, B]

Returns a successful computation if the value is Left, or fails with error e.

Returns a successful computation if the value is Left, or fails with error e.

Attributes

final def leftOrFailWith[B, C, E1 >: E](e: C => E1)(implicit ev: A <:< Either[B, C]): ZPure[W, S1, S2, R, E1, B]

Returns a successful computation if the value is Left, or fails with the given error function e.

Returns a successful computation if the value is Left, or fails with the given error function e.

Attributes

final def leftOrFailWithException[B, C, E1 >: NoSuchElementException](implicit ev: A <:< Either[B, C], ev2: E <:< E1): ZPure[W, S1, S2, R, E1, B]

Returns a successful computation if the value is Left, or fails with a java.util.NoSuchElementException.

Returns a successful computation if the value is Left, or fails with a java.util.NoSuchElementException.

Attributes

final def log[W1 >: W](w: W1): ZPure[W1, S1, S2, R, E, A]
final def map[B](f: A => B): ZPure[W, S1, S2, R, E, B]

Transforms the result of this computation with the specified function.

Transforms the result of this computation with the specified function.

Attributes

final def mapError[E1](f: E => E1)(implicit ev: CanFail[E]): ZPure[W, S1, S2, R, E1, A]

Transforms the error type of this computation with the specified function.

Transforms the error type of this computation with the specified function.

Attributes

final def mapErrorCause[E2](f: (Cause[E]) => Cause[E2]): ZPure[W, S1, S2, R, E2, A]

Returns a computation with its full cause of failure mapped using the specified function. This can be users to transform errors while preserving the original structure of the Cause.

Returns a computation with its full cause of failure mapped using the specified function. This can be users to transform errors while preserving the original structure of the Cause.

Attributes

final def mapState[S3](f: S2 => S3): ZPure[W, S1, S3, R, E, A]

Transforms the updated state of this computation with the specified function.

Transforms the updated state of this computation with the specified function.

Attributes

final def negate(implicit ev: A <:< Boolean): ZPure[W, S1, S2, R, E, Boolean]

Negates the boolean value of this computation.

Negates the boolean value of this computation.

Attributes

final def none[B](implicit ev: A <:< Option[B]): ZPure[W, S1, S2, R, Option[E], Unit]

Requires the value of this computation to be None, otherwise fails with None.

Requires the value of this computation to be None, otherwise fails with None.

Attributes

final def orElse[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1, A1 >: A](that: => ZPure[W1, S0, S3, R1, E1, A1])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, A1]

Executes this computation and returns its value, if it succeeds, but otherwise executes the specified computation.

Executes this computation and returns its value, if it succeeds, but otherwise executes the specified computation.

Attributes

final def orElseEither[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1, B](that: => ZPure[W1, S0, S3, R1, E1, B])(implicit ev: CanFail[E]): ZPure[W1, S0, S3, R1, E1, Either[A, B]]

Executes this computation and returns its value, if it succeeds, but otherwise executes the specified computation.

Executes this computation and returns its value, if it succeeds, but otherwise executes the specified computation.

Attributes

final def orElseFail[E1](e1: => E1)(implicit ev: CanFail[E]): ZPure[W, S1, S2, R, E1, A]

Executes this computation and returns its value, if it succeeds, but otherwise fails with the specified error.

Executes this computation and returns its value, if it succeeds, but otherwise fails with the specified error.

Attributes

final def orElseFallback[A1 >: A, S3 >: S2](a1: => A1, s3: => S3)(implicit ev: CanFail[E]): ZPure[W, S1, S3, R, Nothing, A1]

Executes this computation and returns its value, if it succeeds, but otherwise fallbacks to the new state with the specified value.

Executes this computation and returns its value, if it succeeds, but otherwise fallbacks to the new state with the specified value.

Attributes

final def orElseOptional[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1, A1 >: A](that: => ZPure[W1, S0, S3, R1, Option[E1], A1])(implicit ev: E <:< Option[E1]): ZPure[W1, S0, S3, R1, Option[E1], A1]

Returns an computation that will produce the value of this computation, unless it fails with the None value, in which case it will produce the value of the specified computation.

Returns an computation that will produce the value of this computation, unless it fails with the None value, in which case it will produce the value of the specified computation.

Attributes

final def orElseSucceed[A1 >: A](a1: => A1)(implicit ev: CanFail[E]): ZPure[W, S1, Any, R, Nothing, A1]

Executes this computation and returns its value, if it succeeds, but otherwise succeeds with the specified value.

Executes this computation and returns its value, if it succeeds, but otherwise succeeds with the specified value.

Attributes

final def provideEnvironment(r: ZEnvironment[R]): ZPure[W, S1, S2, Any, E, A]

Provides this computation with its required environment.

Provides this computation with its required environment.

Attributes

final def provideService[Service <: R](service: => Service)(implicit tag: Tag[Service]): ZPure[W, S1, S2, Any, E, A]

Provides this computation with the single service it requires. If the computation requires multiple services use provideEnvironment instead.

Provides this computation with the single service it requires. If the computation requires multiple services use provideEnvironment instead.

Attributes

final def provideSomeEnvironment[R0](f: (ZEnvironment[R0]) => ZEnvironment[R]): ZPure[W, S1, S2, R0, E, A]

Provides this computation with part of its required environment, leaving the remainder.

Provides this computation with part of its required environment, leaving the remainder.

Attributes

final def provideState(s: S1): ZPure[W, Any, S2, R, E, A]

Provides this computation with its initial state.

Provides this computation with its initial state.

Attributes

final def refineOrDie[E1](pf: PartialFunction[E, E1])(implicit ev1: E <:< Throwable, ev2: CanFail[E]): ZPure[W, S1, S2, R, E1, A]

Keeps some of the errors, and throw the rest

Keeps some of the errors, and throw the rest

Attributes

final def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: E => Throwable)(implicit ev: CanFail[E]): ZPure[W, S1, S2, R, E1, A]

Keeps some of the errors, and throw the rest, using the specified function to convert the E into a Throwable.

Keeps some of the errors, and throw the rest, using the specified function to convert the E into a Throwable.

Attributes

def refineToOrDie[E1 <: E : ClassTag](implicit evidence$1: ClassTag[E1], ev: CanFail[E]): ZPure[W, S1, S2, R, E1, A]
Implicitly added by ZPureRefineToOrDieOps

Keeps some of the errors, and throw the rest.

Keeps some of the errors, and throw the rest.

Attributes

final def reject[S0 <: S1, S3 >: S2, R1 <: R, E1 >: E](pf: PartialFunction[A, E1]): ZPure[W, S0, S3, R1, E1, A]

Fail with the returned value if the PartialFunction matches, otherwise continue with our held value.

Fail with the returned value if the PartialFunction matches, otherwise continue with our held value.

Attributes

final def rejectM[W1 >: W, S0 <: S1, S3 >: S2, R1 <: R, E1 >: E](pf: PartialFunction[A, ZPure[W1, S2, S3, R1, E1, E1]]): ZPure[W1, S0, S3, R1, E1, A]

Continue with the returned computation if the PartialFunction matches, translating the successful match into a failure, otherwise continue with our held value.

Continue with the returned computation if the PartialFunction matches, translating the successful match into a failure, otherwise continue with our held value.

Attributes

final def repeatN(n: Int)(implicit ev: S2 <:< S1): ZPure[W, S1, S2, R, E, A]

Repeats this computation the specified number of times (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation the specified number of times (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def repeatUntil(f: A => Boolean)(implicit ev: S2 <:< S1): ZPure[W, S1, S2, R, E, A]

Repeats this computation until its value satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation until its value satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def repeatUntilEquals[A1 >: A](a: => A1)(implicit ev: S2 <:< S1): ZPure[W, S1, S2, R, E, A1]

Repeats this computation until its value is equal to the specified value (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation until its value is equal to the specified value (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def repeatUntilState(f: S2 => Boolean)(implicit ev: S2 <:< S1): ZPure[W, S1, S2, R, E, A]

Repeats this computation until the updated state satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation until the updated state satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def repeatUntilStateEquals[S3 >: S2](s: => S3)(implicit ev: S2 <:< S1): ZPure[W, S1, S3, R, E, A]

Repeats this computation until the updated state is equal to the specified value (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation until the updated state is equal to the specified value (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def repeatWhile(f: A => Boolean)(implicit ev: S2 <:< S1): ZPure[W, S1, S2, R, E, A]

Repeats this computation for as long as its value satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation for as long as its value satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def repeatWhileEquals[A1 >: A](a: => A1)(implicit ev: S2 <:< S1): ZPure[W, S1, S2, R, E, A1]

Repeats this computation for as long as its value is equal to the specified value (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation for as long as its value is equal to the specified value (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def repeatWhileState(f: S2 => Boolean)(implicit ev: S2 <:< S1): ZPure[W, S1, S2, R, E, A]

Repeats this computation for as long as the updated state satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Repeats this computation for as long as the updated state satisfies the specified predicate (or until the first failure) passing the updated state to each successive repetition.

Attributes

final def right[B, C](implicit ev: A <:< Either[B, C]): ZPure[W, S1, S2, R, Option[E], C]

Returns a successful computation if the value is Right, or fails with error None.

Returns a successful computation if the value is Right, or fails with error None.

Attributes

final def rightOrFail[B, C, E1 >: E](e: => E1)(implicit ev: A <:< Either[B, C]): ZPure[W, S1, S2, R, E1, C]
final def rightOrFailWith[B, C, E1 >: E](e: B => E1)(implicit ev: A <:< Either[B, C]): ZPure[W, S1, S2, R, E1, C]
final def rightOrFailWithException[B, C, E1 >: NoSuchElementException](implicit ev: A <:< Either[B, C], ev2: E <:< E1): ZPure[W, S1, S2, R, E1, C]
final def run(implicit ev1: Unit <:< S1, ev2: Any <:< R, ev3: E <:< Nothing): A

Runs this computation to produce its result.

Runs this computation to produce its result.

Attributes

final def run(s: S1)(implicit ev1: Any <:< R, ev2: E <:< Nothing): (S2, A)

Runs this computation with the specified initial state, returning both the updated state and the result.

Runs this computation with the specified initial state, returning both the updated state and the result.

Attributes

final def runAll(s: S1)(implicit ev: Any <:< R): (Chunk[W], Either[Cause[E], (S2, A)])

Runs this computation with the specified initial state, returning both the log and either all the failures that occurred or the updated state and the result.

Runs this computation with the specified initial state, returning both the log and either all the failures that occurred or the updated state and the result.

Attributes

final def runEither(implicit ev1: Unit <:< S1, ev2: Any <:< R): Either[E, A]

Runs this computation to produce its result or the first failure to occur.

Runs this computation to produce its result or the first failure to occur.

Attributes

final def runLog(implicit ev1: Unit <:< S1, ev2: Any <:< R, ev3: E <:< Nothing): (Chunk[W], A)

Runs this computation to produce its result and the log.

Runs this computation to produce its result and the log.

Attributes

final def runResult(s: S1)(implicit ev1: Any <:< R, ev2: E <:< Nothing): A

Runs this computation with the specified initial state, returning the result and discarding the updated state.

Runs this computation with the specified initial state, returning the result and discarding the updated state.

Attributes

final def runState(s: S1)(implicit ev1: Any <:< R, ev2: E <:< Nothing): S2

Runs this computation with the specified initial state, returning the updated state and discarding the result.

Runs this computation with the specified initial state, returning the updated state and discarding the result.

Attributes

final def runValidation(implicit ev1: Unit <:< S1, ev2: Any <:< R): ZValidation[W, E, A]

Runs this computation to a ZValidation value.

Runs this computation to a ZValidation value.

Attributes

final def sandbox: ZPure[W, S1, S2, R, Cause[E], A]

Exposes the full cause of failures of this computation.

Exposes the full cause of failures of this computation.

Attributes

final def some[B](implicit ev: A <:< Option[B]): ZPure[W, S1, S2, R, Option[E], B]

Converts an option on values into an option on errors leaving the state unchanged.

Converts an option on values into an option on errors leaving the state unchanged.

Attributes

final def someOrElse[B](default: => B)(implicit ev: A <:< Option[B]): ZPure[W, S1, S2, R, E, B]

Extracts the optional value or returns the given 'default' leaving the state unchanged.

Extracts the optional value or returns the given 'default' leaving the state unchanged.

Attributes

final def someOrElseM[W1 >: W, S3 >: S2, R1 <: R, E1 >: E, B](that: ZPure[W1, S2, S3, R1, E1, B])(implicit ev: A <:< Option[B]): ZPure[W1, S1, S3, R1, E1, B]

Extracts the optional value or runs the specified computation passing the updated state from this computation.

Extracts the optional value or runs the specified computation passing the updated state from this computation.

Attributes

final def someOrFail[B, E1 >: E](e: => E1)(implicit ev: A <:< Option[B]): ZPure[W, S1, S2, R, E1, B]

Extracts the optional value or fails with the given error 'e'.

Extracts the optional value or fails with the given error 'e'.

Attributes

final def someOrFailException[B, E1 >: E](implicit ev: A <:< Option[B], ev2: NoSuchElementException <:< E1): ZPure[W, S1, S2, R, E1, B]

Extracts the optional value or fails with a java.util.NoSuchElementException leaving the state unchanged.

Extracts the optional value or fails with a java.util.NoSuchElementException leaving the state unchanged.

Attributes

def toZIO(implicit ev: Unit <:< S1): ZIO[R, E, A]

Transforms ZPure to ZIO that either succeeds with A or fails with error(s) E. The original state is supposed to be ().

Transforms ZPure to ZIO that either succeeds with A or fails with error(s) E. The original state is supposed to be ().

Attributes

def toZIOWith(s1: S1): ZIO[R, E, A]

Transforms ZPure to ZIO that either succeeds with A or fails with error(s) E.

Transforms ZPure to ZIO that either succeeds with A or fails with error(s) E.

Attributes

def toZIOWithAll(s1: S1): ZIO[R, E, (Chunk[W], S2, A)]

Transforms ZPure to ZIO that either succeeds with Chunk[W], S2 and A or fails with error(s) E.

Transforms ZPure to ZIO that either succeeds with Chunk[W], S2 and A or fails with error(s) E.

Attributes

def toZIOWithState(s1: S1): ZIO[R, E, (S2, A)]

Transforms ZPure to ZIO that either succeeds with S2 and A or fails with error(s) E.

Transforms ZPure to ZIO that either succeeds with S2 and A or fails with error(s) E.

Attributes

final def unit: ZPure[W, S1, S2, R, E, Unit]

Maps the value of this computation to unit.

Maps the value of this computation to unit.

Attributes

def unsandbox[E1](implicit ev: E <:< Cause[E1]): ZPure[W, S1, S2, R, E1, A]

Submerges the full cause of failures of this computation.

Submerges the full cause of failures of this computation.

Attributes

final def zip[W1 >: W, S3, R1 <: R, E1 >: E, B](that: ZPure[W1, S2, S3, R1, E1, B])(implicit zippable: Zippable[A, B]): ZPure[W1, S1, S3, R1, E1, zippable.Out]

Combines this computation with the specified computation, passing the updated state from this computation to that computation and combining the results of both into a tuple.

Combines this computation with the specified computation, passing the updated state from this computation to that computation and combining the results of both into a tuple.

Attributes

final def zipLeft[W1 >: W, S3, R1 <: R, E1 >: E, B](that: ZPure[W1, S2, S3, R1, E1, B]): ZPure[W1, S1, S3, R1, E1, A]

Combines this computation with the specified computation, passing the updated state from this computation to that computation and returning the result of this computation.

Combines this computation with the specified computation, passing the updated state from this computation to that computation and returning the result of this computation.

Attributes

final def zipPar[W1 >: W, S3 >: S2 <: S1, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S3, S3, R1, E1, B])(implicit zippable: Zippable[A, B]): ZPure[W1, S3, S3, R1, E1, zippable.Out]
final def zipParLeft[W1 >: W, S3 >: S2 <: S1, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S3, S3, R1, E1, B]): ZPure[W1, S3, S3, R1, E1, A]
final def zipParRight[W1 >: W, S3 >: S2 <: S1, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S3, S3, R1, E1, B]): ZPure[W1, S3, S3, R1, E1, B]
final def zipRight[W1 >: W, S3, R1 <: R, E1 >: E, B](that: ZPure[W1, S2, S3, R1, E1, B]): ZPure[W1, S1, S3, R1, E1, B]

Combines this computation with the specified computation, passing the updated state from this computation to that computation and returning the result of that computation.

Combines this computation with the specified computation, passing the updated state from this computation to that computation and returning the result of that computation.

Attributes

final def zipWith[W1 >: W, S3, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S2, S3, R1, E1, B])(f: (A, B) => C): ZPure[W1, S1, S3, R1, E1, C]

Combines this computation with the specified computation, passing the updated state from this computation to that computation and combining the results of both using the specified function.

Combines this computation with the specified computation, passing the updated state from this computation to that computation and combining the results of both using the specified function.

Attributes

final def zipWithPar[W1 >: W, S3 >: S2 <: S1, R1 <: R, E1 >: E, B, C](that: ZPure[W1, S3, S3, R1, E1, B])(f: (A, B) => C): ZPure[W1, S3, S3, R1, E1, C]