ZPure

zio.prelude.fx.ZPure
See theZPure companion trait
object ZPure

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ZPure.type

Members list

Type members

Classlikes

final class EnvironmentWithPartiallyApplied[R](dummy: Boolean) extends AnyVal

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final class EnvironmentWithPurePartiallyApplied[R](dummy: Boolean) extends AnyVal

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
object FlagType

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
FlagType.type
sealed trait FlagType

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class ServiceWithPartiallyApplied[R](dummy: Boolean) extends AnyVal

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final class ServiceWithPurePartiallyApplied[R](dummy: Boolean) extends AnyVal

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final implicit class ZPureRefineToOrDieOps[W, S1, S2, R, E <: Throwable, A](self: ZPure[W, S1, S2, R, E, A])

Attributes

Supertypes
class Object
trait Matchable
class Any

Inherited types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def attempt[S, A](a: => A): ZPure[Nothing, S, S, Any, Throwable, A]

Constructs a computation, catching any Throwable that is thrown.

Constructs a computation, catching any Throwable that is thrown.

Attributes

def collect[W, S, R, E, A, B, Collection <: (Iterable)](in: Collection[A])(f: A => ZPure[W, S, S, R, E, Option[B]])(implicit bf: BuildFrom[Collection[A], B, Collection[B]]): ZPure[W, S, S, R, E, Collection[B]]

Evaluate each computation in the structure from left to right, collecting the successful values and discarding the empty cases.

Evaluate each computation in the structure from left to right, collecting the successful values and discarding the empty cases.

Attributes

def collectAll[F[_] : ForEach, W, S, R, E, A](fa: F[ZPure[W, S, S, R, E, A]]): ZPure[W, S, S, R, E, F[A]]

Combines a collection of computations into a single computation that passes the updated state from each computation to the next and collects the results.

Combines a collection of computations into a single computation that passes the updated state from each computation to the next and collects the results.

Attributes

def environment[S, R]: ZPure[Nothing, S, S, R, Nothing, ZEnvironment[R]]

Accesses the whole environment of the computation.

Accesses the whole environment of the computation.

Attributes

Accesses the environment of the computation.

Accesses the environment of the computation.

Attributes

Accesses the environment of the computation in the context of a computation.

Accesses the environment of the computation in the context of a computation.

Attributes

def fail[E](e: E): ZPure[Nothing, Any, Nothing, Any, E, Nothing]
def failCause[E](cause: Cause[E]): ZPure[Nothing, Any, Nothing, Any, E, Nothing]
def forEach[F[_] : ForEach, W, S, R, E, A, B](fa: F[A])(f: A => ZPure[W, S, S, R, E, B]): ZPure[W, S, S, R, E, F[B]]

Maps each element of a collection to a computation and combines them all into a single computation that passes the updated state from each computation to the next and collects the results.

Maps each element of a collection to a computation and combines them all into a single computation that passes the updated state from each computation to the next and collects the results.

Attributes

def foreach[W, S, R, E, A, B, Collection <: (Iterable)](in: Collection[A])(f: A => ZPure[W, S, S, R, E, B])(implicit bf: BuildFrom[Collection[A], B, Collection[B]]): ZPure[W, S, S, R, E, Collection[B]]

Maps each element of a collection to a computation and combines them all into a single computation that passes the updated state from each computation to the next and collects the results.

Maps each element of a collection to a computation and combines them all into a single computation that passes the updated state from each computation to the next and collects the results.

Attributes

def foreachDiscard[W, S, R, E, A, B](in: Iterable[A])(f: A => ZPure[W, S, S, R, E, B]): ZPure[W, S, S, R, E, Unit]

Maps each element of a collection to a computation and combines them all into a single computation that passes the updated state from each computation to the next and discards the results.

Maps each element of a collection to a computation and combines them all into a single computation that passes the updated state from each computation to the next and discards the results.

Attributes

def fromEither[S, L, R](either: Either[L, R]): ZPure[Nothing, S, S, Any, L, R]

Constructs a computation from an Either.

Constructs a computation from an Either.

Attributes

def fromOption[S, A](option: Option[A]): ZPure[Nothing, S, S, Any, Unit, A]

Constructs a computation from an Option.

Constructs a computation from an Option.

Attributes

def fromPredicate[A](value: A)(f: A => Boolean): Validation[None.type, A]

Constructs a Validation from a predicate, failing with None.

Constructs a Validation from a predicate, failing with None.

Attributes

def fromPredicateWith[E, A](error: => E)(value: A)(f: A => Boolean): Validation[E, A]

Constructs a Validation from a predicate, failing with the error provided.

Constructs a Validation from a predicate, failing with the error provided.

Attributes

