Class/Object

fs2

Stream

Related Docs: object Stream | package fs2

Permalink

final class Stream[+F[_], +O] extends AnyVal

A stream producing output of type O and which may evaluate F effects. If F is Pure, the stream evaluates no effects.

Much of the API of Stream is defined in Stream.InvariantOps.

Laws (using infix syntax):

append forms a monoid in conjunction with empty:

And cons is consistent with using ++ to prepend a single segment:

Stream.raiseError propagates until being caught by handleErrorWith:

Stream forms a monad with emit and flatMap:

The monad is the list-style sequencing monad:

Technical notes

Note: since the segment structure of the stream is observable, and s flatMap Stream.emit produces a stream of singleton segments, the right identity law uses a weaker notion of equality, === which normalizes both sides with respect to segment structure:

(s1 === s2) = normalize(s1) == normalize(s2) where == is full equality (a == b iff f(a) is identical to f(b) for all f)

normalize(s) can be defined as s.flatMap(Stream.emit), which just produces a singly-chunked stream from any input stream s.

Note: For efficiency Stream.map function operates on an entire segment at a time and preserves segment structure, which differs from the map derived from the monad (s map f == s flatMap (f andThen Stream.emit)) which would produce singleton segments. In particular, if f throws errors, the segmented version will fail on the first segment with an error, while the unsegmented version will fail on the first element with an error. Exceptions in pure code like this are strongly discouraged.

Source
Stream.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Stream
  2. AnyVal
  3. Any
Implicitly
  1. by covaryPure
  2. by PureOps
  3. by EmptyOps
  4. by any2stringadd
  5. by StringFormat
  6. by Ensuring
  7. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to any2stringadd[Stream[F, O]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ++[F[_], O2 >: O](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  5. def ->[B](y: B): (Stream[F, O], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to ArrowAssoc[Stream[F, O]] performed by method ArrowAssoc in scala.Predef. This conversion will take place only if F is a subclass of Pure (F <: Pure) and at the same time O is a subclass of Nothing (O <: Nothing).
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  7. def >>[F[_], O2](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  8. def append[F[_], O2 >: O](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  9. def as[O2](o2: O2): Stream[F, O2]

    Permalink

    Alias for _.map(_ => o2).

    Alias for _.map(_ => o2).

    Example:
    1. scala> Stream(1,2,3).as(0).toList
      res0: List[Int] = List(0, 0, 0)
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def attempt: Stream[F, Either[Throwable, O]]

    Permalink

    Returns a stream of O values wrapped in Right until the first error, which is emitted wrapped in Left.

    Returns a stream of O values wrapped in Right until the first error, which is emitted wrapped in Left.

    Example:
    1. scala> (Stream(1,2,3) ++ Stream.raiseError(new RuntimeException) ++ Stream(4,5,6)).attempt.toList
      res0: List[Either[Throwable,Int]] = List(Right(1), Right(2), Right(3), Left(java.lang.RuntimeException))

      rethrow is the inverse of attempt, with the caveat that anything after the first failure is discarded.

  12. def buffer(n: Int): Stream[F, O]

    Permalink

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

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

    Example:
    1. scala> import cats.effect.IO
      scala> val buf = new scala.collection.mutable.ListBuffer[String]()
      scala> Stream.range(0, 100).covary[IO].
           |   evalMap(i => IO { buf += s">$i"; i }).
           |   buffer(4).
           |   evalMap(i => IO { buf += s"<$i"; i }).
           |   take(10).
           |   compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
      scala> buf.toList
      res1: List[String] = List(>0, >1, >2, >3, <0, <1, <2, <3, >4, >5, >6, >7, <4, <5, <6, <7, >8, >9, >10, >11, <8, <9)
  13. def bufferAll: Stream[F, O]

    Permalink

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

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

    Example:
    1. scala> import cats.effect.IO
      scala> val buf = new scala.collection.mutable.ListBuffer[String]()
      scala> Stream.range(0, 10).covary[IO].
           |   evalMap(i => IO { buf += s">$i"; i }).
           |   bufferAll.
           |   evalMap(i => IO { buf += s"<$i"; i }).
           |   take(4).
           |   compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3)
      scala> buf.toList
      res1: List[String] = List(>0, >1, >2, >3, >4, >5, >6, >7, >8, >9, <0, <1, <2, <3)
  14. def bufferBy(f: (O) ⇒ Boolean): Stream[F, O]

    Permalink

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

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

    Example:
    1. scala> import cats.effect.IO
      scala> val buf = new scala.collection.mutable.ListBuffer[String]()
      scala> Stream.range(0, 10).covary[IO].
           |   evalMap(i => IO { buf += s">$i"; i }).
           |   bufferBy(_ % 2 == 0).
           |   evalMap(i => IO { buf += s"<$i"; i }).
           |   compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
      scala> buf.toList
      res1: List[String] = List(>0, >1, <0, <1, >2, >3, <2, <3, >4, >5, <4, <5, >6, >7, <6, <7, >8, >9, <8, <9)
  15. def changesBy[O2](f: (O) ⇒ O2)(implicit eq: Eq[O2]): Stream[F, O]

    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(o => (o, f(o))).changesBy(_._2).map(_._1)

    Example:
    1. scala> import cats.implicits._
      scala> Stream(1,1,2,4,6,9).changesBy(_ % 2).toList
      res0: List[Int] = List(1, 2, 9)
  16. def chunkLimit(n: Int): Stream[F, Chunk[O]]

    Permalink

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

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

    Example:
    1. scala> (Stream(1) ++ Stream(2, 3) ++ Stream(4, 5, 6)).chunkLimit(2).toList
      res0: List[Chunk[Int]] = List(Chunk(1), Chunk(2, 3), Chunk(4, 5), Chunk(6))
  17. def chunks: Stream[F, Chunk[O]]

    Permalink

    Outputs all chunks from the source stream.

    Outputs all chunks from the source stream.

    Example:
    1. scala> (Stream(1) ++ Stream(2, 3) ++ Stream(4, 5, 6)).chunks.toList
      res0: List[Chunk[Int]] = List(Chunk(1), Chunk(2, 3), Chunk(4, 5, 6))
  18. def collect[O2](pf: PartialFunction[O, O2]): Stream[F, O2]

    Permalink

    Filters and maps simultaneously.

    Filters and maps simultaneously. Calls collect on each segment in the stream.

    Example:
    1. scala> Stream(Some(1), Some(2), None, Some(3), None, Some(4)).collect { case Some(i) => i }.toList
      res0: List[Int] = List(1, 2, 3, 4)
  19. def collectFirst[O2](pf: PartialFunction[O, O2]): Stream[F, O2]

    Permalink

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

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

    Example:
    1. scala> Stream(None, Some(1), Some(2), None, Some(3)).collectFirst { case Some(i) => i }.toList
      res0: List[Int] = List(1)
  20. def concurrently[F[_], O2](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  21. def cons[O2 >: O](s: Segment[O2, Unit]): Stream[F, O2]

    Permalink

    Prepends a segment onto the front of this stream.

    Prepends a segment onto the front of this stream.

    Example:
    1. scala> Stream(1,2,3).cons(Segment.vector(Vector(-1, 0))).toList
      res0: List[Int] = List(-1, 0, 1, 2, 3)
  22. def cons1[O2 >: O](o: O2): Stream[F, O2]

    Permalink

    Prepends a single value onto the front of this stream.

    Prepends a single value onto the front of this stream.

    Example:
    1. scala> Stream(1,2,3).cons1(0).toList
      res0: List[Int] = List(0, 1, 2, 3)
  23. def consChunk[O2 >: O](c: Chunk[O2]): Stream[F, O2]

    Permalink

    Prepends a chunk onto the front of this stream.

    Prepends a chunk onto the front of this stream.

    Example:
    1. scala> Stream(1,2,3).consChunk(Chunk.vector(Vector(-1, 0))).toList
      res0: List[Int] = List(-1, 0, 1, 2, 3)
  24. def covaryOutput[O2 >: O]: Stream[F, O2]

    Permalink

    Lifts this stream to the specified output type.

    Lifts this stream to the specified output type.

    Example:
    1. scala> Stream(Some(1), Some(2), Some(3)).covaryOutput[Option[Int]]
      res0: Stream[Pure,Option[Int]] = Stream(..)
  25. def delete(p: (O) ⇒ Boolean): Stream[F, O]

    Permalink

    Skips the first element that matches the predicate.

    Skips the first element that matches the predicate.

    Example:
    1. scala> Stream.range(1, 10).delete(_ % 2 == 0).toList
      res0: List[Int] = List(1, 3, 4, 5, 6, 7, 8, 9)
  26. def drain: Stream[F, Nothing]

    Permalink

    Removes all output values from this stream.

    Removes all output values from this stream.

    Often used with merge to run one side of the merge for its effect while getting outputs from the opposite side of the merge.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.eval(IO(println("x"))).drain.compile.toVector.unsafeRunSync
      res0: Vector[Nothing] = Vector()
  27. def drop(n: Long): Stream[F, O]

    Permalink

    Drops n elements of the input, then echoes the rest.

    Drops n elements of the input, then echoes the rest.

    Example:
    1. scala> Stream.range(0,10).drop(5).toList
      res0: List[Int] = List(5, 6, 7, 8, 9)
  28. def dropLast: Stream[F, O]

    Permalink

    Drops the last element.

    Drops the last element.

    Example:
    1. scala> Stream.range(0,10).dropLast.toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5, 6, 7, 8)
  29. def dropLastIf(p: (O) ⇒ Boolean): Stream[F, O]

    Permalink

    Drops the last element if the predicate evaluates to true.

    Drops the last element if the predicate evaluates to true.

    Example:
    1. scala> Stream.range(0,10).dropLastIf(_ > 5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5, 6, 7, 8)
  30. def dropRight(n: Int): Stream[F, O]

    Permalink

    Outputs all but the last n elements of the input.

    Outputs all but the last n elements of the input.

    Example:
    1. scala> Stream.range(0,10).dropRight(5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  31. def dropThrough(p: (O) ⇒ Boolean): Stream[F, O]

    Permalink

    Like dropWhile, but drops the first value which tests false.

    Like dropWhile, but drops the first value which tests false.

    Example:
    1. scala> Stream.range(0,10).dropThrough(_ != 4).toList
      res0: List[Int] = List(5, 6, 7, 8, 9)
  32. def dropWhile(p: (O) ⇒ Boolean): Stream[F, O]

    Permalink

    Drops elements from the head of this stream until the supplied predicate returns false.

    Drops elements from the head of this stream until the supplied predicate returns false.

    Example:
    1. scala> Stream.range(0,10).dropWhile(_ != 4).toList
      res0: List[Int] = List(4, 5, 6, 7, 8, 9)
  33. def either[F[_], O2](s2: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, Either[O, O2]]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  34. def ensuring(cond: (Stream[F, O]) ⇒ Boolean, msg: ⇒ Any): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Ensuring[Stream[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  35. def ensuring(cond: (Stream[F, O]) ⇒ Boolean): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Ensuring[Stream[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  36. def ensuring(cond: Boolean, msg: ⇒ Any): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Ensuring[Stream[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  37. def ensuring(cond: Boolean): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Ensuring[Stream[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  38. def evalMap[F[_], O2](f: (O) ⇒ F[O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  39. def evalScan[F[_], O2](z: O2)(f: (O2, O) ⇒ F[O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  40. def exists(p: (O) ⇒ Boolean): Stream[F, Boolean]

    Permalink

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

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

    Example:
    1. scala> Stream.range(0,10).exists(_ == 4).toList
      res0: List[Boolean] = List(true)
      scala> Stream.range(0,10).exists(_ == 10).toList
      res1: List[Boolean] = List(false)
  41. def filter(p: (O) ⇒ Boolean): Stream[F, O]

    Permalink

    Emits only inputs which match the supplied predicate.

    Emits only inputs which match the supplied predicate.

    Example:
    1. scala> Stream.range(0,10).filter(_ % 2 == 0).toList
      res0: List[Int] = List(0, 2, 4, 6, 8)
  42. def filterWithPrevious(f: (O, O) ⇒ Boolean): Stream[F, O]

    Permalink

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

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

    Example:
    1. scala> Stream(1, -1, 2, -2, 3, -3, 4, -4).filterWithPrevious((previous, current) => previous < current).toList
      res0: List[Int] = List(1, 2, 3, 4)
  43. def find(f: (O) ⇒ Boolean): Stream[F, O]

    Permalink

    Emits the first input (if any) which matches the supplied predicate.

    Emits the first input (if any) which matches the supplied predicate.

    Example:
    1. scala> Stream.range(1,10).find(_ % 2 == 0).toList
      res0: List[Int] = List(2)
  44. def flatMap[F[_], O2](f: (O) ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  45. def fold[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[F, O2]

    Permalink

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

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

    Example:
    1. scala> Stream(1, 2, 3, 4, 5).fold(0)(_ + _).toList
      res0: List[Int] = List(15)
  46. def fold1[O2 >: O](f: (O2, O2) ⇒ O2): Stream[F, O2]

    Permalink

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

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

    Example:
    1. scala> Stream(1, 2, 3, 4, 5).fold1(_ + _).toList
      res0: List[Int] = List(15)
  47. def foldMap[O2](f: (O) ⇒ O2)(implicit O2: Monoid[O2]): Stream[F, O2]

    Permalink

    Alias for map(f).foldMonoid.

    Alias for map(f).foldMonoid.

    Example:
    1. scala> import cats.implicits._
      scala> Stream(1, 2, 3, 4, 5).foldMap(_ => 1).toList
      res0: List[Int] = List(5)
  48. def forall(p: (O) ⇒ Boolean): 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.

    Example:
    1. scala> Stream(1, 2, 3, 4, 5).forall(_ < 10).toList
      res0: List[Boolean] = List(true)
  49. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to StringFormat[Stream[F, O]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  50. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  51. def groupAdjacentBy[O2](f: (O) ⇒ O2)(implicit eq: Eq[O2]): Stream[F, (O2, Segment[O, Unit])]

    Permalink

    Partitions the input into a stream of segments according to a discriminator function.

    Partitions the input into a stream of segments according to a discriminator function.

    Each chunk in the source stream is grouped using the supplied discriminator function and the results of the grouping are emitted each time the discriminator function changes values.

    Example:
    1. scala> import cats.implicits._
      scala> Stream("Hello", "Hi", "Greetings", "Hey").groupAdjacentBy(_.head).toList.map { case (k,vs) => k -> vs.force.toList }
      res0: List[(Char,List[String])] = List((H,List(Hello, Hi)), (G,List(Greetings)), (H,List(Hey)))
  52. def handleErrorWith[F[_], O2 >: O](h: (Throwable) ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  53. def head: Stream[F, O]

    Permalink

    Emits the first element of this stream (if non-empty) and then halts.

    Emits the first element of this stream (if non-empty) and then halts.

    Example:
    1. scala> Stream(1, 2, 3).head.toList
      res0: List[Int] = List(1)
  54. def interleave[F[_], O2 >: O](s2: Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  55. def interleaveAll[F[_], O2 >: O](s2: Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  56. def interruptWhen[F[_]](haltWhenTrue: Signal[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  57. def interruptWhen[F[_]](haltWhenTrue: Stream[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  58. def intersperse[O2 >: O](separator: O2): Stream[F, O2]

    Permalink

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

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

    Example:
    1. scala> Stream(1, 2, 3, 4, 5).intersperse(0).toList
      res0: List[Int] = List(1, 0, 2, 0, 3, 0, 4, 0, 5)
  59. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  60. def join[F[_], O2](maxOpen: Int)(implicit ev: <:<[O, Stream[F, O2]], F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  61. def joinUnbounded[F[_], O2](implicit ev: <:<[O, Stream[F, O2]], F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  62. def last: Stream[F, Option[O]]

    Permalink

    Returns the last element of this stream, if non-empty.

    Returns the last element of this stream, if non-empty.

    Example:
    1. scala> Stream(1, 2, 3).last.toList
      res0: List[Option[Int]] = List(Some(3))
  63. def lastOr[O2 >: O](fallback: ⇒ O2): Stream[F, O2]

    Permalink

    Returns the last element of this stream, if non-empty, otherwise the supplied fallback value.

    Returns the last element of this stream, if non-empty, otherwise the supplied fallback value.

    Example:
    1. scala> Stream(1, 2, 3).lastOr(0).toList
      res0: List[Int] = List(3)
      scala> Stream.empty.lastOr(0).toList
      res1: List[Int] = List(0)
  64. def map[O2](f: (O) ⇒ O2): Stream[F, O2]

    Permalink

    Applies the specified pure function to each input and emits the result.

    Applies the specified pure function to each input and emits the result.

    Example:
    1. scala> Stream("Hello", "World!").map(_.size).toList
      res0: List[Int] = List(5, 6)
  65. def mapAccumulate[S, O2](init: S)(f: (S, O) ⇒ (S, O2)): Stream[F, (S, O2)]

    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))
  66. def mapChunks[O2](f: (Chunk[O]) ⇒ Segment[O2, Unit]): Stream[F, O2]

    Permalink

    Applies the specified pure function to each chunk in this stream.

    Applies the specified pure function to each chunk in this stream.

    Example:
    1. scala> Stream(1, 2, 3).append(Stream(4, 5, 6)).mapChunks { c => val ints = c.toInts; for (i <- 0 until ints.values.size) ints.values(i) = 0; ints.toSegment }.toList
      res0: List[Int] = List(0, 0, 0, 0, 0, 0)
  67. def mapSegments[O2](f: (Segment[O, Unit]) ⇒ Segment[O2, Unit]): Stream[F, O2]

    Permalink

    Applies the specified pure function to each segment in this stream.

    Applies the specified pure function to each segment in this stream.

    Example:
    1. scala> (Stream.range(1,5) ++ Stream.range(5,10)).mapSegments(s => s.scan(0)(_ + _).voidResult).toList
      res0: List[Int] = List(0, 1, 3, 6, 10, 0, 5, 11, 18, 26, 35)
  68. def mask: Stream[F, O]

    Permalink

    Behaves like the identity function but halts the stream on an error and does not return the error.

    Behaves like the identity function but halts the stream on an error and does not return the error.

    Example:
    1. scala> (Stream(1,2,3) ++ Stream.raiseError(new RuntimeException) ++ Stream(4, 5, 6)).mask.toList
      res0: List[Int] = List(1, 2, 3)
  69. def merge[F[_], O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  70. def mergeHaltBoth[F[_], O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  71. def mergeHaltL[F[_], O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  72. def mergeHaltR[F[_], O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  73. def noneTerminate: Stream[F, Option[O]]

    Permalink

    Emits each output wrapped in a Some and emits a None at the end of the stream.

    Emits each output wrapped in a Some and emits a None at the end of the stream.

    s.noneTerminate.unNoneTerminate == s

    Example:
    1. scala> Stream(1,2,3).noneTerminate.toList
      res0: List[Option[Int]] = List(Some(1), Some(2), Some(3), None)
  74. def observe[F[_]](sink: Sink[F, O])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  75. def observe1[F[_]](f: (O) ⇒ F[Unit])(implicit F: Functor[F]): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  76. def observeAsync[F[_]](maxQueued: Int)(sink: Sink[F, O])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  77. def onComplete[F[_], O2 >: O](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  78. def onFinalize[F[_]](f: F[Unit])(implicit F: Applicative[F]): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  79. def pauseWhen[F[_]](pauseWhenTrue: Signal[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  80. def pauseWhen[F[_]](pauseWhenTrue: Stream[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  81. def reduce[O2 >: O](f: (O2, O2) ⇒ O2): Stream[F, O2]

    Permalink

    Alias for fold1.

  82. def repeat: Stream[F, O]

    Permalink

    Repeat this stream an infinite number of times.

    Repeat this stream an infinite number of times.

    s.repeat == s ++ s ++ s ++ ...

    Example:
    1. scala> Stream(1,2,3).repeat.take(8).toList
      res0: List[Int] = List(1, 2, 3, 1, 2, 3, 1, 2)
  83. def rethrow[O2](implicit ev: <:<[O, Either[Throwable, O2]]): Stream[F, O2]

    Permalink

    Converts a Stream[F,Either[Throwable,O]] to a Stream[F,O], which emits right values and fails upon the first Left(t).

    Converts a Stream[F,Either[Throwable,O]] to a Stream[F,O], which emits right values and fails upon the first Left(t). Preserves chunkiness.

    Example:
    1. scala> Stream(Right(1), Right(2), Left(new RuntimeException), Right(3)).rethrow.handleErrorWith(t => Stream(-1)).toList
      res0: List[Int] = List(-1)
  84. def scan[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[F, O2]

    Permalink

    Left fold which outputs all intermediate results.

    Left fold which outputs all intermediate results.

    Example:
    1. scala> Stream(1,2,3,4).scan(0)(_ + _).toList
      res0: List[Int] = List(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

  85. def scan1[O2 >: O](f: (O2, O2) ⇒ O2): Stream[F, O2]

    Permalink

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

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

    Example:
    1. scala> Stream(1,2,3,4).scan1(_ + _).toList
      res0: List[Int] = List(1, 3, 6, 10)
  86. def scope: Stream[F, O]

    Permalink

    Tracks any resources acquired during this stream and releases them when the stream completes.

    Tracks any resources acquired during this stream and releases them when the stream completes.

    Scopes are sometimes inserted automatically, (e.g., as a result of calling handleErrorWith). This method allows a scope to be explicitly demarcated, so that resources can be freed earlier than when using automatically inserted scopes.

  87. def segmentLimit(n: Int): Stream[F, Segment[O, Unit]]

    Permalink

    Outputs the segments of this stream as output values, ensuring each segment has maximum size n, splitting segments as necessary.

    Outputs the segments of this stream as output values, ensuring each segment has maximum size n, splitting segments as necessary.

    Example:
    1. scala> Stream(1,2,3).repeat.segmentLimit(2).take(5).toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1, 2), Chunk(3), Chunk(1, 2), Chunk(3), Chunk(1, 2))
  88. def segmentN(n: Int, allowFewer: Boolean = true): Stream[F, Segment[O, Unit]]

    Permalink

    Outputs segments of size n.

    Outputs segments of size n.

    Segments from the source stream are split as necessary. If allowFewer is true, the last segment that is emitted may have less than n elements.

    Example:
    1. scala> Stream(1,2,3).repeat.segmentN(2).take(5).toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1, 2), catenated(Chunk(3), Chunk(1)), Chunk(2, 3), Chunk(1, 2), catenated(Chunk(3), Chunk(1)))
  89. def segments: Stream[F, Segment[O, Unit]]

    Permalink

    Outputs all segments from the source stream.

    Outputs all segments from the source stream.

    Example:
    1. scala> Stream(1,2,3).repeat.segments.take(5).toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1, 2, 3), Chunk(1, 2, 3), Chunk(1, 2, 3), Chunk(1, 2, 3), Chunk(1, 2, 3))
  90. def sliding(n: Int): Stream[F, Queue[O]]

    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[scala.collection.immutable.Queue[Int]] = List(Queue(1, 2), Queue(2, 3), Queue(3, 4))
    Exceptions thrown

    scala.IllegalArgumentException if n <= 0

  91. def split(f: (O) ⇒ Boolean): Stream[F, Segment[O, Unit]]

    Permalink

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

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

    Example:
    1. scala> Stream.range(0, 10).split(_ % 4 == 0).toList
      res0: List[Segment[Int,Unit]] = List(empty, catenated(Chunk(1), Chunk(2), Chunk(3), empty), catenated(Chunk(5), Chunk(6), Chunk(7), empty), Chunk(9))
  92. def tail: Stream[F, O]

    Permalink

    Emits all elements of the input except the first one.

    Emits all elements of the input except the first one.

    Example:
    1. scala> Stream(1,2,3).tail.toList
      res0: List[Int] = List(2, 3)
  93. def take(n: Long): Stream[F, O]

    Permalink

    Emits the first n elements of this stream.

    Emits the first n elements of this stream.

    Example:
    1. scala> Stream.range(0,1000).take(5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  94. def takeRight(n: Long): Stream[F, O]

    Permalink

    Emits the last n elements of the input.

    Emits the last n elements of the input.

    Example:
    1. scala> Stream.range(0,1000).takeRight(5).toList
      res0: List[Int] = List(995, 996, 997, 998, 999)
  95. def takeThrough(p: (O) ⇒ Boolean): Stream[F, O]

    Permalink

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

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

    Example:
    1. scala> Stream.range(0,1000).takeThrough(_ != 5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5)
  96. def takeWhile(p: (O) ⇒ Boolean, takeFailure: Boolean = false): Stream[F, O]

    Permalink

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

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

    Example:
    1. scala> Stream.range(0,1000).takeWhile(_ != 5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  97. def toList: List[O]

    Permalink

    Runs this pure stream and returns the emitted elements in a list.

    Runs this pure stream and returns the emitted elements in a list. Note: this method is only available on pure streams.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  98. def toString(): String

    Permalink
    Definition Classes
    Stream → Any
  99. def toVector: Vector[O]

    Permalink

    Runs this pure stream and returns the emitted elements in a vector.

    Runs this pure stream and returns the emitted elements in a vector. Note: this method is only available on pure streams.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  100. def unNone[O2](implicit ev: <:<[O, Option[O2]]): Stream[F, O2]

    Permalink

    Filters any 'None'.

    Filters any 'None'.

    Example:
    1. scala> Stream(Some(1), Some(2), None, Some(3), None).unNone.toList
      res0: List[Int] = List(1, 2, 3)
  101. def unNoneTerminate[O2](implicit ev: <:<[O, Option[O2]]): Stream[F, O2]

    Permalink

    Halts the input stream at the first None.

    Halts the input stream at the first None.

    Example:
    1. scala> Stream(Some(1), Some(2), None, Some(3), None).unNoneTerminate.toList
      res0: List[Int] = List(1, 2)
  102. def unchunk: Stream[F, O]

    Permalink

    Converts the input to a stream of 1-element chunks.

    Converts the input to a stream of 1-element chunks.

    Example:
    1. scala> (Stream(1,2,3) ++ Stream(4,5,6)).unchunk.segments.toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1), Chunk(2), Chunk(3), Chunk(4), Chunk(5), Chunk(6))
  103. def zip[F[_], O2](s2: Stream[F, O2]): Stream[F, (O, O2)]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  104. def zipAll[F[_], O2](that: Stream[F, O2])(pad1: O, pad2: O2): Stream[F, (O, O2)]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  105. def zipAllWith[F[_], O2, O3](that: Stream[F, O2])(pad1: O, pad2: O2)(f: (O, O2) ⇒ O3): Stream[F, O3]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  106. def zipWith[F[_], O2, O3](s2: Stream[F, O2])(f: (O, O2) ⇒ O3): Stream[F, O3]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Definition Classes
    PureOps
  107. def zipWithIndex: Stream[F, (O, Long)]

    Permalink

    Zips the elements of the input stream with its indices, and returns the new stream.

    Zips the elements of the input stream with its indices, and returns the new stream.

    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithIndex.toList
      res0: List[(String,Long)] = List((The,0), (quick,1), (brown,2), (fox,3))
  108. def zipWithNext: Stream[F, (O, Option[O])]

    Permalink

    Zips each element of this stream with the next element wrapped into Some.

    Zips each element of this stream with the next element wrapped into Some. The last element is zipped with None.

    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithNext.toList
      res0: List[(String,Option[String])] = List((The,Some(quick)), (quick,Some(brown)), (brown,Some(fox)), (fox,None))
  109. def zipWithPrevious: Stream[F, (Option[O], O)]

    Permalink

    Zips each element of this stream with the previous element wrapped into Some.

    Zips each element of this stream with the previous element wrapped into Some. The first element is zipped with None.

    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithPrevious.toList
      res0: List[(Option[String],String)] = List((None,The), (Some(The),quick), (Some(quick),brown), (Some(brown),fox))
  110. def zipWithPreviousAndNext: Stream[F, (Option[O], O, Option[O])]

    Permalink

    Zips each element of this stream with its previous and next element wrapped into Some.

    Zips each element of this stream with its previous and next element wrapped into Some. The first element is zipped with None as the previous element, the last element is zipped with None as the next element.

    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithPreviousAndNext.toList
      res0: List[(Option[String],String,Option[String])] = List((None,The,Some(quick)), (Some(The),quick,Some(brown)), (Some(quick),brown,Some(fox)), (Some(brown),fox,None))
  111. def zipWithScan[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[F, (O, O2)]

    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:

    Example:
    1. 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

  112. def zipWithScan1[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[F, (O, O2)]

    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:

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

    zipWithScan

  113. def [B](y: B): (Stream[F, O], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to ArrowAssoc[Stream[F, O]] performed by method ArrowAssoc in scala.Predef. This conversion will take place only if F is a subclass of Pure (F <: Pure) and at the same time O is a subclass of Nothing (O <: Nothing).
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def as[O2](o2: O2): Stream[Nothing, O2]

    Permalink

    Alias for _.map(_ => o2).

    Alias for _.map(_ => o2).

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).as(o2)
    Example:
    1. scala> Stream(1,2,3).as(0).toList
      res0: List[Int] = List(0, 0, 0)
  2. def attempt: Stream[Nothing, Either[Throwable, O]]

    Permalink

    Returns a stream of O values wrapped in Right until the first error, which is emitted wrapped in Left.

    Returns a stream of O values wrapped in Right until the first error, which is emitted wrapped in Left.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).attempt
    Example:
    1. scala> (Stream(1,2,3) ++ Stream.raiseError(new RuntimeException) ++ Stream(4,5,6)).attempt.toList
      res0: List[Either[Throwable,Int]] = List(Right(1), Right(2), Right(3), Left(java.lang.RuntimeException))

      rethrow is the inverse of attempt, with the caveat that anything after the first failure is discarded.

  3. def buffer(n: Int): Stream[Nothing, O]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).buffer(n)
    Example:
    1. scala> import cats.effect.IO
      scala> val buf = new scala.collection.mutable.ListBuffer[String]()
      scala> Stream.range(0, 100).covary[IO].
           |   evalMap(i => IO { buf += s">$i"; i }).
           |   buffer(4).
           |   evalMap(i => IO { buf += s"<$i"; i }).
           |   take(10).
           |   compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
      scala> buf.toList
      res1: List[String] = List(>0, >1, >2, >3, <0, <1, <2, <3, >4, >5, >6, >7, <4, <5, <6, <7, >8, >9, >10, >11, <8, <9)
  4. def bufferAll: Stream[Nothing, O]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).bufferAll
    Example:
    1. scala> import cats.effect.IO
      scala> val buf = new scala.collection.mutable.ListBuffer[String]()
      scala> Stream.range(0, 10).covary[IO].
           |   evalMap(i => IO { buf += s">$i"; i }).
           |   bufferAll.
           |   evalMap(i => IO { buf += s"<$i"; i }).
           |   take(4).
           |   compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3)
      scala> buf.toList
      res1: List[String] = List(>0, >1, >2, >3, >4, >5, >6, >7, >8, >9, <0, <1, <2, <3)
  5. def bufferBy(f: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).bufferBy(f)
    Example:
    1. scala> import cats.effect.IO
      scala> val buf = new scala.collection.mutable.ListBuffer[String]()
      scala> Stream.range(0, 10).covary[IO].
           |   evalMap(i => IO { buf += s">$i"; i }).
           |   bufferBy(_ % 2 == 0).
           |   evalMap(i => IO { buf += s"<$i"; i }).
           |   compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
      scala> buf.toList
      res1: List[String] = List(>0, >1, <0, <1, >2, >3, <2, <3, >4, >5, <4, <5, >6, >7, <6, <7, >8, >9, <8, <9)
  6. def changesBy[O2](f: (O) ⇒ O2)(implicit eq: Eq[O2]): Stream[Nothing, O]

    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(o => (o, f(o))).changesBy(_._2).map(_._1)

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).changesBy(f)(eq)
    Example:
    1. scala> import cats.implicits._
      scala> Stream(1,1,2,4,6,9).changesBy(_ % 2).toList
      res0: List[Int] = List(1, 2, 9)
  7. def chunkLimit(n: Int): Stream[Nothing, Chunk[O]]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).chunkLimit(n)
    Example:
    1. scala> (Stream(1) ++ Stream(2, 3) ++ Stream(4, 5, 6)).chunkLimit(2).toList
      res0: List[Chunk[Int]] = List(Chunk(1), Chunk(2, 3), Chunk(4, 5), Chunk(6))
  8. def chunks: Stream[Nothing, Chunk[O]]

    Permalink

    Outputs all chunks from the source stream.

    Outputs all chunks from the source stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).chunks
    Example:
    1. scala> (Stream(1) ++ Stream(2, 3) ++ Stream(4, 5, 6)).chunks.toList
      res0: List[Chunk[Int]] = List(Chunk(1), Chunk(2, 3), Chunk(4, 5, 6))
  9. def collect[O2](pf: PartialFunction[O, O2]): Stream[Nothing, O2]

    Permalink

    Filters and maps simultaneously.

    Filters and maps simultaneously. Calls collect on each segment in the stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).collect(pf)
    Example:
    1. scala> Stream(Some(1), Some(2), None, Some(3), None, Some(4)).collect { case Some(i) => i }.toList
      res0: List[Int] = List(1, 2, 3, 4)
  10. def collectFirst[O2](pf: PartialFunction[O, O2]): Stream[Nothing, O2]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).collectFirst(pf)
    Example:
    1. scala> Stream(None, Some(1), Some(2), None, Some(3)).collectFirst { case Some(i) => i }.toList
      res0: List[Int] = List(1)
  11. def cons[O2 >: O](s: Segment[O2, Unit]): Stream[Nothing, O2]

    Permalink

    Prepends a segment onto the front of this stream.

    Prepends a segment onto the front of this stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).cons(s)
    Example:
    1. scala> Stream(1,2,3).cons(Segment.vector(Vector(-1, 0))).toList
      res0: List[Int] = List(-1, 0, 1, 2, 3)
  12. def cons1[O2 >: O](o: O2): Stream[Nothing, O2]

    Permalink

    Prepends a single value onto the front of this stream.

    Prepends a single value onto the front of this stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).cons1(o)
    Example:
    1. scala> Stream(1,2,3).cons1(0).toList
      res0: List[Int] = List(0, 1, 2, 3)
  13. def consChunk[O2 >: O](c: Chunk[O2]): Stream[Nothing, O2]

    Permalink

    Prepends a chunk onto the front of this stream.

    Prepends a chunk onto the front of this stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).consChunk(c)
    Example:
    1. scala> Stream(1,2,3).consChunk(Chunk.vector(Vector(-1, 0))).toList
      res0: List[Int] = List(-1, 0, 1, 2, 3)
  14. def covary[F[_]]: Stream[F, O]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (stream: PureOps[O]).covary
    Definition Classes
    PureOps
  15. def covary[F[_]]: Stream[F, Nothing]

    Permalink

    Lifts this stream to the specified effect type.

    Lifts this stream to the specified effect type.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to EmptyOps performed by method EmptyOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure) and at the same time O is a subclass of Nothing (O <: Nothing).
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (stream: EmptyOps).covary
    Definition Classes
    EmptyOps
  16. def covaryAll[F[_], O2 >: O]: Stream[F, O2]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to PureOps[O] performed by method PureOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (stream: PureOps[O]).covaryAll
    Definition Classes
    PureOps
  17. def covaryAll[F[_], O]: Stream[F, O]

    Permalink

    Lifts this stream to the specified effect and output types.

    Lifts this stream to the specified effect and output types.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to EmptyOps performed by method EmptyOps in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure) and at the same time O is a subclass of Nothing (O <: Nothing).
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (stream: EmptyOps).covaryAll
    Definition Classes
    EmptyOps
  18. def covaryOutput[O2 >: O]: Stream[Nothing, O2]

    Permalink

    Lifts this stream to the specified output type.

    Lifts this stream to the specified output type.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).covaryOutput
    Example:
    1. scala> Stream(Some(1), Some(2), Some(3)).covaryOutput[Option[Int]]
      res0: Stream[Pure,Option[Int]] = Stream(..)
  19. def delete(p: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

    Skips the first element that matches the predicate.

    Skips the first element that matches the predicate.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).delete(p)
    Example:
    1. scala> Stream.range(1, 10).delete(_ % 2 == 0).toList
      res0: List[Int] = List(1, 3, 4, 5, 6, 7, 8, 9)
  20. def drain: Stream[Nothing, Nothing]

    Permalink

    Removes all output values from this stream.

    Removes all output values from this stream.

    Often used with merge to run one side of the merge for its effect while getting outputs from the opposite side of the merge.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).drain
    Example:
    1. scala> import cats.effect.IO
      scala> Stream.eval(IO(println("x"))).drain.compile.toVector.unsafeRunSync
      res0: Vector[Nothing] = Vector()
  21. def drop(n: Long): Stream[Nothing, O]

    Permalink

    Drops n elements of the input, then echoes the rest.

    Drops n elements of the input, then echoes the rest.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).drop(n)
    Example:
    1. scala> Stream.range(0,10).drop(5).toList
      res0: List[Int] = List(5, 6, 7, 8, 9)
  22. def dropLast: Stream[Nothing, O]

    Permalink

    Drops the last element.

    Drops the last element.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).dropLast
    Example:
    1. scala> Stream.range(0,10).dropLast.toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5, 6, 7, 8)
  23. def dropLastIf(p: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

    Drops the last element if the predicate evaluates to true.

    Drops the last element if the predicate evaluates to true.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).dropLastIf(p)
    Example:
    1. scala> Stream.range(0,10).dropLastIf(_ > 5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5, 6, 7, 8)
  24. def dropRight(n: Int): Stream[Nothing, O]

    Permalink

    Outputs all but the last n elements of the input.

    Outputs all but the last n elements of the input.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).dropRight(n)
    Example:
    1. scala> Stream.range(0,10).dropRight(5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  25. def dropThrough(p: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

    Like dropWhile, but drops the first value which tests false.

    Like dropWhile, but drops the first value which tests false.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).dropThrough(p)
    Example:
    1. scala> Stream.range(0,10).dropThrough(_ != 4).toList
      res0: List[Int] = List(5, 6, 7, 8, 9)
  26. def dropWhile(p: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

    Drops elements from the head of this stream until the supplied predicate returns false.

    Drops elements from the head of this stream until the supplied predicate returns false.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).dropWhile(p)
    Example:
    1. scala> Stream.range(0,10).dropWhile(_ != 4).toList
      res0: List[Int] = List(4, 5, 6, 7, 8, 9)
  27. def exists(p: (O) ⇒ Boolean): Stream[Nothing, Boolean]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).exists(p)
    Example:
    1. scala> Stream.range(0,10).exists(_ == 4).toList
      res0: List[Boolean] = List(true)
      scala> Stream.range(0,10).exists(_ == 10).toList
      res1: List[Boolean] = List(false)
  28. def filter(p: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

    Emits only inputs which match the supplied predicate.

    Emits only inputs which match the supplied predicate.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).filter(p)
    Example:
    1. scala> Stream.range(0,10).filter(_ % 2 == 0).toList
      res0: List[Int] = List(0, 2, 4, 6, 8)
  29. def filterWithPrevious(f: (O, O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).filterWithPrevious(f)
    Example:
    1. scala> Stream(1, -1, 2, -2, 3, -3, 4, -4).filterWithPrevious((previous, current) => previous < current).toList
      res0: List[Int] = List(1, 2, 3, 4)
  30. def find(f: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

    Emits the first input (if any) which matches the supplied predicate.

    Emits the first input (if any) which matches the supplied predicate.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).find(f)
    Example:
    1. scala> Stream.range(1,10).find(_ % 2 == 0).toList
      res0: List[Int] = List(2)
  31. def fold[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[Nothing, O2]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).fold(z)(f)
    Example:
    1. scala> Stream(1, 2, 3, 4, 5).fold(0)(_ + _).toList
      res0: List[Int] = List(15)
  32. def fold1[O2 >: O](f: (O2, O2) ⇒ O2): Stream[Nothing, O2]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).fold1(f)
    Example:
    1. scala> Stream(1, 2, 3, 4, 5).fold1(_ + _).toList
      res0: List[Int] = List(15)
  33. def foldMap[O2](f: (O) ⇒ O2)(implicit O2: Monoid[O2]): Stream[Nothing, O2]

    Permalink

    Alias for map(f).foldMonoid.

    Alias for map(f).foldMonoid.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).foldMap(f)(O2)
    Example:
    1. scala> import cats.implicits._
      scala> Stream(1, 2, 3, 4, 5).foldMap(_ => 1).toList
      res0: List[Int] = List(5)
  34. def forall(p: (O) ⇒ Boolean): Stream[Nothing, 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.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).forall(p)
    Example:
    1. scala> Stream(1, 2, 3, 4, 5).forall(_ < 10).toList
      res0: List[Boolean] = List(true)
  35. def groupAdjacentBy[O2](f: (O) ⇒ O2)(implicit eq: Eq[O2]): Stream[Nothing, (O2, Segment[O, Unit])]

    Permalink

    Partitions the input into a stream of segments according to a discriminator function.

    Partitions the input into a stream of segments according to a discriminator function.

    Each chunk in the source stream is grouped using the supplied discriminator function and the results of the grouping are emitted each time the discriminator function changes values.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).groupAdjacentBy(f)(eq)
    Example:
    1. scala> import cats.implicits._
      scala> Stream("Hello", "Hi", "Greetings", "Hey").groupAdjacentBy(_.head).toList.map { case (k,vs) => k -> vs.force.toList }
      res0: List[(Char,List[String])] = List((H,List(Hello, Hi)), (G,List(Greetings)), (H,List(Hey)))
  36. def head: Stream[Nothing, O]

    Permalink

    Emits the first element of this stream (if non-empty) and then halts.

    Emits the first element of this stream (if non-empty) and then halts.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).head
    Example:
    1. scala> Stream(1, 2, 3).head.toList
      res0: List[Int] = List(1)
  37. def intersperse[O2 >: O](separator: O2): Stream[Nothing, O2]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).intersperse(separator)
    Example:
    1. scala> Stream(1, 2, 3, 4, 5).intersperse(0).toList
      res0: List[Int] = List(1, 0, 2, 0, 3, 0, 4, 0, 5)
  38. def last: Stream[Nothing, Option[O]]

    Permalink

    Returns the last element of this stream, if non-empty.

    Returns the last element of this stream, if non-empty.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).last
    Example:
    1. scala> Stream(1, 2, 3).last.toList
      res0: List[Option[Int]] = List(Some(3))
  39. def lastOr[O2 >: O](fallback: ⇒ O2): Stream[Nothing, O2]

    Permalink

    Returns the last element of this stream, if non-empty, otherwise the supplied fallback value.

    Returns the last element of this stream, if non-empty, otherwise the supplied fallback value.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).lastOr(fallback)
    Example:
    1. scala> Stream(1, 2, 3).lastOr(0).toList
      res0: List[Int] = List(3)
      scala> Stream.empty.lastOr(0).toList
      res1: List[Int] = List(0)
  40. def map[O2](f: (O) ⇒ O2): Stream[Nothing, O2]

    Permalink

    Applies the specified pure function to each input and emits the result.

    Applies the specified pure function to each input and emits the result.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).map(f)
    Example:
    1. scala> Stream("Hello", "World!").map(_.size).toList
      res0: List[Int] = List(5, 6)
  41. def mapAccumulate[S, O2](init: S)(f: (S, O) ⇒ (S, O2)): Stream[Nothing, (S, O2)]

    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.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).mapAccumulate(init)(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))
  42. def mapChunks[O2](f: (Chunk[O]) ⇒ Segment[O2, Unit]): Stream[Nothing, O2]

    Permalink

    Applies the specified pure function to each chunk in this stream.

    Applies the specified pure function to each chunk in this stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).mapChunks(f)
    Example:
    1. scala> Stream(1, 2, 3).append(Stream(4, 5, 6)).mapChunks { c => val ints = c.toInts; for (i <- 0 until ints.values.size) ints.values(i) = 0; ints.toSegment }.toList
      res0: List[Int] = List(0, 0, 0, 0, 0, 0)
  43. def mapSegments[O2](f: (Segment[O, Unit]) ⇒ Segment[O2, Unit]): Stream[Nothing, O2]

    Permalink

    Applies the specified pure function to each segment in this stream.

    Applies the specified pure function to each segment in this stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).mapSegments(f)
    Example:
    1. scala> (Stream.range(1,5) ++ Stream.range(5,10)).mapSegments(s => s.scan(0)(_ + _).voidResult).toList
      res0: List[Int] = List(0, 1, 3, 6, 10, 0, 5, 11, 18, 26, 35)
  44. def mask: Stream[Nothing, O]

    Permalink

    Behaves like the identity function but halts the stream on an error and does not return the error.

    Behaves like the identity function but halts the stream on an error and does not return the error.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).mask
    Example:
    1. scala> (Stream(1,2,3) ++ Stream.raiseError(new RuntimeException) ++ Stream(4, 5, 6)).mask.toList
      res0: List[Int] = List(1, 2, 3)
  45. def noneTerminate: Stream[Nothing, Option[O]]

    Permalink

    Emits each output wrapped in a Some and emits a None at the end of the stream.

    Emits each output wrapped in a Some and emits a None at the end of the stream.

    s.noneTerminate.unNoneTerminate == s

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).noneTerminate
    Example:
    1. scala> Stream(1,2,3).noneTerminate.toList
      res0: List[Option[Int]] = List(Some(1), Some(2), Some(3), None)
  46. def reduce[O2 >: O](f: (O2, O2) ⇒ O2): Stream[Nothing, O2]

    Permalink

    Alias for fold1.

    Alias for fold1.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).reduce(f)
  47. def repeat: Stream[Nothing, O]

    Permalink

    Repeat this stream an infinite number of times.

    Repeat this stream an infinite number of times.

    s.repeat == s ++ s ++ s ++ ...

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).repeat
    Example:
    1. scala> Stream(1,2,3).repeat.take(8).toList
      res0: List[Int] = List(1, 2, 3, 1, 2, 3, 1, 2)
  48. def rethrow[O2](implicit ev: <:<[O, Either[Throwable, O2]]): Stream[Nothing, O2]

    Permalink

    Converts a Stream[F,Either[Throwable,O]] to a Stream[F,O], which emits right values and fails upon the first Left(t).

    Converts a Stream[F,Either[Throwable,O]] to a Stream[F,O], which emits right values and fails upon the first Left(t). Preserves chunkiness.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).rethrow(ev)
    Example:
    1. scala> Stream(Right(1), Right(2), Left(new RuntimeException), Right(3)).rethrow.handleErrorWith(t => Stream(-1)).toList
      res0: List[Int] = List(-1)
  49. def scan[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[Nothing, O2]

    Permalink

    Left fold which outputs all intermediate results.

    Left fold which outputs all intermediate results.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).scan(z)(f)
    Example:
    1. scala> Stream(1,2,3,4).scan(0)(_ + _).toList
      res0: List[Int] = List(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

  50. def scan1[O2 >: O](f: (O2, O2) ⇒ O2): Stream[Nothing, O2]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).scan1(f)
    Example:
    1. scala> Stream(1,2,3,4).scan1(_ + _).toList
      res0: List[Int] = List(1, 3, 6, 10)
  51. def scope: Stream[Nothing, O]

    Permalink

    Tracks any resources acquired during this stream and releases them when the stream completes.

    Tracks any resources acquired during this stream and releases them when the stream completes.

    Scopes are sometimes inserted automatically, (e.g., as a result of calling handleErrorWith). This method allows a scope to be explicitly demarcated, so that resources can be freed earlier than when using automatically inserted scopes.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).scope
  52. def segmentLimit(n: Int): Stream[Nothing, Segment[O, Unit]]

    Permalink

    Outputs the segments of this stream as output values, ensuring each segment has maximum size n, splitting segments as necessary.

    Outputs the segments of this stream as output values, ensuring each segment has maximum size n, splitting segments as necessary.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).segmentLimit(n)
    Example:
    1. scala> Stream(1,2,3).repeat.segmentLimit(2).take(5).toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1, 2), Chunk(3), Chunk(1, 2), Chunk(3), Chunk(1, 2))
  53. def segmentN(n: Int, allowFewer: Boolean = true): Stream[Nothing, Segment[O, Unit]]

    Permalink

    Outputs segments of size n.

    Outputs segments of size n.

    Segments from the source stream are split as necessary. If allowFewer is true, the last segment that is emitted may have less than n elements.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).segmentN(n, allowFewer)
    Example:
    1. scala> Stream(1,2,3).repeat.segmentN(2).take(5).toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1, 2), catenated(Chunk(3), Chunk(1)), Chunk(2, 3), Chunk(1, 2), catenated(Chunk(3), Chunk(1)))
  54. def segments: Stream[Nothing, Segment[O, Unit]]

    Permalink

    Outputs all segments from the source stream.

    Outputs all segments from the source stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).segments
    Example:
    1. scala> Stream(1,2,3).repeat.segments.take(5).toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1, 2, 3), Chunk(1, 2, 3), Chunk(1, 2, 3), Chunk(1, 2, 3), Chunk(1, 2, 3))
  55. def sliding(n: Int): Stream[Nothing, Queue[O]]

    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.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).sliding(n)
    Example:
    1. scala> Stream(1, 2, 3, 4).sliding(2).toList
      res0: List[scala.collection.immutable.Queue[Int]] = List(Queue(1, 2), Queue(2, 3), Queue(3, 4))
    Exceptions thrown

    scala.IllegalArgumentException if n <= 0

  56. def split(f: (O) ⇒ Boolean): Stream[Nothing, Segment[O, Unit]]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).split(f)
    Example:
    1. scala> Stream.range(0, 10).split(_ % 4 == 0).toList
      res0: List[Segment[Int,Unit]] = List(empty, catenated(Chunk(1), Chunk(2), Chunk(3), empty), catenated(Chunk(5), Chunk(6), Chunk(7), empty), Chunk(9))
  57. def tail: Stream[Nothing, O]

    Permalink

    Emits all elements of the input except the first one.

    Emits all elements of the input except the first one.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).tail
    Example:
    1. scala> Stream(1,2,3).tail.toList
      res0: List[Int] = List(2, 3)
  58. def take(n: Long): Stream[Nothing, O]

    Permalink

    Emits the first n elements of this stream.

    Emits the first n elements of this stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).take(n)
    Example:
    1. scala> Stream.range(0,1000).take(5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  59. def takeRight(n: Long): Stream[Nothing, O]

    Permalink

    Emits the last n elements of the input.

    Emits the last n elements of the input.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).takeRight(n)
    Example:
    1. scala> Stream.range(0,1000).takeRight(5).toList
      res0: List[Int] = List(995, 996, 997, 998, 999)
  60. def takeThrough(p: (O) ⇒ Boolean): Stream[Nothing, O]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).takeThrough(p)
    Example:
    1. scala> Stream.range(0,1000).takeThrough(_ != 5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5)
  61. def takeWhile(p: (O) ⇒ Boolean, takeFailure: Boolean = false): Stream[Nothing, O]

    Permalink

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

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

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).takeWhile(p, takeFailure)
    Example:
    1. scala> Stream.range(0,1000).takeWhile(_ != 5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  62. def toString(): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).toString()
    Definition Classes
    Stream → Any
  63. def unNone[O2](implicit ev: <:<[O, Option[O2]]): Stream[Nothing, O2]

    Permalink

    Filters any 'None'.

    Filters any 'None'.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).unNone(ev)
    Example:
    1. scala> Stream(Some(1), Some(2), None, Some(3), None).unNone.toList
      res0: List[Int] = List(1, 2, 3)
  64. def unNoneTerminate[O2](implicit ev: <:<[O, Option[O2]]): Stream[Nothing, O2]

    Permalink

    Halts the input stream at the first None.

    Halts the input stream at the first None.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).unNoneTerminate(ev)
    Example:
    1. scala> Stream(Some(1), Some(2), None, Some(3), None).unNoneTerminate.toList
      res0: List[Int] = List(1, 2)
  65. def unchunk: Stream[Nothing, O]

    Permalink

    Converts the input to a stream of 1-element chunks.

    Converts the input to a stream of 1-element chunks.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).unchunk
    Example:
    1. scala> (Stream(1,2,3) ++ Stream(4,5,6)).unchunk.segments.toList
      res0: List[Segment[Int,Unit]] = List(Chunk(1), Chunk(2), Chunk(3), Chunk(4), Chunk(5), Chunk(6))
  66. def zipWithIndex: Stream[Nothing, (O, Long)]

    Permalink

    Zips the elements of the input stream with its indices, and returns the new stream.

    Zips the elements of the input stream with its indices, and returns the new stream.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).zipWithIndex
    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithIndex.toList
      res0: List[(String,Long)] = List((The,0), (quick,1), (brown,2), (fox,3))
  67. def zipWithNext: Stream[Nothing, (O, Option[O])]

    Permalink

    Zips each element of this stream with the next element wrapped into Some.

    Zips each element of this stream with the next element wrapped into Some. The last element is zipped with None.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).zipWithNext
    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithNext.toList
      res0: List[(String,Option[String])] = List((The,Some(quick)), (quick,Some(brown)), (brown,Some(fox)), (fox,None))
  68. def zipWithPrevious: Stream[Nothing, (Option[O], O)]

    Permalink

    Zips each element of this stream with the previous element wrapped into Some.

    Zips each element of this stream with the previous element wrapped into Some. The first element is zipped with None.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).zipWithPrevious
    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithPrevious.toList
      res0: List[(Option[String],String)] = List((None,The), (Some(The),quick), (Some(quick),brown), (Some(brown),fox))
  69. def zipWithPreviousAndNext: Stream[Nothing, (Option[O], O, Option[O])]

    Permalink

    Zips each element of this stream with its previous and next element wrapped into Some.

    Zips each element of this stream with its previous and next element wrapped into Some. The first element is zipped with None as the previous element, the last element is zipped with None as the next element.

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).zipWithPreviousAndNext
    Example:
    1. scala> Stream("The", "quick", "brown", "fox").zipWithPreviousAndNext.toList
      res0: List[(Option[String],String,Option[String])] = List((None,The,Some(quick)), (Some(The),quick,Some(brown)), (Some(quick),brown,Some(fox)), (Some(brown),fox,None))
  70. def zipWithScan[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[Nothing, (O, O2)]

    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:

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).zipWithScan(z)(f)
    Example:
    1. 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

  71. def zipWithScan1[O2](z: O2)(f: (O2, O) ⇒ O2): Stream[Nothing, (O, O2)]

    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:

    Implicit information
    This member is added by an implicit conversion from Stream[F, O] to Stream[Nothing, O] performed by method covaryPure in fs2.Stream. This conversion will take place only if F is a subclass of Pure (F <: Pure).
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (stream: Stream[Nothing, O]).zipWithScan1(z)(f)
    Example:
    1. scala> Stream("uno", "dos", "tres", "cuatro").zipWithScan1(0)(_ + _.length).toList
      res0: List[(String, Int)] = List((uno,3), (dos,6), (tres,10), (cuatro,16))
    See also

    zipWithScan

Inherited from AnyVal

Inherited from Any

Inherited by implicit conversion covaryPure from Stream[F, O] to Stream[Nothing, O]

Inherited by implicit conversion PureOps from Stream[F, O] to PureOps[O]

Inherited by implicit conversion EmptyOps from Stream[F, O] to EmptyOps

Inherited by implicit conversion any2stringadd from Stream[F, O] to any2stringadd[Stream[F, O]]

Inherited by implicit conversion StringFormat from Stream[F, O] to StringFormat[Stream[F, O]]

Inherited by implicit conversion Ensuring from Stream[F, O] to Ensuring[Stream[F, O]]

Inherited by implicit conversion ArrowAssoc from Stream[F, O] to ArrowAssoc[Stream[F, O]]

Ungrouped