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 extract(state: State): ZIO[R, E, B]

    Runs the sink from an initial state and produces a final value of type B

  2. abstract def initial: ZIO[R, E, Step[State, Nothing]]

    The initial state of the sink.

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

    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: =:=[A00, A1]): ZSink[R1, E1, A00, A1, C]

    Operator alias for zipRight

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

    Operator alias for zipLeft

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

    Operator alias for zip

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

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

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

    Creates a sink that always produces c

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

    Replaces any error produced by this sink.

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. final def chunked: ZSink[R, E, A0, Chunk[A], B]

    Takes a Sink, and lifts it to be chunked in its input.

    Takes a Sink, and lifts it to be chunked in its input. This will not improve performance, but can be used to adapt non-chunked sinks wherever chunked sinks are required.

  12. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  13. 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

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

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

  16. final def dropWhile[A1 <: A](pred: (A1) => Boolean): ZSink[R, E, A0, A1, B]

    Drops all elements entering the sink for as long as the specified predicate evaluates to true.

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def filter[A1 <: A](f: (A1) => Boolean): ZSink[R, E, A0, A1, B]

    Filters the inputs fed to this sink.

  20. final def filterM[R1 <: R, E1 >: E, A1 <: A](f: (A1) => ZIO[R1, E1, Boolean]): ZSink[R1, E1, A0, A1, B]

    Effectfully filters the inputs fed to this sink.

  21. final def filterNot[A1 <: A](f: (A1) => Boolean): ZSink[R, E, A0, A1, B]

    Filters this sink by the specified predicate, dropping all elements for which the predicate evaluates to true.

  22. final def filterNotM[E1 >: E, A1 <: A](f: (A1) => IO[E1, Boolean]): ZSink[R, E1, A0, A1, B]

    Effectfully ilters this sink by the specified predicate, dropping all elements for which the predicate evaluates to true.

  23. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  24. final def flatMap[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](f: (B) => ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1]): 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.

  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. final def keyed[A1 <: A, K](f: (A1) => K): ZSink[R, E, (K, A0), A1, Map[K, B]]
  29. def map[C](f: (B) => C): ZSink[R, E, A0, A, C]

    Maps the value produced by this sink.

  30. final def mapError[E1](f: (E) => E1): ZSink[R, E1, A0, A, B]

    Maps any error produced by this sink.

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

  32. def mapRemainder[A1](f: (A0) => A1): ZSink[R, E, A1, A, B]

    Maps the remainder produced after this sink is done.

  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def orElse[R1 <: R, E1, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1], ev2: =:=[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

  37. final def provideSome[R1](f: (R1) => R): ZSink[R1, E, A0, A, B]

    Narrows the environment by partially building it with f

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

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

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

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

  40. final def stepChunk(state: State, as: Chunk[A]): ZIO[R, E, Step[State, A0]]

    Steps through a chunk of iterations of the sink

  41. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  42. final def takeWhile[A1 <: A](pred: (A1) => Boolean): ZSink[R, E, A0, A1, B]

    Produces a sink consuming all the elements of type A as long as they verify the predicate pred.

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

    Times the invocation of the sink

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

    Creates a sink that ignores all produced elements.

  46. final def untilOutput(f: (B) => Boolean): ZSink[R, E, A0, A, Option[B]]

    Creates a sink that produces values until one verifies the predicate f.

  47. final def update(state: Step[State, Nothing]): ZSink[R, E, A0, A, B]
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  51. final def zip[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1]): ZSink[R1, E1, A00, A1, (B, C)]

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

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

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

  53. final def zipPar[R1 <: R, E1 >: E, A2 >: A0, A1 <: A, C](that: ZSink[R1, E1, A2, A1, C]): ZSink[R1, E1, A2, A1, (B, C)]

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

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

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

  55. 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]): ZSink[R1, E1, A00, A1, D]

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

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

    A named alias for race.

Deprecated Value Members

  1. final def const[C](c: => C): ZSink[R, E, A0, A, C]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use as

  2. final def void: ZSink[R, E, A0, A, Unit]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use unit

  3. final def ~[R1 <: R, E1 >: E, A00 >: A0, A1 <: A, C](that: ZSink[R1, E1, A00, A1, C])(implicit ev: =:=[A00, A1]): ZSink[R1, E1, A00, A1, (B, C)]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use <*>

Inherited from AnyRef

Inherited from Any

Ungrouped