Object/Class

zio.stream

ZTransducer

Related Docs: class ZTransducer | package stream

Permalink

object ZTransducer

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZTransducer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Push

    Permalink
  5. def apply[I]: ZTransducer[Any, Nothing, I, I]

    Permalink

    Shorthand form for ZTransducer.identity.

    Shorthand form for ZTransducer.identity. Use as:

    ZTransducer[Int].filter(_ % 2 != 0)
  6. def apply[R, E, I, O](push: ZManaged[R, Nothing, (Option[Chunk[I]]) ⇒ ZIO[R, E, Chunk[O]]]): ZTransducer[R, E, I, O]

    Permalink
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collectAllN[I](n: Long): ZTransducer[Any, Nothing, I, List[I]]

    Permalink

    Creates a transducer accumulating incoming values into lists of maximum size n.

  10. def collectAllToMapN[K, I](n: Long)(key: (I) ⇒ K)(f: (I, I) ⇒ I): ZTransducer[Any, Nothing, I, Map[K, I]]

    Permalink

    Creates a transducer accumulating incoming values into maps of up to n keys.

    Creates a transducer accumulating incoming values into maps of up to n keys. Elements are mapped to keys using the function key; elements mapped to the same key will be merged with the function f.

  11. def collectAllToSetN[I](n: Long): ZTransducer[Any, Nothing, I, Set[I]]

    Permalink

    Creates a transducer accumulating incoming values into sets of maximum size n.

  12. def collectAllWhile[I](p: (I) ⇒ Boolean): ZTransducer[Any, Nothing, I, List[I]]

    Permalink

    Accumulates incoming elements into a list as long as they verify predicate p.

  13. def collectAllWhileM[R, E, I](p: (I) ⇒ ZIO[R, E, Boolean]): ZTransducer[R, E, I, List[I]]

    Permalink

    Accumulates incoming elements into a list as long as they verify effectful predicate p.

  14. def die(e: ⇒ Throwable): ZTransducer[Any, Nothing, Any, Nothing]

    Permalink

    Creates a transducer that always dies with the specified exception.

  15. def dropWhile[I](p: (I) ⇒ Boolean): ZTransducer[Any, Nothing, I, I]

    Permalink

    Creates a transducer that starts consuming values as soon as one fails the predicate p.

  16. def dropWhileM[R, E, I](p: (I) ⇒ ZIO[R, E, Boolean]): ZTransducer[R, E, I, I]

    Permalink

    Creates a transducer that starts consuming values as soon as one fails the effectful predicate p.

  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  19. def fail[E](e: ⇒ E): ZTransducer[Any, E, Any, Nothing]

    Permalink

    Creates a transducer that always fails with the specified failure.

  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def fold[I, O](z: O)(contFn: (O) ⇒ Boolean)(f: (O, I) ⇒ O): ZTransducer[Any, Nothing, I, O]

    Permalink

    Creates a transducer by folding over a structure of type O for as long as contFn results in true.

    Creates a transducer by folding over a structure of type O for as long as contFn results in true. The transducer will emit a value when contFn evaluates to false and then restart the folding.

  22. def foldLeft[I, O](z: O)(f: (O, I) ⇒ O): ZTransducer[Any, Nothing, I, O]

    Permalink

    Creates a transducer by folding over a structure of type O.

    Creates a transducer by folding over a structure of type O. The transducer will fold the inputs until the stream ends, resulting in a stream with one element.

  23. def foldLeftM[R, E, I, O](z: O)(f: (O, I) ⇒ ZIO[R, E, O]): ZTransducer[R, E, I, O]

    Permalink

    Creates a transducer by effectfully folding over a structure of type O.

    Creates a transducer by effectfully folding over a structure of type O. The transducer will fold the inputs until the stream ends, resulting in a stream with one element.

  24. def foldM[R, E, I, O](z: O)(contFn: (O) ⇒ Boolean)(f: (O, I) ⇒ ZIO[R, E, O]): ZTransducer[R, E, I, O]

    Permalink

    Creates a sink by effectfully folding over a structure of type S.

  25. def foldUntil[I, O](z: O, max: Long)(f: (O, I) ⇒ O): ZTransducer[Any, Nothing, I, O]

    Permalink

    Creates a transducer that folds elements of type I into a structure of type O until max elements have been folded.

    Creates a transducer that folds elements of type I into a structure of type O until max elements have been folded.

    Like foldWeighted, but with a constant cost function of 1.

  26. def foldUntilM[R, E, I, O](z: O, max: Long)(f: (O, I) ⇒ ZIO[R, E, O]): ZTransducer[R, E, I, O]

    Permalink

    Creates a transducer that effectfully folds elements of type I into a structure of type O until max elements have been folded.

    Creates a transducer that effectfully folds elements of type I into a structure of type O until max elements have been folded.

    Like foldWeightedM, but with a constant cost function of 1.

  27. def foldWeighted[I, O](z: O)(costFn: (O, I) ⇒ Long, max: Long)(f: (O, I) ⇒ O): ZTransducer[Any, Nothing, I, O]

    Permalink

    Creates a transducer that folds elements of type I into a structure of type O, until max worth of elements (determined by the costFn) have been folded.

    Creates a transducer that folds elements of type I into a structure of type O, until max worth of elements (determined by the costFn) have been folded.

    Note

    Elements that have an individual cost larger than max will force the transducer to cross the max cost. See foldWeightedDecompose for a variant that can handle these cases.

  28. def foldWeightedDecompose[I, O](z: O)(costFn: (O, I) ⇒ Long, max: Long, decompose: (I) ⇒ Chunk[I])(f: (O, I) ⇒ O): ZTransducer[Any, Nothing, I, O]

    Permalink

    Creates a transducer that folds elements of type I into a structure of type O, until max worth of elements (determined by the costFn) have been folded.

    Creates a transducer that folds elements of type I into a structure of type O, until max worth of elements (determined by the costFn) have been folded.

    The decompose function will be used for decomposing elements that cause an O aggregate to cross max into smaller elements. For example:

    Stream(1, 5, 1)
     .aggregate(
       ZTransducer
         .foldWeightedDecompose(List[Int]())((i: Int) => i.toLong, 4,
           (i: Int) => Chunk(i - 1, 1)) { (acc, el) =>
           el :: acc
         }
         .map(_.reverse)
     )
     .runCollect

    The stream would emit the elements List(1), List(4), List(1, 1).

    Be vigilant with this function, it has to generate "simpler" values or the fold may never end. A value is considered indivisible if decompose yields the empty chunk or a single-valued chunk. In these cases, there is no other choice than to yield a value that will cross the threshold.

    The foldWeightedDecomposeM allows the decompose function to return a ZIO value, and consequently it allows the transducer to fail.

  29. def foldWeightedDecomposeM[R, E, I, O](z: O)(costFn: (O, I) ⇒ ZIO[R, E, Long], max: Long, decompose: (I) ⇒ ZIO[R, E, Chunk[I]])(f: (O, I) ⇒ ZIO[R, E, O]): ZTransducer[R, E, I, O]

    Permalink

    Creates a transducer that effectfully folds elements of type I into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a transducer that effectfully folds elements of type I into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    The decompose function will be used for decomposing elements that cause an S aggregate to cross max into smaller elements. Be vigilant with this function, it has to generate "simpler" values or the fold may never end. A value is considered indivisible if decompose yields the empty chunk or a single-valued chunk. In these cases, there is no other choice than to yield a value that will cross the threshold.

    See foldWeightedDecompose for an example.

  30. def foldWeightedM[R, E, I, O](z: O)(costFn: (O, I) ⇒ ZIO[R, E, Long], max: Long)(f: (O, I) ⇒ ZIO[R, E, O]): ZTransducer[R, E, I, O]

    Permalink

    Creates a transducer that effectfully folds elements of type I into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a transducer that effectfully folds elements of type I into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Note

    Elements that have an individual cost larger than max will force the transducer to cross the max cost. See foldWeightedDecomposeM for a variant that can handle these cases.

  31. def fromEffect[R, E, A](zio: ZIO[R, E, A]): ZTransducer[R, E, Any, A]

    Permalink

    Creates a transducer that always evaluates the specified effect.

  32. def fromFunction[I, O](f: (I) ⇒ O): ZTransducer[Any, Unit, I, O]

    Permalink

    Creates a transducer that purely transforms incoming values.

  33. def fromFunctionM[R, E, I, O](f: (I) ⇒ ZIO[R, E, O]): ZTransducer[R, E, I, O]

    Permalink

    Creates a transducer that effectfully transforms incoming values.

  34. def fromPush[R, E, I, O](push: (Option[Chunk[I]]) ⇒ ZIO[R, E, Chunk[O]]): ZTransducer[R, E, I, O]

    Permalink

    Creates a transducer from a chunk processing function.

  35. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  36. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  37. def head[O]: ZTransducer[Any, Nothing, O, Option[O]]

    Permalink

    Creates a transducer that returns the first element of the stream, if it exists.

  38. def identity[I]: ZTransducer[Any, Nothing, I, I]

    Permalink

    The identity transducer.

    The identity transducer. Passed elements through.

  39. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  40. def last[O]: ZTransducer[Any, Nothing, O, Option[O]]

    Permalink

    Creates a transducer that returns the last element of the stream, if it exists.

  41. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  42. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  44. val splitLines: ZTransducer[Any, Nothing, String, String]

    Permalink

    Splits strings on newlines.

    Splits strings on newlines. Handles both Windows newlines (\r\n) and UNIX newlines (\n).

  45. def splitOn(delimiter: String): ZTransducer[Any, Nothing, String, String]

    Permalink

    Splits strings on a delimiter.

  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. val utf8Decode: ZTransducer[Any, Nothing, Byte, String]

    Permalink

    Decodes chunks of UTF-8 bytes into strings.

    Decodes chunks of UTF-8 bytes into strings.

    This transducer uses the String constructor's behavior when handling malformed byte sequences.

  49. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped