Packages

object Stream extends StreamLowPriority

Source
Stream.scala
Linear Supertypes
StreamLowPriority, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Stream
  2. StreamLowPriority
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class CompileOps[F[_], G[_], O] extends AnyRef

    Projection of a Stream providing various ways to compile a Stream[F,O] to a G[...].

  2. sealed trait Compiler[F[_], G[_]] extends AnyRef

    Type class which describes compilation of a Stream[F, O] to a G[*].

  3. final class FallibleOps[O] extends AnyVal

    Provides syntax for fallible streams.

  4. final class FallibleTo[O] extends AnyVal

    Provides to syntax for fallible streams.

  5. final class IdOps[O] extends AnyVal

    Provides syntax for pure pipes based on cats.Id.

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

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

  7. implicit final class PipeOps[F[_], I, O] extends AnyVal

    Provides operations on effectful pipes for syntactic convenience.

  8. final class PureOps[O] extends AnyVal

    Provides syntax for pure streams.

  9. implicit final class PurePipe2Ops[I, I2, O] extends AnyVal

    Provides operations on pure pipes for syntactic convenience.

  10. implicit final class PurePipeOps[I, O] extends AnyVal

    Provides operations on pure pipes for syntactic convenience.

  11. final class PureTo[O] extends AnyVal

    Provides to syntax for pure streams.

  12. final class StepLeg[F[_], O] extends AnyRef

    When merging multiple streams, this represents step of one leg.

    When merging multiple streams, this represents step of one leg.

    It is common to uncons, however unlike uncons, it keeps track of stream scope independently of the main scope of the stream.

    This assures, that after each next stepLeg each Stream leg keeps its scope when interpreting.

    Usual scenarios is to first invoke stream.pull.stepLeg and then consume whatever is available in leg.head. If the next step is required leg.stepLeg will yield next Leg.

    Once the stream will stop to be interleaved (merged), then stream allows to return to normal stream invocation.

  13. final class ToPull[F[_], O] extends AnyVal

    Projection of a Stream providing various ways to get a Pull from the Stream.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. implicit def FallibleOps[O](s: Stream[Fallible, O]): FallibleOps[O]

    Provides syntax for streams with effect type Fallible.

  5. implicit def FallibleTo[O](s: Stream[Fallible, O]): FallibleTo[O]

    Provides to syntax for streams with effect type Fallible.

  6. implicit def IdOps[O](s: Stream[Id, O]): IdOps[O]

    Provides syntax for streams with effect type cats.Id.

  7. implicit def InvariantOps[F[_], O](s: Stream[F, O]): InvariantOps[F, O]

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

  8. implicit def PureOps[O](s: Stream[Pure, O]): PureOps[O]

    Provides syntax for pure streams.

  9. implicit def PureTo[O](s: Stream[Pure, O]): PureTo[O]

    Provides to syntax for pure streams.

  10. implicit def alignInstance[F[_]]: Align[[β$10$]Stream[F, β$10$]]

    Align instance for Stream.

    Align instance for Stream. * @example

    scala> import cats.syntax.all._
    scala> Stream(1,2,3).align(Stream("A","B","C","D","E")).toList
    res0: List[cats.data.Ior[Int,String]] = List(Both(1,A), Both(2,B), Both(3,C), Right(D), Right(E))
  11. def apply[F[x] >: Pure[x], O](os: O*): Stream[F, O]

    Creates a pure stream that emits the supplied values.

    Creates a pure stream that emits the supplied values. To convert to an effectful stream, use covary.

  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. def attemptEval[F[x] >: Pure[x], O](fo: F[O]): Stream[F, Either[Throwable, O]]

    Creates a single element stream that gets its value by evaluating the supplied effect.

    Creates a single element stream that gets its value by evaluating the supplied effect. If the effect fails, a Left is emitted. Otherwise, a Right is emitted.

    Use eval instead if a failure while evaluating the effect should fail the stream.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.attemptEval(IO(10)).compile.toVector.unsafeRunSync()
      res0: Vector[Either[Throwable,Int]] = Vector(Right(10))
      scala> Stream.attemptEval(IO(throw new RuntimeException)).compile.toVector.unsafeRunSync()
      res1: Vector[Either[Throwable,Nothing]] = Vector(Left(java.lang.RuntimeException))
  14. def awakeDelay[F[x] >: Pure[x]](d: FiniteDuration)(implicit timer: Timer[F], F: Functor[F]): Stream[F, FiniteDuration]

    Light weight alternative to awakeEvery that sleeps for duration d before each pulled element.

  15. def awakeEvery[F[x] >: Pure[x]](d: FiniteDuration)(implicit timer: Timer[F], F: Functor[F]): Stream[F, FiniteDuration]

    Discrete stream that every d emits elapsed duration since the start time of stream consumption.

    Discrete stream that every d emits elapsed duration since the start time of stream consumption.

    For example: awakeEvery[IO](5 seconds) will return (approximately) 5s, 10s, 15s, and will lie dormant between emitted values.

    d

    FiniteDuration between emits of the resulting stream

  16. def bracket[F[x] >: Pure[x], R](acquire: F[R])(release: (R) => F[Unit]): Stream[F, R]

    Creates a stream that emits a resource allocated by an effect, ensuring the resource is eventually released regardless of how the stream is used.

    Creates a stream that emits a resource allocated by an effect, ensuring the resource is eventually released regardless of how the stream is used.

    A typical use case for bracket is working with files or network sockets. The resource effect opens a file and returns a reference to it. One can then flatMap on the returned Stream to access the file, e.g to read bytes and transform them in to some stream of elements (e.g., bytes, strings, lines, etc.). The release action then closes the file once the result Stream terminates, even in case of interruption or errors.

    acquire

    resource to acquire at start of stream

    release

    function which returns an effect that releases the resource

  17. def bracketCase[F[x] >: Pure[x], R](acquire: F[R])(release: (R, ExitCase[Throwable]) => F[Unit]): Stream[F, R]

    Like bracket but the release action is passed an ExitCase[Throwable].

    Like bracket but the release action is passed an ExitCase[Throwable].

    ExitCase.Canceled is passed to the release action in the event of either stream interruption or overall compiled effect cancelation.

  18. def bracketCaseWeak[F[x] >: Pure[x], R](acquire: F[R])(release: (R, ExitCase[Throwable]) => F[Unit]): Stream[F, R]

    Like bracketCase but no scope is introduced, causing resource finalization to occur at the end of the current scope at the time of acquisition.

  19. def bracketWeak[F[x] >: Pure[x], R](acquire: F[R])(release: (R) => F[Unit]): Stream[F, R]

    Like bracket but no scope is introduced, causing resource finalization to occur at the end of the current scope at the time of acquisition.

  20. def chunk[F[x] >: Pure[x], O](os: Chunk[O]): Stream[F, O]

    Creates a pure stream that emits the elements of the supplied chunk.

    Creates a pure stream that emits the elements of the supplied chunk.

    Example:
    1. scala> Stream.chunk(Chunk(1,2,3)).toList
      res0: List[Int] = List(1, 2, 3)
  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  22. def constant[F[x] >: Pure[x], O](o: O, chunkSize: Int = 256): Stream[F, O]

    Creates an infinite pure stream that always returns the supplied value.

    Creates an infinite pure stream that always returns the supplied value.

    Elements are emitted in finite chunks with chunkSize number of elements.

    Example:
    1. scala> Stream.constant(0).take(5).toList
      res0: List[Int] = List(0, 0, 0, 0, 0)
  23. implicit def deferInstance[F[_]]: Defer[[β$22$]Stream[F, β$22$]]

    Defer instance for Stream

  24. def duration[F[x] >: Pure[x]](implicit F: Sync[F]): Stream[F, FiniteDuration]

    A continuous stream of the elapsed time, computed using System.nanoTime.

    A continuous stream of the elapsed time, computed using System.nanoTime. Note that the actual granularity of these elapsed times depends on the OS, for instance the OS may only update the current time every ten milliseconds or so.

  25. def emit[F[x] >: Pure[x], O](o: O): Stream[F, O]

    Creates a singleton pure stream that emits the supplied value.

    Creates a singleton pure stream that emits the supplied value.

    Example:
    1. scala> Stream.emit(0).toList
      res0: List[Int] = List(0)
  26. def emits[F[x] >: Pure[x], O](os: Seq[O]): Stream[F, O]

    Creates a pure stream that emits the supplied values.

    Creates a pure stream that emits the supplied values.

    Example:
    1. scala> Stream.emits(List(1, 2, 3)).toList
      res0: List[Int] = List(1, 2, 3)
  27. val empty: Stream[Pure, INothing]

    Empty pure stream.

  28. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  30. def eval[F[_], O](fo: F[O]): Stream[F, O]

    Creates a single element stream that gets its value by evaluating the supplied effect.

    Creates a single element stream that gets its value by evaluating the supplied effect. If the effect fails, the returned stream fails.

    Use attemptEval instead if a failure while evaluating the effect should be emitted as a value.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.eval(IO(10)).compile.toVector.unsafeRunSync()
      res0: Vector[Int] = Vector(10)
      scala> Stream.eval(IO(throw new RuntimeException)).covaryOutput[Int].compile.toVector.attempt.unsafeRunSync()
      res1: Either[Throwable,Vector[Int]] = Left(java.lang.RuntimeException)
  31. def evalSeq[F[_], S[A] <: Seq[A], O](fo: F[S[O]]): Stream[F, O]

    Like evals, but lifts any Seq in the effect.

  32. def evalUnChunk[F[_], O](fo: F[Chunk[O]]): Stream[F, O]

    Like eval but resulting chunk is flatten efficiently.

  33. def eval_[F[_], A](fa: F[A]): Stream[F, INothing]

    Creates a stream that evaluates the supplied fa for its effect, discarding the output value.

    Creates a stream that evaluates the supplied fa for its effect, discarding the output value. As a result, the returned stream emits no elements and hence has output type INothing.

    Alias for eval(fa).drain.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.eval_(IO(println("Ran"))).covaryOutput[Int].compile.toVector.unsafeRunSync()
      res0: Vector[Int] = Vector()
  34. def evals[F[_], S[_], O](fo: F[S[O]])(implicit arg0: Foldable[S]): Stream[F, O]

    Like eval, but lifts a foldable structure.

  35. def every[F[x] >: Pure[x]](d: FiniteDuration)(implicit timer: Timer[F]): Stream[F, Boolean]

    A continuous stream which is true after d, 2d, 3d... elapsed duration, and false otherwise.

    A continuous stream which is true after d, 2d, 3d... elapsed duration, and false otherwise. If you'd like a 'discrete' stream that will actually block until d has elapsed, use awakeEvery instead.

  36. def fixedDelay[F[_]](d: FiniteDuration)(implicit timer: Timer[F]): Stream[F, Unit]

    Light weight alternative to fixedRate that sleeps for duration d before each pulled element.

    Light weight alternative to fixedRate that sleeps for duration d before each pulled element.

    Behavior differs from fixedRate because the sleep between elements occurs after the next element is pulled whereas fixedRate accounts for the time it takes to process the emitted unit. This difference can roughly be thought of as the difference between scheduleWithFixedDelay and scheduleAtFixedRate in java.util.concurrent.Scheduler.

    Alias for sleep(d).repeat.

  37. def fixedRate[F[_]](d: FiniteDuration)(implicit timer: Timer[F]): Stream[F, Unit]

    Discrete stream that emits a unit every d.

    Discrete stream that emits a unit every d.

    See fixedDelay for an alternative that sleeps d between elements.

    d

    FiniteDuration between emits of the resulting stream

  38. def foldable[F[x] >: Pure[x], G[_], O](os: G[O])(implicit arg0: Foldable[G]): Stream[F, O]

    Like emits, but works for any G that has a Foldable instance.

  39. def force[F[_], A](f: F[Stream[F, A]]): Stream[F, A]

    Lifts an effect that generates a stream in to a stream.

    Lifts an effect that generates a stream in to a stream. Alias for eval(f).flatMap(_).

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.force(IO(Stream(1,2,3).covary[IO])).compile.toVector.unsafeRunSync()
      res0: Vector[Int] = Vector(1, 2, 3)
  40. def fromBlockingIterator[F[_]]: PartiallyAppliedFromBlockingIterator[F]

    Lifts an iterator into a Stream, shifting any interaction with the iterator to the supplied Blocker.

  41. def fromEither[F[_]]: PartiallyAppliedFromEither[F]

    Lifts an Either[Throwable, A] to an effectful Stream.

    Lifts an Either[Throwable, A] to an effectful Stream.

    Example:
    1. scala> import cats.effect.IO, scala.util.Try
      scala> Stream.fromEither[IO](Right(42)).compile.toList.unsafeRunSync()
      res0: List[Int] = List(42)
      scala> Try(Stream.fromEither[IO](Left(new RuntimeException)).compile.toList.unsafeRunSync())
      res1: Try[List[Nothing]] = Failure(java.lang.RuntimeException)
  42. def fromIterator[F[_]]: PartiallyAppliedFromIterator[F]

    Lifts an iterator into a Stream.

  43. implicit def functionKInstance[F[_]]: ~>[F, [β$18$]Stream[F, β$18$]]

    FunctionK instance for F ~> Stream[F, *]

    FunctionK instance for F ~> Stream[F, *]

    Example:
    1. scala> import cats.Id
      scala> Stream.functionKInstance[Id](42).compile.toList
      res0: cats.Id[List[Int]] = List(42)
  44. implicit def functorFilterInstance[F[_]]: FunctorFilter[[β$14$]Stream[F, β$14$]]

    FunctorFilter instance for Stream.

    FunctorFilter instance for Stream.

    Example:
    1. scala> import cats.syntax.all._, scala.util._
      scala> Stream("1", "2", "NaN").mapFilter(s => Try(s.toInt).toOption).toList
      res0: List[Int] = List(1, 2)
  45. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  46. def getScope[F[x] >: Pure[x]]: Stream[F, Scope[F]]

    Gets the current scope, allowing manual leasing or interruption.

    Gets the current scope, allowing manual leasing or interruption. This is a low-level method and generally should not be used by user code.

  47. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  48. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  49. def iterable[F[x] >: Pure[x], A](os: Iterable[A]): Stream[F, A]

    Like emits, but works for any class that extends Iterable

  50. def iterate[F[x] >: Pure[x], A](start: A)(f: (A) => A): Stream[F, A]

    An infinite Stream that repeatedly applies a given function to a start value.

    An infinite Stream that repeatedly applies a given function to a start value. start is the first value emitted, followed by f(start), then f(f(start)), and so on.

    Example:
    1. scala> Stream.iterate(0)(_ + 1).take(10).toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  51. def iterateEval[F[_], A](start: A)(f: (A) => F[A]): Stream[F, A]

    Like iterate, but takes an effectful function for producing the next state.

    Like iterate, but takes an effectful function for producing the next state. start is the first value emitted.

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.iterateEval(0)(i => IO(i + 1)).take(10).compile.toVector.unsafeRunSync()
      res0: Vector[Int] = Vector(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  52. implicit def monadErrorInstance[F[_]](implicit ev: ApplicativeError[F, Throwable]): MonadError[[β$8$]Stream[F, β$8$], Throwable]

    MonadError instance for Stream.

    MonadError instance for Stream.

    Example:
    1. scala> import cats.syntax.all._
      scala> Stream(1, -2, 3).fproduct(_.abs).toList
      res0: List[(Int, Int)] = List((1,1), (-2,2), (3,3))
  53. implicit def monadInstance[F[_]]: Monad[[β$24$]Stream[F, β$24$]]
    Definition Classes
    StreamLowPriority
  54. implicit def monoidInstance[F[_], O]: Monoid[Stream[F, O]]

    Monoid instance for Stream.

  55. implicit def monoidKInstance[F[_]]: MonoidK[[β$20$]Stream[F, β$20$]]
  56. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  57. def never[F[_]](implicit F: Async[F]): Stream[F, Nothing]

    A stream that never emits and never terminates.

  58. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  59. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  60. def raiseError[F[_]](e: Throwable)(implicit arg0: RaiseThrowable[F]): Stream[F, INothing]

    Creates a stream that, when run, fails with the supplied exception.

    Creates a stream that, when run, fails with the supplied exception.

    The F type must be explicitly provided (e.g., via raiseError[IO] or raiseError[Fallible]).

    Example:
    1. scala> import cats.effect.IO
      scala> Stream.raiseError[Fallible](new RuntimeException).toList
      res0: Either[Throwable,List[INothing]] = Left(java.lang.RuntimeException)
      scala> Stream.raiseError[IO](new RuntimeException).covaryOutput[Int].compile.drain.attempt.unsafeRunSync()
      res0: Either[Throwable,Unit] = Left(java.lang.RuntimeException)
  61. def random[F[_]](implicit F: Sync[F]): Stream[F, Int]

    Creates a random stream of integers using a random seed.

  62. def randomSeeded[F[x] >: Pure[x]](seed: Long): Stream[F, Int]

    Creates a random stream of integers using the supplied seed.

    Creates a random stream of integers using the supplied seed. Returns a pure stream, as the pseudo random number generator is deterministic based on the supplied seed.

  63. def range[F[x] >: Pure[x]](start: Int, stopExclusive: Int, by: Int = 1): Stream[F, Int]

    Lazily produce the range [start, stopExclusive).

    Lazily produce the range [start, stopExclusive). If you want to produce the sequence in one chunk, instead of lazily, use emits(start until stopExclusive).

    Example:
    1. scala> Stream.range(10, 20, 2).toList
      res0: List[Int] = List(10, 12, 14, 16, 18)
  64. def ranges[F[x] >: Pure[x]](start: Int, stopExclusive: Int, size: Int): Stream[F, (Int, Int)]

    Lazily produce a sequence of nonoverlapping ranges, where each range contains size integers, assuming the upper bound is exclusive.

    Lazily produce a sequence of nonoverlapping ranges, where each range contains size integers, assuming the upper bound is exclusive. Example: ranges(0, 1000, 10) results in the pairs (0, 10), (10, 20), (20, 30) ... (990, 1000)

    Note: The last emitted range may be truncated at stopExclusive. For instance, ranges(0,5,4) results in (0,4), (4,5).

    Example:
    1. scala> Stream.ranges(0, 20, 5).toList
      res0: List[(Int,Int)] = List((0,5), (5,10), (10,15), (15,20))
    Exceptions thrown

    IllegalArgumentException if size <= 0

  65. def repeatEval[F[_], O](fo: F[O]): Stream[F, O]

    Alias for eval(fo).repeat.

  66. def resource[F[_], O](r: Resource[F, O]): Stream[F, O]

    Converts the supplied resource in to a singleton stream.

  67. def resourceWeak[F[_], O](r: Resource[F, O]): Stream[F, O]

    Like resource but does not introduce a scope, allowing finalization to occur after subsequent appends or other scope-preserving transformations.

    Like resource but does not introduce a scope, allowing finalization to occur after subsequent appends or other scope-preserving transformations.

    Scopes can be manually introduced via scope if desired.

  68. def retry[F[_], O](fo: F[O], delay: FiniteDuration, nextDelay: (FiniteDuration) => FiniteDuration, maxAttempts: Int, retriable: (Throwable) => Boolean = scala.util.control.NonFatal.apply)(implicit arg0: Timer[F], arg1: RaiseThrowable[F]): Stream[F, O]

    Retries fo on failure, returning a singleton stream with the result of fo as soon as it succeeds.

    Retries fo on failure, returning a singleton stream with the result of fo as soon as it succeeds.

    delay

    Duration of delay before the first retry

    nextDelay

    Applied to the previous delay to compute the next, e.g. to implement exponential backoff

    maxAttempts

    Number of attempts before failing with the latest error, if fo never succeeds

    retriable

    Function to determine whether a failure is retriable or not, defaults to retry every NonFatal. A failed stream is immediately returned when a non-retriable failure is encountered

  69. def sleep[F[_]](d: FiniteDuration)(implicit timer: Timer[F]): Stream[F, Unit]

    A single-element Stream that waits for the duration d before emitting unit.

    A single-element Stream that waits for the duration d before emitting unit. This uses the implicit Timer to avoid blocking a thread.

  70. def sleep_[F[_]](d: FiniteDuration)(implicit timer: Timer[F]): Stream[F, INothing]

    Alias for sleep(d).drain.

    Alias for sleep(d).drain. Often used in conjunction with ++ (i.e., sleep_(..) ++ s) as a more performant version of sleep(..) >> s.

  71. def supervise[F[_], A](fa: F[A])(implicit F: Concurrent[F]): Stream[F, Fiber[F, A]]

    Starts the supplied task and cancels it as finalization of the returned stream.

  72. def suspend[F[_], O](s: => Stream[F, O]): Stream[F, O]

    Returns a stream that evaluates the supplied by-name each time the stream is used, allowing use of a mutable value in stream computations.

    Returns a stream that evaluates the supplied by-name each time the stream is used, allowing use of a mutable value in stream computations.

    Note: it's generally easier to reason about such computations using effectful values. That is, allocate the mutable value in an effect and then use Stream.eval(fa).flatMap { a => ??? }.

    Example:
    1. scala> Stream.suspend {
           |   val digest = java.security.MessageDigest.getInstance("SHA-256")
           |   val bytes: Stream[Pure,Byte] = ???
           |   bytes.chunks.fold(digest) { (d,c) => d.update(c.toBytes.values); d }
           | }
  73. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  74. def toString(): String
    Definition Classes
    AnyRef → Any
  75. def unfold[F[x] >: Pure[x], S, O](s: S)(f: (S) => Option[(O, S)]): Stream[F, O]

    Creates a stream by successively applying f until a None is returned, emitting each output O and using each output S as input to the next invocation of f.

    Creates a stream by successively applying f until a None is returned, emitting each output O and using each output S as input to the next invocation of f.

    Example:
    1. scala> Stream.unfold(0)(i => if (i < 5) Some(i -> (i+1)) else None).toList
      res0: List[Int] = List(0, 1, 2, 3, 4)
  76. def unfoldChunk[F[x] >: Pure[x], S, O](s: S)(f: (S) => Option[(Chunk[O], S)]): Stream[F, O]

    Like unfold but each invocation of f provides a chunk of output.

    Like unfold but each invocation of f provides a chunk of output.

    Example:
    1. scala> Stream.unfoldChunk(0)(i => if (i < 5) Some(Chunk.seq(List.fill(i)(i)) -> (i+1)) else None).toList
      res0: List[Int] = List(1, 2, 2, 3, 3, 3, 4, 4, 4, 4)
  77. def unfoldChunkEval[F[_], S, O](s: S)(f: (S) => F[Option[(Chunk[O], S)]]): Stream[F, O]

    Like unfoldChunk, but takes an effectful function.

  78. def unfoldEval[F[_], S, O](s: S)(f: (S) => F[Option[(O, S)]]): Stream[F, O]

    Like unfold, but takes an effectful function.

  79. def unfoldLoop[F[x] <: Pure[x], S, O](s: S)(f: (S) => (O, Option[S])): Stream[F, O]

    Creates a stream by successively applying f to a S, emitting each output O and using each output S as input to the next invocation of f if it is Some, or terminating on None

    Creates a stream by successively applying f to a S, emitting each output O and using each output S as input to the next invocation of f if it is Some, or terminating on None

    Example:
    1. scala> Stream.unfoldLoop(0)(i => (i, if (i < 5) Some(i+1) else None)).toList
      res0: List[Int] = List(0, 1, 2, 3, 4, 5)
  80. def unfoldLoopEval[F[_], S, O](s: S)(f: (S) => F[(O, Option[S])]): Stream[F, O]

    Like unfoldLoop, but takes an effectful function.

  81. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  82. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  83. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  84. object Compiler extends LowPrioCompiler

Deprecated Value Members

  1. def covaryPurePipe[F[_], I, O](p: Pipe[Pure, I, O]): Pipe[F, I, O]
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.1) This is unsound! See #1838.

  2. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from StreamLowPriority

Inherited from AnyRef

Inherited from Any

Ungrouped