Packages

c

fs2.Stream

InvariantOps

final class InvariantOps[F[_], O] extends AnyVal

Provides syntax for streams that are invariant in F and O.

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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to any2stringadd[InvariantOps[F, O]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ++[O2 >: O](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Appends s2 to the end of this stream.

  5. def ->[B](y: B): (InvariantOps[F, O], B)
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to ArrowAssoc[InvariantOps[F, O]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  7. def >>[O2](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Alias for flatMap(_ => s2).

  8. def append[O2 >: O](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Appends s2 to the end of this stream.

    Appends s2 to the end of this stream. Alias for s1 ++ s2.

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def changes(implicit eq: Eq[O]): Stream[F, O]

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

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

    Example:
    1. scala> import cats.implicits._
      scala> Stream(1,1,2,2,2,3,3).changes.toList
      res0: List[Int] = List(1, 2, 3)
  11. def compile: ToEffect[F, O]

    Gets a projection of this stream that allows converting it to an F[..] in a number of ways.

    Gets a projection of this stream that allows converting it to an F[..] in a number of ways.

    Example:
    1. scala> import cats.effect.IO
      scala> val prg: IO[Vector[Int]] = Stream.eval(IO(1)).append(Stream(2,3,4)).compile.toVector
      scala> prg.unsafeRunSync
      res2: Vector[Int] = Vector(1, 2, 3, 4)
  12. def concurrently[O2](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Runs the supplied stream in the background as elements from this stream are pulled.

    Runs the supplied stream in the background as elements from this stream are pulled.

    The resulting stream terminates upon termination of this stream. The background stream will be interrupted at that point. Early termination of that does not terminate the resulting stream.

    Any errors that occur in either this or that stream result in the overall stream terminating with an error.

    Upon finalization, the resulting stream will interrupt the background stream and wait for it to be finalized.

    This method is similar to this mergeHaltL that.drain but ensures the that.drain stream continues to be evaluated regardless of how this is evaluated or how the resulting stream is processed. This method is also similar to Stream(this,that).join(2) but terminates that upon termination of this.

    Example:
    1. scala> import cats.effect.IO, scala.concurrent.ExecutionContext.Implicits.global
      scala> val data: Stream[IO,Int] = Stream.range(1, 10).covary[IO]
      scala> Stream.eval(async.signalOf[IO,Int](0)).flatMap(s => Stream(s).concurrently(data.evalMap(s.set))).flatMap(_.discrete).takeWhile(_ < 9, true).compile.last.unsafeRunSync
      res0: Option[Int] = Some(9)
  13. def covary[F2[x] >: F[x]]: Stream[F2, O]

    Lifts this stream to the specified effect type.

    Lifts this stream to the specified effect type.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream(1, 2, 3).covary[IO]
      res0: Stream[IO,Int] = Stream(..)
  14. def covaryAll[F2[x] >: F[x], O2 >: O]: Stream[F2, O2]

    Lifts this stream to the specified effect and output types.

    Lifts this stream to the specified effect and output types.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.empty.covaryAll[IO,Int]
      res0: Stream[IO,Int] = Stream(..)
  15. def either[O2](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, Either[O, O2]]

    Like merge, but tags each output with the branch it came from.

    Like merge, but tags each output with the branch it came from.

    Example:
    1. scala> import scala.concurrent.duration._, scala.concurrent.ExecutionContext.Implicits.global, cats.effect.IO
      scala> val s = Scheduler[IO](1).flatMap { scheduler =>
           |   val s1 = scheduler.awakeEvery[IO](1000.millis).scan(0)((acc, i) => acc + 1)
           |   s1.either(scheduler.sleep_[IO](500.millis) ++ s1).take(10)
           | }
      scala> s.take(10).compile.toVector.unsafeRunSync
      res0: Vector[Either[Int,Int]] = Vector(Left(0), Right(0), Left(1), Right(1), Left(2), Right(2), Left(3), Right(3), Left(4), Right(4))
  16. def ensuring(cond: (InvariantOps[F, O]) ⇒ Boolean, msg: ⇒ Any): InvariantOps[F, O]
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: (InvariantOps[F, O]) ⇒ Boolean): InvariantOps[F, O]
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean, msg: ⇒ Any): InvariantOps[F, O]
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean): InvariantOps[F, O]
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def evalMap[O2](f: (O) ⇒ F[O2]): Stream[F, O2]

    Alias for flatMap(o => Stream.eval(f(o))).

    Alias for flatMap(o => Stream.eval(f(o))).

    Example:
    1. scala> import cats.effect.IO
      scala> Stream(1,2,3,4).evalMap(i => IO(println(i))).compile.drain.unsafeRunSync
      res0: Unit = ()
  21. def evalMapAccumulate[S, O2](s: S)(f: (S, O) ⇒ F[(S, O2)]): Stream[F, (S, O2)]

    Like Stream#mapAccumulate, but accepts a function returning an F[_].

    Like Stream#mapAccumulate, but accepts a function returning an F[_].

    Example:
    1. scala> import cats.effect.IO
      scala> Stream(1,2,3,4).covary[IO].evalMapAccumulate(0)((acc,i) => IO((i, acc + i))).compile.toVector.unsafeRunSync
      res0: Vector[(Int, Int)] = Vector((1,1), (2,3), (3,5), (4,7))
  22. def evalScan[O2](z: O2)(f: (O2, O) ⇒ F[O2]): Stream[F, O2]

    Like Stream#scan, but accepts a function returning an F[_].

    Like Stream#scan, but accepts a function returning an F[_].

    Example:
    1. scala> import cats.effect.IO
      scala> Stream(1,2,3,4).evalScan(0)((acc,i) => IO(acc + i)).compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 3, 6, 10)
  23. def flatMap[O2](f: (O) ⇒ Stream[F, O2]): Stream[F, O2]

    Creates a stream whose elements are generated by applying f to each output of the source stream and concatenated all of the results.

    Creates a stream whose elements are generated by applying f to each output of the source stream and concatenated all of the results.

    Example:
    1. scala> Stream(1, 2, 3).flatMap { i => Stream.segment(Segment.seq(List.fill(i)(i))) }.toList
      res0: List[Int] = List(1, 2, 2, 3, 3, 3)
  24. def foldMonoid(implicit O: Monoid[O]): Stream[F, O]

    Folds this stream with the monoid for O.

    Folds this stream with the monoid for O.

    Example:
    1. scala> import cats.implicits._
      scala> Stream(1, 2, 3, 4, 5).foldMonoid.toList
      res0: List[Int] = List(15)
  25. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to StringFormat[InvariantOps[F, O]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  26. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  27. def handleErrorWith[O2 >: O](h: (Throwable) ⇒ Stream[F, O2]): Stream[F, O2]

    If this terminates with Stream.raiseError(e), invoke h(e).

    If this terminates with Stream.raiseError(e), invoke h(e).

    Example:
    1. scala> Stream(1, 2, 3).append(Stream.raiseError(new RuntimeException)).handleErrorWith(t => Stream(0)).toList
      res0: List[Int] = List(1, 2, 3, 0)
  28. def interleave(that: Stream[F, O]): Stream[F, O]

    Determinsitically interleaves elements, starting on the left, terminating when the end of either branch is reached naturally.

    Determinsitically interleaves elements, starting on the left, terminating when the end of either branch is reached naturally.

    Example:
    1. scala> Stream(1, 2, 3).interleave(Stream(4, 5, 6, 7)).toList
      res0: List[Int] = List(1, 4, 2, 5, 3, 6)
  29. def interleaveAll(that: Stream[F, O]): Stream[F, O]

    Determinsitically interleaves elements, starting on the left, terminating when the ends of both branches are reached naturally.

    Determinsitically interleaves elements, starting on the left, terminating when the ends of both branches are reached naturally.

    Example:
    1. scala> Stream(1, 2, 3).interleaveAll(Stream(4, 5, 6, 7)).toList
      res0: List[Int] = List(1, 4, 2, 5, 3, 6, 7)
  30. def interruptScope(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Creates a scope that may be interrupted by calling scope#interrupt.

  31. def interruptWhen(haltOnSignal: F[Either[Throwable, Unit]])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Interrupts the stream, when haltOnSignal finishes its evaluation.

  32. def interruptWhen(haltWhenTrue: Signal[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Alias for interruptWhen(haltWhenTrue.discrete).

  33. def interruptWhen(haltWhenTrue: Stream[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Let through the s2 branch as long as the s1 branch is false, listening asynchronously for the left branch to become true.

    Let through the s2 branch as long as the s1 branch is false, listening asynchronously for the left branch to become true. This halts as soon as either branch halts.

    Consider using the overload that takes a Signal.

    Caution: interruption is checked as elements are pulled from the returned stream. As a result, streams which stop pulling from the returned stream end up uninterrubtible. For example, s.interruptWhen(s2).flatMap(_ => infiniteStream) will not be interrupted when s2 is true because s1.interruptWhen(s2) is never pulled for another element after the first element has been emitted. To fix, consider s.flatMap(_ => infiniteStream).interruptWhen(s2).

  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. def join[O2](maxOpen: Int)(implicit ev: <:<[O, Stream[F, O2]], F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Nondeterministically merges a stream of streams (outer) in to a single stream, opening at most maxOpen streams at any point in time.

    Nondeterministically merges a stream of streams (outer) in to a single stream, opening at most maxOpen streams at any point in time.

    The outer stream is evaluated and each resulting inner stream is run concurrently, up to maxOpen stream. Once this limit is reached, evaluation of the outer stream is paused until one or more inner streams finish evaluating.

    When the outer stream stops gracefully, all inner streams continue to run, resulting in a stream that will stop when all inner streams finish their evaluation.

    When the outer stream fails, evaluation of all inner streams is interrupted and the resulting stream will fail with same failure.

    When any of the inner streams fail, then the outer stream and all other inner streams are interrupted, resulting in stream that fails with the error of the stream that caused initial failure.

    Finalizers on each inner stream are run at the end of the inner stream, concurrently with other stream computations.

    Finalizers on the outer stream are run after all inner streams have been pulled from the outer stream but not before all inner streams terminate -- hence finalizers on the outer stream will run AFTER the LAST finalizer on the very last inner stream.

    Finalizers on the returned stream are run after the outer stream has finished and all open inner streams have finished.

    maxOpen

    Maximum number of open inner streams at any time. Must be > 0.

  36. def joinUnbounded[O2](implicit ev: <:<[O, Stream[F, O2]], F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Like join but races all inner streams simultaneously.

  37. def mapAsync[O2](parallelism: Int)(f: (O) ⇒ F[O2])(implicit F: Effect[F], executionContext: ExecutionContext): Stream[F, O2]

    Like Stream#evalMap, but will evaluate effects in parallel, emitting the results downstream in the same order as the input stream.

    Like Stream#evalMap, but will evaluate effects in parallel, emitting the results downstream in the same order as the input stream. The number of concurrent effects is limited by the parallelism parameter.

    See Stream#mapAsyncUnordered if there is no requirement to retain the order of the original stream.

    Example:
    1. scala> import cats.effect.IO, scala.concurrent.ExecutionContext.Implicits.global
      scala> Stream(1,2,3,4).mapAsync(2)(i => IO(println(i))).compile.drain.unsafeRunSync
      res0: Unit = ()
  38. def mapAsyncUnordered[O2](parallelism: Int)(f: (O) ⇒ F[O2])(implicit F: Effect[F], executionContext: ExecutionContext): Stream[F, O2]

    Like Stream#evalMap, but will evaluate effects in parallel, emitting the results downstream.

    Like Stream#evalMap, but will evaluate effects in parallel, emitting the results downstream. The number of concurrent effects is limited by the parallelism parameter.

    See Stream#mapAsync if retaining the original order of the stream is required.

    Example:
    1. scala> import cats.effect.IO, scala.concurrent.ExecutionContext.Implicits.global
      scala> Stream(1,2,3,4).mapAsync(2)(i => IO(println(i))).compile.drain.unsafeRunSync
      res0: Unit = ()
  39. def merge[O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Interleaves the two inputs nondeterministically.

    Interleaves the two inputs nondeterministically. The output stream halts after BOTH s1 and s2 terminate normally, or in the event of an uncaught failure on either s1 or s2. Has the property that merge(Stream.empty, s) == s and merge(raiseError(e), s) will eventually terminate with raiseError(e), possibly after emitting some elements of s first.

    The implementation always tries to pull one chunk from each side before waiting for it to be consumed by resulting stream. As such, there may be up to two chunks (one from each stream) waiting to be processed while the resulting stream is processing elements.

    Also note that if either side produces empty chunk, the processing on that side continues, w/o downstream requiring to consume result.

    If either side does not emit anything (i.e. as result of drain) that side will continue to run even when the resulting stream did not ask for more data.

    Note that even when s1.merge(s2.drain) == s1.concurrently(s2), the concurrently alternative is more efficient.

    Example:
    1. scala> import scala.concurrent.duration._, scala.concurrent.ExecutionContext.Implicits.global, cats.effect.IO
      scala> val s = Scheduler[IO](1).flatMap { scheduler =>
           |   val s1 = scheduler.awakeEvery[IO](500.millis).scan(0)((acc, i) => acc + 1)
           |   s1.merge(scheduler.sleep_[IO](250.millis) ++ s1)
           | }
      scala> s.take(6).compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(0, 0, 1, 1, 2, 2)
  40. def mergeHaltBoth[O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Like merge, but halts as soon as _either_ branch halts.

  41. def mergeHaltL[O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Like merge, but halts as soon as the s1 branch halts.

  42. def mergeHaltR[O2 >: O](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Like merge, but halts as soon as the s2 branch halts.

  43. def observe(sink: Sink[F, O])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Synchronously sends values through sink.

    Synchronously sends values through sink.

    If sink fails, then resulting stream will fail. If sink halts the evaluation will halt too.

    Note that observe will only output full segments of O that are known to be successfully processed by sink. So if Sink terminates/fail in midle of segment processing, the segment will not be available in resulting stream.

    Example:
    1. scala> import scala.concurrent.ExecutionContext.Implicits.global, cats.effect.IO, cats.implicits._
      scala> Stream(1, 2, 3).covary[IO].observe(Sink.showLinesStdOut).map(_ + 1).compile.toVector.unsafeRunSync
      res0: Vector[Int] = Vector(2, 3, 4)
  44. def observe1(f: (O) ⇒ F[Unit])(implicit F: Functor[F]): Stream[F, O]

    Like observe but observes with a function O => F[Unit] instead of a sink.

    Like observe but observes with a function O => F[Unit] instead of a sink. Alias for evalMap(o => f(o).as(o)).

  45. def observeAsync(maxQueued: Int)(sink: Sink[F, O])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Send chunks through sink, allowing up to maxQueued pending _segments_ before blocking s.

  46. def onComplete[O2 >: O](s2: ⇒ Stream[F, O2]): Stream[F, O2]

    Run s2 after this, regardless of errors during this, then reraise any errors encountered during this.

    Run s2 after this, regardless of errors during this, then reraise any errors encountered during this.

    Note: this should *not* be used for resource cleanup! Use bracket or onFinalize instead.

    Example:
    1. scala> Stream(1, 2, 3).onComplete(Stream(4, 5)).toList
      res0: List[Int] = List(1, 2, 3, 4, 5)
  47. def onFinalize(f: F[Unit])(implicit F: Applicative[F]): Stream[F, O]

    Run the supplied effectful action at the end of this stream, regardless of how the stream terminates.

  48. def pauseWhen(pauseWhenTrue: Signal[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Alias for pauseWhen(pauseWhenTrue.discrete).

  49. def pauseWhen(pauseWhenTrue: Stream[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Like interrupt but resumes the stream when left branch goes to true.

  50. def prefetch(implicit ec: ExecutionContext, F: Effect[F]): Stream[F, O]

    Alias for prefetchN(1).

  51. def prefetchN(n: Int)(implicit ec: ExecutionContext, F: Effect[F]): Stream[F, O]

    Behaves like identity, but starts fetches up to n segments in parallel with downstream consumption, enabling processing on either side of the prefetchN to run in parallel.

  52. def pull: ToPull[F, O]

    Gets a projection of this stream that allows converting it to a Pull in a number of ways.

  53. def reduceSemigroup(implicit S: Semigroup[O]): Stream[F, O]

    Reduces this stream with the Semigroup for O.

    Reduces this stream with the Semigroup for O.

    Example:
    1. scala> import cats.implicits._
      scala> Stream("The", "quick", "brown", "fox").intersperse(" ").reduceSemigroup.toList
      res0: List[String] = List(The quick brown fox)
  54. def repartition(f: (O) ⇒ Chunk[O])(implicit S: Semigroup[O]): Stream[F, O]

    Repartitions the input with the function f.

    Repartitions the input with the function f. On each step f is applied to the input and all elements but the last of the resulting sequence are emitted. The last element is then appended to the next input using the Semigroup S.

    Example:
    1. scala> import cats.implicits._
      scala> Stream("Hel", "l", "o Wor", "ld").repartition(s => Chunk.array(s.split(" "))).toList
      res0: List[String] = List(Hello, World)
  55. def repeatPull[O2](using: (ToPull[F, O]) ⇒ Pull[F, O2, Option[Stream[F, O]]]): Stream[F, O2]

    Repeatedly invokes using, running the resultant Pull each time, halting when a pull returns None instead of Some(nextStream).

  56. def scanSegments[S, O2](init: S)(f: (S, Segment[O, Unit]) ⇒ Segment[O2, S]): Stream[F, O2]

    Like scan but f is applied to each segment of the source stream.

    Like scan but f is applied to each segment of the source stream. The resulting segment is emitted and the result of the segment is used in the next invocation of f.

    Many stateful pipes can be implemented efficiently (i.e., supporting fusion) with this method.

  57. def scanSegmentsOpt[S, O2](init: S)(f: (S) ⇒ Option[(Segment[O, Unit]) ⇒ Segment[O2, S]]): Stream[F, O2]

    More general version of scanSegments where the current state (i.e., S) can be inspected to determine if another segment should be pulled or if the stream should terminate.

    More general version of scanSegments where the current state (i.e., S) can be inspected to determine if another segment should be pulled or if the stream should terminate. Termination is signaled by returning None from f. Otherwise, a function which consumes the next segment is returned wrapped in Some.

    Example:
    1. scala> def take[F[_],O](s: Stream[F,O], n: Long): Stream[F,O] =
           |   s.scanSegmentsOpt(n) { n => if (n <= 0) None else Some(_.take(n).mapResult(_.fold(_._2, _ => 0))) }
      scala> take(Stream.range(0,100), 5).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  58. def through[O2](f: Pipe[F, O, O2]): Stream[F, O2]

    Transforms this stream using the given Pipe.

    Transforms this stream using the given Pipe.

    Example:
    1. scala> Stream("Hello", "world").through(text.utf8Encode).toVector.toArray
      res0: Array[Byte] = Array(72, 101, 108, 108, 111, 119, 111, 114, 108, 100)
  59. def through2[O2, O3](s2: Stream[F, O2])(f: Pipe2[F, O, O2, O3]): Stream[F, O3]

    Transforms this stream and s2 using the given Pipe2.

  60. def through2Pure[O2, O3](s2: Stream[F, O2])(f: Pipe2[Pure, O, O2, O3]): Stream[F, O3]

    Transforms this stream and s2 using the given pure Pipe2.

    Transforms this stream and s2 using the given pure Pipe2.

    Sometimes this has better type inference than through2 (e.g., when F is Nothing).

  61. def throughPure[O2](f: Pipe[Pure, O, O2]): Stream[F, O2]

    Transforms this stream using the given pure Pipe.

    Transforms this stream using the given pure Pipe.

    Sometimes this has better type inference than through (e.g., when F is Nothing).

  62. def to(f: Sink[F, O]): Stream[F, Unit]

    Applies the given sink to this stream.

    Applies the given sink to this stream.

    Example:
    1. scala> import cats.effect.IO, cats.implicits._
      scala> Stream(1,2,3).covary[IO].to(Sink.showLinesStdOut).compile.drain.unsafeRunSync
      res0: Unit = ()
  63. def toString(): String
    Definition Classes
    Any
  64. def translate[G[_]](u: ~>[F, G]): Stream[G, O]

    Translates effect type from F to G using the supplied FunctionK.

  65. def zip[O2](that: Stream[F, O2]): Stream[F, (O, O2)]

    Determinsitically zips elements, terminating when the end of either branch is reached naturally.

    Determinsitically zips elements, terminating when the end of either branch is reached naturally.

    Example:
    1. scala> Stream(1, 2, 3).zip(Stream(4, 5, 6, 7)).toList
      res0: List[(Int,Int)] = List((1,4), (2,5), (3,6))
  66. def zipAll[O2](that: Stream[F, O2])(pad1: O, pad2: O2): Stream[F, (O, O2)]

    Determinsitically zips elements, terminating when the ends of both branches are reached naturally, padding the left branch with pad1 and padding the right branch with pad2 as necessary.

    Determinsitically zips elements, terminating when the ends of both branches are reached naturally, padding the left branch with pad1 and padding the right branch with pad2 as necessary.

    Example:
    1. scala> Stream(1,2,3).zipAll(Stream(4,5,6,7))(0,0).toList
      res0: List[(Int,Int)] = List((1,4), (2,5), (3,6), (0,7))
  67. def zipAllWith[O2, O3](that: Stream[F, O2])(pad1: O, pad2: O2)(f: (O, O2) ⇒ O3): Stream[F, O3]

    Determinsitically zips elements with the specified function, terminating when the ends of both branches are reached naturally, padding the left branch with pad1 and padding the right branch with pad2 as necessary.

    Determinsitically zips elements with the specified function, terminating when the ends of both branches are reached naturally, padding the left branch with pad1 and padding the right branch with pad2 as necessary.

    Example:
    1. scala> Stream(1,2,3).zipAllWith(Stream(4,5,6,7))(0, 0)(_ + _).toList
      res0: List[Int] = List(5, 7, 9, 7)
  68. def zipWith[O2, O3](that: Stream[F, O2])(f: (O, O2) ⇒ O3): Stream[F, O3]

    Determinsitically zips elements using the specified function, terminating when the end of either branch is reached naturally.

    Determinsitically zips elements using the specified function, terminating when the end of either branch is reached naturally.

    Example:
    1. scala> Stream(1, 2, 3).zipWith(Stream(4, 5, 6, 7))(_ + _).toList
      res0: List[Int] = List(5, 7, 9)
  69. def [B](y: B): (InvariantOps[F, O], B)
    Implicit
    This member is added by an implicit conversion from InvariantOps[F, O] to ArrowAssoc[InvariantOps[F, O]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def run(implicit F: Sync[F]): F[Unit]

    Deprecated alias for compile.drain.

    Deprecated alias for compile.drain.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.0) Use compile.drain instead

  2. def runFold[B](init: B)(f: (B, O) ⇒ B)(implicit F: Sync[F]): F[B]

    Deprecated alias for compile.fold.

    Deprecated alias for compile.fold.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.0) Use compile.fold instead

  3. def runLast(implicit F: Sync[F]): F[Option[O]]

    Deprecated alias for compile.last.

    Deprecated alias for compile.last.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.0) Use compile.last instead

  4. def runLog(implicit F: Sync[F]): F[Vector[O]]

    Deprecated alias for compile.toVector.

    Deprecated alias for compile.toVector.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.10.0) Use compile.toVector instead

Inherited from AnyVal

Inherited from Any

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

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

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

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

Ungrouped