Object

fs2

pipe

Related Doc: package fs2

Permalink

object pipe

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

Type Members

  1. sealed trait Stepper[-A, +B] extends AnyRef

    Permalink

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 Stepper

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def buffer[F[_], I](n: Int): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Behaves like the identity function, but requests n elements at a time from the input.

  7. def bufferAll[F[_], I]: Pipe[F, I, I]

    Permalink

    Behaves like the identity stream, but emits no output until the source is exhausted.

  8. def bufferBy[F[_], I](f: (I) ⇒ Boolean): Pipe[F, I, I]

    Permalink

    Behaves like the identity stream, but requests elements from its input in blocks that end whenever the predicate switches from true to false.

  9. def changes[F[_], I](eqf: (I, I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Outputs first value, and then any changed value from the last value.

    Outputs first value, and then any changed value from the last value. eqf is used for equality. *

  10. def chunkLimit[F[_], I](n: Int): (Stream[F, I]) ⇒ Stream[F, NonEmptyChunk[I]]

    Permalink

    Outputs chunks with a limited maximum size, splitting as necessary.

  11. def chunkN[F[_], I](n: Int, allowFewer: Boolean = true): (Stream[F, I]) ⇒ Stream[F, List[NonEmptyChunk[I]]]

    Permalink

    Outputs a list of chunks, the total size of all chunks is limited and split as necessary.

  12. def chunks[F[_], I]: (Stream[F, I]) ⇒ Stream[F, NonEmptyChunk[I]]

    Permalink

    Output all chunks from the input Handle.

  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def collect[F[_], I, I2](pf: PartialFunction[I, I2]): (Stream[F, I]) ⇒ Stream[F, I2]

    Permalink

    Map/filter simultaneously.

    Map/filter simultaneously. Calls collect on each Chunk in the stream.

  15. def collectFirst[F[_], I, I2](pf: PartialFunction[I, I2]): (Stream[F, I]) ⇒ Stream[F, I2]

    Permalink

    Emits the first element of the Stream for which the partial function is defined.

  16. def covary[F[_], I, O](s: (Stream[Pure, I]) ⇒ Stream[Pure, O]): Pipe[F, I, O]

    Permalink
  17. def delete[F[_], I](p: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Skip the first element that matches the predicate.

  18. def distinctConsecutive[F[_], I]: (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emits only elements that are distinct from their immediate predecessors, using natural equality for comparison.

  19. def distinctConsecutiveBy[F[_], I, I2](f: (I) ⇒ I2): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emits only elements that are distinct from their immediate predecessors according to f, using natural equality for comparison.

    Emits only elements that are distinct from their immediate predecessors according to f, using natural equality for comparison.

    Note that f is called for each element in the stream multiple times and hence should be fast (e.g., an accessor). It is not intended to be used for computationally intensive conversions. For such conversions, consider something like: src.map(i => (i, f(i))).distinctConsecutiveBy(_._2).map(_._1)

  20. def drop[F[_], I](n: Long): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Drop n elements of the input, then echo the rest.

  21. def dropLast[F[_], I]: Pipe[F, I, I]

    Permalink

    Drops the last element.

  22. def dropLastIf[F[_], I](p: (I) ⇒ Boolean): Pipe[F, I, I]

    Permalink

    Drops the last element if the predicate evaluates to true.

  23. def dropRight[F[_], I](n: Int): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emits all but the last n elements of the input.

  24. def dropWhile[F[_], I](p: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Drop the elements of the input until the predicate p fails, then echo the rest.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. def exists[F[_], I](p: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, Boolean]

    Permalink

    Emits true as soon as a matching element is received, else false if no input matches

  28. def filter[F[_], I](f: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emit only inputs which match the supplied predicate.

  29. def filterWithPrevious[F[_], I](f: (I, I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Like filter, but the predicate f depends on the previously emitted and current elements.

  30. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  31. def find[F[_], I](f: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emits the first input (if any) which matches the supplied predicate, to the output of the returned Pull

  32. def fold[F[_], I, O](z: O)(f: (O, I) ⇒ O): (Stream[F, I]) ⇒ Stream[F, O]

    Permalink

    Folds all inputs using an initial value z and supplied binary operator, and emits a single element stream.

  33. def fold1[F[_], I](f: (I, I) ⇒ I): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Folds all inputs using the supplied binary operator, and emits a single-element stream, or the empty stream if the input is empty.

  34. def forall[F[_], I](p: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, Boolean]

    Permalink

    Emits a single true value if all input matches the predicate.

    Emits a single true value if all input matches the predicate. Halts with false as soon as a non-matching element is received.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  37. def id[F[_], I]: (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Write all inputs to the output of the returned Pull.

  38. def intersperse[F[_], I](separator: I): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emits the specified separator between every pair of elements in the source stream.

  39. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  40. def last[F[_], I]: (Stream[F, I]) ⇒ Stream[F, Option[I]]

    Permalink

    Return the last element of the input Handle, if non-empty.

  41. def lastOr[F[_], I](li: ⇒ I): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Return the last element of the input Handle if non-empty, otherwise li.

  42. def lift[F[_], I, O](f: (I) ⇒ O): (Stream[F, I]) ⇒ Stream[F, O]

    Permalink

    Write all inputs to the output of the returned Pull, transforming elements using f.

    Write all inputs to the output of the returned Pull, transforming elements using f. Works in a chunky fashion and creates a Chunk.indexedSeq for each mapped chunk.

  43. def mapAccumulate[F[_], S, I, O](init: S)(f: (S, I) ⇒ (S, O)): (Stream[F, I]) ⇒ Stream[F, (S, O)]

    Permalink

    Maps a running total according to S and the input with the function f.

    Maps a running total according to S and the input with the function f.

    Example:
    1. scala> Stream("Hello", "World")
           |   .mapAccumulate(0)((l, s) => (l + s.length, s.head)).toVector
      res0: Vector[(Int, Char)] = Vector((5,H), (10,W))
  44. def mapChunks[F[_], I, O](f: (Chunk[I]) ⇒ Chunk[O]): (Stream[F, I]) ⇒ Stream[F, O]

    Permalink

    Output a transformed version of all chunks from the input Handle.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  48. def prefetch[F[_], I](implicit arg0: Async[F]): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Behaves like id, but starts fetching the next chunk before emitting the current, enabling processing on either side of the prefetch to run in parallel.

  49. def rechunkN[F[_], I](n: Int, allowFewer: Boolean = true): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Modifies the chunk structure of the underlying stream, emitting potentially unboxed chunks of n elements.

    Modifies the chunk structure of the underlying stream, emitting potentially unboxed chunks of n elements. If allowFewer is true, the final chunk of the stream may be less than n elements. Otherwise, if the final chunk is less than n elements, it is dropped.

  50. def reduce[F[_], I](f: (I, I) ⇒ I): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Alias for pipe.fold1

  51. def rethrow[F[_], I]: (Stream[F, Attempt[I]]) ⇒ Stream[F, I]

    Permalink

    Rethrow any Left(err).

    Rethrow any Left(err). Preserves chunkiness.

  52. def scan[F[_], I, O](z: O)(f: (O, I) ⇒ O): (Stream[F, I]) ⇒ Stream[F, O]

    Permalink

    Left fold which outputs all intermediate results.

    Left fold which outputs all intermediate results. Example: Stream(1,2,3,4) through pipe.scan(0)(_ + _) == Stream(0,1,3,6,10).

    More generally: Stream().scan(z)(f) == Stream(z) Stream(x1).scan(z)(f) == Stream(z, f(z,x1)) Stream(x1,x2).scan(z)(f) == Stream(z, f(z,x1), f(f(z,x1),x2)) etc

    Works in a chunky fashion, and creates a Chunk.indexedSeq for each converted chunk.

  53. def scan1[F[_], I](f: (I, I) ⇒ I): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Like pipe.scan, but uses the first element of the stream as the seed.

  54. def shiftRight[F[_], I](head: I*): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emit the given values, then echo the rest of the input.

  55. def sliding[F[_], I](n: Int): (Stream[F, I]) ⇒ Stream[F, Vector[I]]

    Permalink

    Groups inputs in fixed size chunks by passing a "sliding window" of size n over them.

    Groups inputs in fixed size chunks by passing a "sliding window" of size n over them. If the input contains less than or equal to n elements, only one chunk of this size will be emitted.

    Example:
    1. scala> Stream(1, 2, 3, 4).sliding(2).toList
      res0: List[Chunk[Int]] = List(Chunk(1, 2), Chunk(2, 3), Chunk(3, 4))
    Exceptions thrown

    IllegalArgumentException if n <= 0

  56. def split[F[_], I](f: (I) ⇒ Boolean): Pipe[F, I, Vector[I]]

    Permalink

    Break the input into chunks where the delimiter matches the predicate.

    Break the input into chunks where the delimiter matches the predicate. The delimiter does not appear in the output. Two adjacent delimiters in the input result in an empty chunk in the output.

  57. def stepper[I, O](s: (Stream[Pure, I]) ⇒ Stream[Pure, O]): Stepper[I, O]

    Permalink
  58. def sum[F[_], I](implicit ev: Numeric[I]): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Writes the sum of all input elements, or zero if the input is empty.

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

    Permalink
    Definition Classes
    AnyRef
  60. def tail[F[_], I]: (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emits all elements of the input except the first one.

  61. def take[F[_], I](n: Long): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emit the first n elements of the input Handle and return the new Handle.

  62. def takeRight[F[_], I](n: Long): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emits the last n elements of the input.

  63. def takeThrough[F[_], I](f: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Like takeWhile, but emits the first value which tests false.

  64. def takeWhile[F[_], I](f: (I) ⇒ Boolean): (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Emit the longest prefix of the input for which all elements test true according to f.

  65. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  66. def unNoneTerminate[F[_], I]: (Stream[F, Option[I]]) ⇒ Stream[F, I]

    Permalink

    Halt the input stream at the first None.

    Halt the input stream at the first None.

    Example:
    1. scala> unNoneTerminate(Stream(Some(1), Some(2), None, Some(3), None)).toVector
      res0: Vector[Int] = Vector(1, 2)
  67. def unchunk[F[_], I]: (Stream[F, I]) ⇒ Stream[F, I]

    Permalink

    Convert the input to a stream of solely 1-element chunks.

  68. def vectorChunkN[F[_], I](n: Int, allowFewer: Boolean = true): (Stream[F, I]) ⇒ Stream[F, Vector[I]]

    Permalink

    Groups inputs into separate Vector objects of size n.

    Groups inputs into separate Vector objects of size n.

    Example:
    1. scala> Stream(1, 2, 3, 4, 5).vectorChunkN(2).toVector
      res0: Vector[Vector[Int]] = Vector(Vector(1, 2), Vector(3, 4), Vector(5))
  69. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  72. def zipWithIndex[F[_], I]: (Stream[F, I]) ⇒ Stream[F, (I, Int)]

    Permalink

    Zip the elements of the input Handle with its indices, and return the new Handle

  73. def zipWithNext[F[_], I]: (Stream[F, I]) ⇒ Stream[F, (I, Option[I])]

    Permalink

    Zip the elements of the input Handle with its next element wrapped into Some, and return the new Handle.

    Zip the elements of the input Handle with its next element wrapped into Some, and return the new Handle. The last element is zipped with None.

  74. def zipWithPrevious[F[_], I]: (Stream[F, I]) ⇒ Stream[F, (Option[I], I)]

    Permalink

    Zip the elements of the input Handle with its previous element wrapped into Some, and return the new Handle.

    Zip the elements of the input Handle with its previous element wrapped into Some, and return the new Handle. The first element is zipped with None.

  75. def zipWithPreviousAndNext[F[_], I]: (Stream[F, I]) ⇒ Stream[F, (Option[I], I, Option[I])]

    Permalink

    Zip the elements of the input Handle with its previous and next elements wrapped into Some, and return the new Handle.

    Zip the elements of the input Handle with its previous and next elements wrapped into Some, and return the new Handle. The first element is zipped with None as the previous element, the last element is zipped with None as the next element.

  76. def zipWithScan[F[_], I, S](z: S)(f: (S, I) ⇒ S): (Stream[F, I]) ⇒ Stream[F, (I, S)]

    Permalink

    Zips the input with a running total according to S, up to but not including the current element.

    Zips the input with a running total according to S, up to but not including the current element. Thus the initial z value is the first emitted to the output:

    scala> Stream("uno", "dos", "tres", "cuatro").zipWithScan(0)(_ + _.length).toList
    res0: List[(String,Int)] = List((uno,0), (dos,3), (tres,6), (cuatro,10))
    See also

    zipWithScan1

  77. def zipWithScan1[F[_], I, S](z: S)(f: (S, I) ⇒ S): (Stream[F, I]) ⇒ Stream[F, (I, S)]

    Permalink

    Zips the input with a running total according to S, including the current element.

    Zips the input with a running total according to S, including the current element. Thus the initial z value is the first emitted to the output:

    scala> Stream("uno", "dos", "tres", "cuatro").zipWithScan(0)(_ + _.length).toList
    res0: List[(String,Int)] = List((uno,0), (dos,3), (tres,6), (cuatro,10))
    See also

    zipWithScan

Inherited from AnyRef

Inherited from Any

Ungrouped