Class

fs2.Stream

InvariantOps

Related Doc: package Stream

Permalink

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

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

Source
Stream.scala
Linear Supertypes
AnyVal, Any
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

    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 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]

    Permalink

    Appends s2 to the end of this stream.

  5. def ->[B](y: B): (InvariantOps[F, O], B)

    Permalink
    Implicit information
    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

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

    Permalink

    Alias for flatMap(_ => s2).

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

    Permalink

    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

    Permalink
    Definition Classes
    Any
  10. def changes(implicit eq: Eq[O]): Stream[F, O]

    Permalink

    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 covary[F2[x] >: F[x]]: Stream[F2, O]

    Permalink

    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(..)
  12. def covaryAll[F2[x] >: F[x], O2 >: O]: Stream[F2, O2]

    Permalink

    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(..)
  13. def diamond[B, C, D](f: Pipe[F, O, B])(qs: F[Queue[F, Option[Segment[O, Unit]]]], g: Pipe[F, O, C])(combine: Pipe2[F, B, C, D])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, D]

    Permalink

    Pass elements of s through both f and g, then combine the two resulting streams.

    Pass elements of s through both f and g, then combine the two resulting streams. Implemented by enqueueing elements as they are seen by f onto a Queue used by the g branch. USE EXTREME CARE WHEN USING THIS FUNCTION. Deadlocks are possible if combine pulls from the g branch synchronously before the queue has been populated by the f branch.

    The combine function receives an F[Int] effect which evaluates to the current size of the g-branch's queue.

    When possible, use one of the safe combinators like observe, which are built using this function, in preference to using this function directly.

  14. def either[O2](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, Either[O, O2]]

    Permalink

    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](500.millis).scan(0)((acc, i) => acc + 1)
           |   s1.either(scheduler.sleep_[IO](250.millis) ++ s1).take(10)
           | }
      scala> s.take(10).runLog.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))
  15. def ensuring(cond: (InvariantOps[F, O]) ⇒ Boolean, msg: ⇒ Any): InvariantOps[F, O]

    Permalink
    Implicit information
    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
  16. def ensuring(cond: (InvariantOps[F, O]) ⇒ Boolean): InvariantOps[F, O]

    Permalink
    Implicit information
    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: Boolean, msg: ⇒ Any): InvariantOps[F, O]

    Permalink
    Implicit information
    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): InvariantOps[F, O]

    Permalink
    Implicit information
    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 evalMap[O2](f: (O) ⇒ F[O2]): Stream[F, O2]

    Permalink

    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))).run.unsafeRunSync
      res0: Unit = ()
  20. def evalScan[O2](z: O2)(f: (O2, O) ⇒ F[O2]): Stream[F, O2]

    Permalink

    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)).runLog.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 3, 6, 10)
  21. def flatMap[O2](f: (O) ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink

    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)
  22. def foldMonoid(implicit O: Monoid[O]): Stream[F, O]

    Permalink

    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)
  23. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    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()
  24. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  25. def interleave(that: Stream[F, O]): Stream[F, O]

    Permalink

    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)
  26. def interleaveAll(that: Stream[F, O]): Stream[F, O]

    Permalink

    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)
  27. def interruptWhen(haltWhenTrue: Signal[F, Boolean])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink

    Alias for interruptWhen(haltWhenTrue.discrete).

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

    Permalink

    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.

  29. final def isInstanceOf[T0]: Boolean

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

    Permalink

    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 -- hence, finalizers on the outer stream will likely run BEFORE the LAST finalizer on the 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.

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

    Permalink

    Like join but races all inner streams simultaneously.

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

    Permalink

    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(fail(e), s) will eventually terminate with fail(e), possibly after emitting some elements of s first.

    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).runLog.unsafeRunSync
      res0: Vector[Int] = Vector(0, 0, 1, 1, 2, 2)
  33. def mergeDrainL[O2](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O2]

    Permalink

    Defined as self.drain merge that.

    Defined as self.drain merge that. Runs self and that concurrently, ignoring any output of that.

  34. def mergeDrainR[O2](that: Stream[F, O2])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink

    Defined as self merge that.drain.

    Defined as self merge that.drain. Runs self and that concurrently, ignoring any output of that.

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

    Synchronously sends values through sink.

    Synchronously sends values through sink.

    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).runLog.unsafeRunSync
      res0: Vector[Int] = Vector(2, 3, 4)
  39. def observeAsync(maxQueued: Int)(sink: Sink[F, O])(implicit F: Effect[F], ec: ExecutionContext): Stream[F, O]

    Permalink

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

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

    Permalink

    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)
  41. def onError[O2 >: O](h: (Throwable) ⇒ Stream[F, O2]): Stream[F, O2]

    Permalink

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

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

    Example:
    1. scala> Stream(1, 2, 3).append(Stream.fail(new RuntimeException)).onError(t => Stream(0)).toList
      res0: List[Int] = List(1, 2, 3, 0)
  42. def onFinalize(f: F[Unit])(implicit F: Applicative[F]): Stream[F, O]

    Permalink

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

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

    Permalink

    Alias for pauseWhen(pauseWhenTrue.discrete).

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

    Permalink

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

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

    Permalink

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

  46. def pull: ToPull[F, O]

    Permalink

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

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

    Permalink

    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)
  48. def repeatPull[O2](using: (ToPull[F, O]) ⇒ Pull[F, O2, Option[Stream[F, O]]]): Stream[F, O2]

    Permalink

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

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

    Permalink

    Interprets this stream in to a value of the target effect type F and discards any output values of the stream.

    Interprets this stream in to a value of the target effect type F and discards any output values of the stream.

    To access the output values of the stream, use one of the other methods that start with run -- e.g., runFold, runLog, etc.

    When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.

    To call this method, a Sync[F] instance must be implicitly available.

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

    Permalink

    Interprets this stream in to a value of the target effect type F by folding the output values together, starting with the provided init and combining the current value with each output value.

    Interprets this stream in to a value of the target effect type F by folding the output values together, starting with the provided init and combining the current value with each output value.

    When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.

    To call this method, a Sync[F] instance must be implicitly available.

  51. def runFoldMonoid(implicit F: Sync[F], O: Monoid[O]): F[O]

    Permalink

    Like runFold but uses the implicitly available Monoid[O] to combine elements.

    Like runFold but uses the implicitly available Monoid[O] to combine elements.

    Example:
    1. scala> import cats.implicits._, cats.effect.IO
      scala> Stream(1, 2, 3, 4, 5).covary[IO].runFoldMonoid.unsafeRunSync
      res0: Int = 15
  52. def runFoldSemigroup(implicit F: Sync[F], O: Semigroup[O]): F[Option[O]]

    Permalink

    Like runFold but uses the implicitly available Semigroup[O] to combine elements.

    Like runFold but uses the implicitly available Semigroup[O] to combine elements. If the stream emits no elements, None is returned.

    Example:
    1. scala> import cats.implicits._, cats.effect.IO
      scala> Stream(1, 2, 3, 4, 5).covary[IO].runFoldSemigroup.unsafeRunSync
      res0: Option[Int] = Some(15)
      scala> Stream.empty.covaryAll[IO,Int].runFoldSemigroup.unsafeRunSync
      res1: Option[Int] = None
  53. def runLast(implicit F: Sync[F]): F[Option[O]]

    Permalink

    Interprets this stream in to a value of the target effect type F, returning None if the stream emitted no values and returning the last value emitted wrapped in Some if values were emitted.

    Interprets this stream in to a value of the target effect type F, returning None if the stream emitted no values and returning the last value emitted wrapped in Some if values were emitted.

    When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.

    To call this method, a Sync[F] instance must be implicitly available.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.range(0,100).take(5).covary[IO].runLog.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3, 4)
  54. def runLog(implicit F: Sync[F]): F[Vector[O]]

    Permalink

    Interprets this stream in to a value of the target effect type F by logging the output values to a Vector.

    Interprets this stream in to a value of the target effect type F by logging the output values to a Vector.

    When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.

    To call this method, a Sync[F] instance must be implicitly available.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.range(0,100).take(5).covary[IO].runLog.unsafeRunSync
      res0: Vector[Int] = Vector(0, 1, 2, 3, 4)
  55. def scanSegments[S, O2](init: S)(f: (S, Segment[O, Unit]) ⇒ Segment[O2, S]): Stream[F, O2]

    Permalink

    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.

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

    Permalink

    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)
  57. def through[O2](f: Pipe[F, O, O2]): Stream[F, O2]

    Permalink

    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)
  58. def through2[O2, O3](s2: Stream[F, O2])(f: Pipe2[F, O, O2, O3]): Stream[F, O3]

    Permalink

    Transforms this stream and s2 using the given Pipe2.

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

    Permalink

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

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

    Permalink

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

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

    Permalink

    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).run.unsafeRunSync
      res0: Unit = ()
  62. def toString(): String

    Permalink
    Definition Classes
    Any
  63. def translate[G[_]](u: ~>[F, G])(implicit G: Effect[G]): Stream[G, O]

    Permalink

    Translates effect type from F to G using the supplied FunctionK and using the supplied Effect[G] for any unconsAsync steps encountered.

  64. def translateSync[G[_]](u: ~>[F, G]): Stream[G, O]

    Permalink

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

    Translates effect type from F to G using the supplied FunctionK. If any unconsAsync steps are encountered, an error is raised in the resulting stream. To translate such streams successfully, use translate instead and provide an Effect[G] instance.

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

    Permalink

    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)]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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)

    Permalink
    Implicit information
    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

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