def fromTry[S, A](t: Try[A]): ZPure[Nothing, S, S, Any, Throwable, A]

Constructs a computation from a scala.util.Try.

Constructs a computation from a scala.util.Try.

Attributes

def get[S]: ZPure[Nothing, S, S, Any, Nothing, S]

Constructs a computation that returns the initial state unchanged.

Constructs a computation that returns the initial state unchanged.

Attributes

def log[S, W](w: W): ZPure[W, S, S, Any, Nothing, Unit]
def modify[S1, S2, A](f: S1 => (A, S2)): ZPure[Nothing, S1, S2, Any, Nothing, A]

Constructs a computation from the specified modify function.

Constructs a computation from the specified modify function.

Attributes

def modifyEither[S1, S2, E, A](f: S1 => Either[E, (A, S2)]): ZPure[Nothing, S1, S2, Any, E, A]

Constructs a computation that may fail from the specified modify function.

Constructs a computation that may fail from the specified modify function.

Attributes

def none[S]: ZPure[Nothing, S, S, Any, Nothing, Option[Nothing]]

Constructs a computation that succeeds with the None value.

Constructs a computation that succeeds with the None value.

Attributes

def service[S, R : Tag]: ZPure[Nothing, S, S, R, Nothing, R]

Accesses the specified service in the environment of the computation.

Accesses the specified service in the environment of the computation.

Attributes

Accesses the specified service in the environment of the computation.

Accesses the specified service in the environment of the computation.

Attributes

Accesses the specified service in the environment of the computation in the context of a computation.

Accesses the specified service in the environment of the computation in the context of a computation.

Attributes

def set[S](s: S): ZPure[Nothing, Any, S, Any, Nothing, Unit]

Constructs a computation that sets the state to the specified value.

Constructs a computation that sets the state to the specified value.

Attributes

def succeed[S, A](a: A): ZPure[Nothing, S, S, Any, Nothing, A]

Constructs a computation that always succeeds with the specified value, passing the state through unchanged.

Constructs a computation that always succeeds with the specified value, passing the state through unchanged.

Attributes

def suspend[W, S1, S2, R, E, A](pure: => ZPure[W, S1, S2, R, E, A]): ZPure[W, S1, S2, R, E, A]

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

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

Attributes

def unit[S]: ZPure[Nothing, S, S, Any, Nothing, Unit]

Constructs a computation that always returns the Unit value, passing the state through unchanged.

Constructs a computation that always returns the Unit value, passing the state through unchanged.

Attributes

def unless[W, S, R, E, A](p: Boolean)(pure: => ZPure[W, S, S, R, E, A]): ZPure[W, S, S, R, E, Option[A]]

The moral equivalent of if (!p) exp

The moral equivalent of if (!p) exp

Attributes

def update[S1, S2](f: S1 => S2): ZPure[Nothing, S1, S2, Any, Nothing, Unit]

Constructs a computation from the specified update function.

Constructs a computation from the specified update function.

Attributes

def when[W, S, R, E, A](p: Boolean)(pure: => ZPure[W, S, S, R, E, A]): ZPure[W, S, S, R, E, Option[A]]

The moral equivalent of if (p) exp

The moral equivalent of if (p) exp

Attributes

def whenCase[W, S, R, E, A, B](a: A)(pf: PartialFunction[A, ZPure[W, S, S, R, E, B]]): ZPure[W, S, S, R, E, Option[B]]

Runs a computation when the supplied PartialFunction matches for the given value, otherwise does nothing.

Runs a computation when the supplied PartialFunction matches for the given value, otherwise does nothing.

Attributes

Implicits

Implicits

implicit def ZPureCovariant[W, S1, S2, R, E]: Covariant[{ type lambda = [A] =>> ZPure[W, S1, S2, R, E, A]; }#<none>]

The Covariant instance for ZPure.

The Covariant instance for ZPure.

Attributes

implicit def ZPureCovariantIdentityBoth[W, S, R, E]: CovariantIdentityBoth[{ type lambda = [A] =>> ZPure[W, S, S, R, E, A]; }#<none>]

The IdentityBoth instance for ZPure.

The IdentityBoth instance for ZPure.

Attributes

implicit def ZPureIdentityFlatten[W, S, R, E]: IdentityFlatten[{ type lambda = [A] =>> ZPure[W, S, S, R, E, A]; }#<none>]

The IdentityFlatten instance for ZPure.

The IdentityFlatten instance for ZPure.

Attributes

final implicit def ZPureRefineToOrDieOps[W, S1, S2, R, E <: Throwable, A](self: ZPure[W, S1, S2, R, E, A]): ZPureRefineToOrDieOps[W, S1, S2, R, E, A]