Packages

trait ZSink[-R, +E, +A0, -A, +B] extends AnyRef

A Sink[E, A0, A, B] consumes values of type A, ultimately producing either an error of type E, or a value of type B together with a remainder of type A0.

Sinks form monads and combine in the usual ways.

Self Type
ZSink[R, E, A0, A, B]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZSink
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type State

Abstract Value Members

  1. abstract def cont(state: State): Boolean

    Decides whether the Sink should continue from the current state.

  2. abstract def extract(state: State): ZIO[R, E, (B, Chunk[A0])]

    Produces a final value of type B along with a remainder of type Chunk[A0].

  3. abstract def initial: ZIO[R, E, State]

    The initial state of the sink.

  4. abstract def step(state: State, a: A): ZIO[R, E, State]

    Steps through one iteration of the sink.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def &>[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, C]

    Operator alias for zipParRight

  4. final def *>[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, C]

    Operator alias for zipRight

  5. final def <&[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, B]

    Operator alias for zipLeft

  6. final def <&>[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, (B, C)]

    Operator alias for zipPar.

  7. final def <*[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, B]

    Operator alias for zipLeft

  8. final def <*>[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, (B, C)]

    Operator alias for zip

  9. final def <|[R1 <: R, E1, B1 >: B, A00 >: A0, A1 <: A](that: ZSink[R1, E1, A00, A1, B1])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, B1]

    Operator alias for orElse for two sinks consuming and producing values of the same type.

  10. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. final def as[C](c: ⇒ C): ZSink[R, E, A0, A, C]

    Creates a sink that always produces c

  12. final def asError[E1](e1: ⇒ E1): ZSink[R, E1, A0, A, B]

    Replaces any error produced by this sink.

  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  15. def contramap[C](f: (C) ⇒ A): ZSink[R, E, A0, C, B]

    Creates a sink where every element of type A entering the sink is first transformed by f

  16. final def contramapM[R1 <: R, E1 >: E, C](f: (C) ⇒ ZIO[R1, E1, A]): ZSink[R1, E1, A0, C, B]

    Creates a sink where every element of type A entering the sink is first transformed by the effectful f

  17. def dimap[C, D](f: (C) ⇒ A)(g: (B) ⇒ D): ZSink[R, E, A0, C, D]

    Creates a sink that transforms entering values with f and outgoing values with g

  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def flatMap[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](f: (B) ⇒ ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, C]

    Creates a sink producing values of type C obtained by each produced value of type B transformed into a sink by f.

  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. def map[C](f: (B) ⇒ C): ZSink[R, E, A0, A, C]

    Maps the value produced by this sink.

  26. final def mapError[E1](f: (E) ⇒ E1): ZSink[R, E1, A0, A, B]

    Maps any error produced by this sink.

  27. final def mapM[R1 <: R, E1 >: E, C](f: (B) ⇒ ZIO[R1, E1, C]): ZSink[R1, E1, A0, A, C]

    Effectfully maps the value produced by this sink.

  28. def mapRemainder[A1](f: (A0) ⇒ A1): ZSink[R, E, A1, A, B]

    Maps the remainder produced after this sink is done.

  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. final def orElse[R1 <: R, E1, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, Either[B, C]]

    Runs both sinks in parallel on the same input.

    Runs both sinks in parallel on the same input. If the left one succeeds, its value will be produced. Otherwise, whatever the right one produces will be produced. If the right one succeeds before the left one, it accumulates the full input until the left one fails, so it can return it as the remainder. This allows this combinator to function like choice in parser combinator libraries.

    Left: ============== FAIL! Right: ===== SUCCEEDS! xxxxxxxxx <- Should NOT be consumed

  33. final def provideSome[R1](f: (R1) ⇒ R): ZSink[R1, E, A0, A, B]

    Narrows the environment by partially building it with f

  34. final def race[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, B1 >: B](that: ZSink[R1, E1, A00, A1, B1]): ZSink[R1, E1, A00, A1, B1]

    Runs both sinks in parallel on the input, returning the result from the one that finishes successfully first.

  35. final def raceBoth[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C]): ZSink[R1, E1, A00, A1, Either[B, C]]

    Runs both sinks in parallel on the input, returning the result from the one that finishes successfully first.

  36. final def stepChunk[A00 >: A0, A1 <: A](state: State, as: Chunk[A1])(implicit ev: =:=[A1, A00]): ZIO[R, E, (State, Chunk[A00])]

    Steps through a chunk of iterations of the sink

  37. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  38. final def tapInput[R1 <: R, E1 >: E, A1 <: A](f: (A1) ⇒ ZIO[R1, E1, Unit]): ZSink[R1, E1, A0, A1, B]

    Performs the specified effect for every element that is consumed by this sink.

  39. final def tapOutput[R1 <: R, E1 >: E](f: (B) ⇒ ZIO[R1, E1, Unit]): ZSink[R1, E1, A0, A, B]

    Performs the specified effect for every element that is produced by this sink.

  40. final def timed: ZSink[R with Clock, E, A0, A, (Duration, B)]

    Times the invocation of the sink

  41. def toString(): String
    Definition Classes
    AnyRef → Any
  42. final def unit: ZSink[R, E, A0, A, Unit]

    Creates a sink that ignores all produced elements.

  43. final def update(state: State): ZSink[R, E, A0, A, B]

    Sets the initial state of the sink to the provided state.

  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  47. final def zip[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, (B, C)]

    Runs two sinks in unison and matches produced values pair-wise.

  48. final def zipLeft[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, B]

    Runs two sinks in unison and keeps only values on the left.

  49. final def zipPar[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, (B, C)]

    Runs both sinks in parallel on the input and combines the results into a Tuple.

  50. final def zipParLeft[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, B]

    Runs both sinks in parallel on the input and combines the results into a Tuple.

  51. final def zipParRight[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, C]

    Runs both sinks in parallel on the input and combines the results into a Tuple.

  52. final def zipRight[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, C]

    Runs two sinks in unison and keeps only values on the right.

  53. final def zipWith[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C, D](that: ZSink[R1, E1, A00, A1, C])(f: (B, C) ⇒ D)(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R1, E1, A00, A1, D]

    Runs two sinks in unison and merges values pair-wise.

  54. final def zipWithPar[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C, D](that: ZSink[R1, E1, A00, A1, C])(f: (B, C) ⇒ D)(implicit ev: =:=[A1, A00]): ZSink[R1, E1, A00, A1, D]

    Runs both sinks in parallel on the input and combines the results using the provided function.

  55. final def |[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, B1 >: B](that: ZSink[R1, E1, A00, A1, B1]): ZSink[R1, E1, A00, A1, B1]

    A named alias for race.

Inherited from AnyRef

Inherited from Any

Ungrouped