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 ?: ZSink[R, Nothing, A0, A, Option[B]]

    Returns a new sink that tries to produce the B, but if there is an error in stepping or extraction, produces None.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. final def chunked[A1 >: A0, A2 <: A]: ZSink[R, E, A1, Chunk[A2], 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.

  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. final def collectAll[A00 >: A0, A1 <: A](implicit ev: =:=[A00, A1]): ZSink[R, E, A00, A1, List[B]]

    Accumulates the output into a list.

  13. final def collectAllN[A00 >: A0, A1 <: A](i: Int)(implicit ev: =:=[A00, A1]): ZSink[R, E, A00, A1, List[B]]

    Accumulates the output into a list of maximum size i.

  14. final def collectAllWhile[A00 >: A0, A1 <: A](p: (A00) => Boolean)(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R, E, A00, A1, List[B]]

    Accumulates into a list for as long as incoming values verify predicate p.

  15. final def collectAllWhileWith[S, A00 >: A0, A1 <: A](p: (A00) => Boolean)(z: S)(f: (S, B) => S)(implicit ev: =:=[A00, A1], ev2: =:=[A1, A00]): ZSink[R, E, A00, A1, S]

    Accumulates into a value of type S for as long as incoming values verify predicate p.

  16. final def collectAllWith[S, A00 >: A0, A1 <: A](z: S)(f: (S, B) => S)(implicit ev: =:=[A00, A1]): ZSink[R, E, A00, A1, S]

    Accumulates the output into a value of type S.

  17. final def const[C](c: => C): ZSink[R, E, A0, A, C]

    Creates a sink that always produces c

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

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

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

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

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

    Filters the inputs fed to this sink.

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

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

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

  28. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  29. 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.

  30. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. def map[C](f: (B) => C): ZSink[R, E, A0, A, C]

    Maps the value produced by this sink.

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

    Maps any error produced by this sink.

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

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

    Maps the remainder produced after this sink is done.

  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  39. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def optional: ZSink[R, Nothing, A0, A, Option[B]]

    A named alias for ?.

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

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

    Narrows the environment by partially building it with f

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

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

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

    Steps through a chunk of iterations of the sink

  46. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  47. 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.

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

    Creates a sink that ignores all produced elements.

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

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

  51. final def update(state: Step[State, Nothing]): ZSink[R, E, A0, A, B]
  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  53. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  54. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  55. 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.

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

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

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

  59. 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 void: ZSink[R, E, A0, A, Unit]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use unit

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