Companion object for Stream. Provides factory constructors:
- '''Values''':
Stream.succeed, fail, empty, die - '''Collections''': fromChunk, fromIterable, apply(as: A*)
- '''Ranges''': range, fromRange
- '''Generators''': repeat, unfold
- '''Side-effects''': eval, attemptEval, attempt, defer
- '''I/O''': fromInputStream, fromJavaReader
- '''Resources''': fromAcquireRelease, fromResource
- '''Advanced''':
Stream.fromReader, suspend, flattenAll
Attributes
- Companion
- class
- Source
- Stream.scala
- Graph
-
- Supertypes
- Self type
-
Stream.type
Members list
Type members
Classlikes
Variance-safe adapter for tuple-flattening zip composition. Instances are derived from zio.blocks.combinators.Tuples.Tuples.
Variance-safe adapter for tuple-flattening zip composition. Instances are derived from zio.blocks.combinators.Tuples.Tuples.
Attributes
- Companion
- object
- Source
- Stream.scala
- Supertypes
Value members
Concrete methods
Creates a reusable stream from the given elements, preserving argument order.
Creates a reusable stream from the given elements, preserving argument order.
Attributes
- Source
- Stream.scala
Lazily evaluates f once per materialization and emits its result. Non-fatal exceptions become typed errors; fatal throwables remain defects.
Lazily evaluates f once per materialization and emits its result. Non-fatal exceptions become typed errors; fatal throwables remain defects.
Attributes
- Source
- Stream.scala
Lazily evaluates an asynchronous thunk once per materialization and emits its result. Non-fatal synchronous throws and asynchronous failures become typed errors; fatal throwables remain defects.
Lazily evaluates an asynchronous thunk once per materialization and emits its result. Non-fatal synchronous throws and asynchronous failures become typed errors; fatal throwables remain defects.
Attributes
- Source
- Stream.scala
Lazily executes f once per materialization and emits nothing. Non-fatal exceptions become typed errors; fatal throwables remain defects.
Lazily executes f once per materialization and emits nothing. Non-fatal exceptions become typed errors; fatal throwables remain defects.
Attributes
- Source
- Stream.scala
Lazily executes an asynchronous effect once per materialization and emits nothing. Non-fatal synchronous throws and asynchronous failures become typed errors; fatal throwables remain defects.
Lazily executes an asynchronous effect once per materialization and emits nothing. Non-fatal synchronous throws and asynchronous failures become typed errors; fatal throwables remain defects.
Attributes
- Source
- Stream.scala
Lazily constructs body with n as the materialization buffer size for concurrent operators in that region. Nested regions use the innermost size. n must be a positive power of two.
Lazily constructs body with n as the materialization buffer size for concurrent operators in that region. Nested regions use the innermost size. n must be a positive power of two.
Attributes
- Source
- Stream.scala
Creates an empty stream that lazily registers f as a release action. f runs exactly once when each materialization closes, including after failure, early termination, or cancellation; exceptions are defects.
Creates an empty stream that lazily registers f as a release action. f runs exactly once when each materialization closes, including after failure, early termination, or cancellation; exceptions are defects.
Attributes
- Source
- Stream.scala
Creates an empty stream that lazily registers an asynchronous release action. It is awaited exactly once when each materialization closes, including after failure, early termination, or cancellation; failure is a defect.
Creates an empty stream that lazily registers an asynchronous release action. It is awaited exactly once when each materialization closes, including after failure, early termination, or cancellation; failure is a defect.
Attributes
- Source
- Stream.scala
Creates a stream that, when pulled, terminates with t as a defect.
Lazily executes f once per materialization and emits nothing. Any thrown exception is a defect.
Lazily executes f once per materialization and emits nothing. Any thrown exception is a defect.
Attributes
- Source
- Stream.scala
Lazily executes an asynchronous effect once per materialization and emits nothing; synchronous throws and asynchronous failures are defects.
Lazily executes an asynchronous effect once per materialization and emits nothing; synchronous throws and asynchronous failures are defects.
Attributes
- Source
- Stream.scala
Creates a stream that, when pulled, fails in the typed channel with error.
Creates a stream that, when pulled, fails in the typed channel with error.
Attributes
- Source
- Stream.scala
Consumes the inner streams sequentially in outer-stream order, closing each inner stream before advancing to the next.
Consumes the inner streams sequentially in outer-stream order, closing each inner stream before advancing to the next.
Attributes
- Source
- Stream.scala
Lazily acquires one resource per materialization, constructs the stream with use, and releases the resource exactly once after completion, failure, early termination, or cancellation. If omitted, release closes an AutoCloseable and otherwise does nothing. Thrown exceptions are defects; use attempt to model acquisition failures as typed errors.
Lazily acquires one resource per materialization, constructs the stream with use, and releases the resource exactly once after completion, failure, early termination, or cancellation. If omitted, release closes an AutoCloseable and otherwise does nothing. Thrown exceptions are defects; use attempt to model acquisition failures as typed errors.
Attributes
- Source
- Stream.scala
Lazily acquires one resource per materialization, constructs the stream with use, and awaits release exactly once after completion, failure, early termination, or cancellation (including cancellation during acquisition after the resource is obtained). Acquisition, use, and release failures are defects.
Lazily acquires one resource per materialization, constructs the stream with use, and awaits release exactly once after completion, failure, early termination, or cancellation (including cancellation during acquisition after the resource is obtained). Acquisition, use, and release failures are defects.
Attributes
- Source
- Stream.scala
Creates a stream from an array. The array is wrapped via Chunk.fromArray without copying, so later array mutation may be observable.
Creates a stream from an array. The array is wrapped via Chunk.fromArray without copying, so later array mutation may be observable.
Attributes
- Source
- Stream.scala
Creates a reusable, already-materialized stream backed by chunk.
Lazily wraps an already-created java.io.InputStream as bytes. Read failures are typed java.io.IOException values; close failures are defects. The stream is closed after completion, failure, early termination, or cancellation; each materialization reuses the same supplied instance.
Lazily wraps an already-created java.io.InputStream as bytes. Read failures are typed java.io.IOException values; close failures are defects. The stream is closed after completion, failure, early termination, or cancellation; each materialization reuses the same supplied instance.
Attributes
- Source
- Stream.scala
Wraps a java.io.InputStream as a stream of bytes without managing its lifecycle. I/O failures are typed java.io.IOException values. The caller owns closing, and each materialization reuses the supplied instance.
Wraps a java.io.InputStream as a stream of bytes without managing its lifecycle. I/O failures are typed java.io.IOException values. The caller owns closing, and each materialization reuses the supplied instance.
Attributes
- Source
- Stream.scala
Lazily obtains and consumes an iterator from it for each materialization, preserving iteration order. If the iterable has a known size, knownLength is set. Iterator exceptions are defects.
Lazily obtains and consumes an iterator from it for each materialization, preserving iteration order. If the iterable has a known size, knownLength is set. Iterator exceptions are defects.
Attributes
- Source
- Stream.scala
Evaluates it once per materialization and consumes it in order. Supply a fresh iterator for repeatable runs; iterator and thunk exceptions are defects.
Evaluates it once per materialization and consumes it in order. Supply a fresh iterator for repeatable runs; iterator and thunk exceptions are defects.
Attributes
- Source
- Stream.scala
Asynchronously obtains one iterator per materialization and consumes it in order. Acquisition and iterator failures are defects.
Asynchronously obtains one iterator per materialization and consumes it in order. Acquisition and iterator failures are defects.
Attributes
- Source
- Stream.scala
Lazily wraps an already-created java.io.Reader as characters. Read failures are typed java.io.IOException values; close failures are defects. The reader is closed after completion, failure, early termination, or cancellation; each materialization reuses the same supplied instance.
Lazily wraps an already-created java.io.Reader as characters. Read failures are typed java.io.IOException values; close failures are defects. The reader is closed after completion, failure, early termination, or cancellation; each materialization reuses the same supplied instance.
Attributes
- Source
- Stream.scala
Wraps a java.io.Reader as a stream of Chars without managing its lifecycle. I/O failures are typed java.io.IOException values. The caller owns closing, and each materialization reuses the supplied instance.
Wraps a java.io.Reader as a stream of Chars without managing its lifecycle. I/O failures are typed java.io.IOException values. The caller owns closing, and each materialization reuses the supplied instance.
Attributes
- Source
- Stream.scala
Creates a stream of integers from a Scala Range. The knownLength is set from the range size.
Creates a stream of integers from a Scala Range. The knownLength is set from the range size.
Attributes
- Source
- Stream.scala
Lazily obtains one Reader per materialization and closes it when the stream closes. Reader-thunk failures are defects. This advanced overload preserves whether the returned reader is synchronous or asynchronous.
Lazily obtains one Reader per materialization and closes it when the stream closes. Reader-thunk failures are defects. This advanced overload preserves whether the returned reader is synchronous or asynchronous.
Attributes
- Source
- Stream.scala
Lazily obtains one synchronous reader per materialization and closes it when the stream closes. Reader-thunk failures are defects.
Lazily obtains one synchronous reader per materialization and closes it when the stream closes. Reader-thunk failures are defects.
Attributes
- Source
- Stream.scala
Preserves overload resolution for a reader thunk that never returns. Evaluation remains lazy and a thrown exception is a defect.
Preserves overload resolution for a reader thunk that never returns. Evaluation remains lazy and a thrown exception is a defect.
Attributes
- Source
- Stream.scala
Lazily obtains one asynchronous reader per materialization and awaits its close when the stream closes. Reader-thunk failures are defects.
Lazily obtains one asynchronous reader per materialization and awaits its close when the stream closes. Reader-thunk failures are defects.
Attributes
- Source
- Stream.scala
Lazily runs mkReader once per materialization and closes the resulting reader when the stream closes. Effect and thunk failures are defects.
Lazily runs mkReader once per materialization and closes the resulting reader when the stream closes. Effect and thunk failures are defects.
Attributes
- Source
- Stream.scala
Lazily creates a Scope per materialization, acquires resource in it, and closes the scope after completion, failure, early termination, or cancellation. Acquisition and scope-finalization failures are defects.
Lazily creates a Scope per materialization, acquires resource in it, and closes the scope after completion, failure, early termination, or cancellation. Acquisition and scope-finalization failures are defects.
Attributes
- Source
- Stream.scala
Merges up to maxOpen inner streams concurrently into a single output stream. Elements arrive in completion order (unordered with respect to input position). On JVM, each inner stream runs on a virtual thread. On JS, degrades to sequential flatMap. maxOpen must be at least one. Failure or cancellation closes the outer stream and all active inner streams.
Merges up to maxOpen inner streams concurrently into a single output stream. Elements arrive in completion order (unordered with respect to input position). On JVM, each inner stream runs on a virtual thread. On JS, degrades to sequential flatMap. maxOpen must be at least one. Failure or cancellation closes the outer stream and all active inner streams.
Value parameters
- maxOpen
-
maximum number of concurrently active inner streams
- streams
-
a stream of inner streams to merge
Attributes
- Source
- Stream.scala
Creates a stream of integers from from (inclusive) to until (exclusive).
Creates a stream of integers from from (inclusive) to until (exclusive).
Attributes
- Source
- Stream.scala
Creates a lazy infinite stream that repeatedly emits a.
Creates a stream that emits a single Boolean.
Creates a stream that emits a single Byte.
Creates a stream that emits a single Char.
Creates a stream that emits a single Double.
Creates a stream that emits a single Float.
Creates a stream that emits a single Int.
Creates a stream that emits a single Long.
Creates a stream that emits a single Short.
Creates a stream that emits a single element a, then closes.
Defers stream construction until run-time. Useful for recursive streams.
Defers stream construction until run-time. Useful for recursive streams.
Attributes
- Source
- Stream.scala
Lazily unfolds state sequentially, emitting each A and continuing with the paired state until f returns None. Callback exceptions are defects.
Lazily unfolds state sequentially, emitting each A and continuing with the paired state until f returns None. Callback exceptions are defects.
Attributes
- Source
- Stream.scala
Lazily unfolds state sequentially, emitting each A and continuing with the paired state until f returns None. At most one callback is active; callback failure is a defect.
Lazily unfolds state sequentially, emitting each A and continuing with the paired state until f returns None. At most one callback is active; callback failure is a defect.
Attributes
- Source
- Stream.scala
Flattens an asynchronously produced stream. The effect is evaluated lazily for each materialization, and failures in the effect are stream defects.
Flattens an asynchronously produced stream. The effect is evaluated lazily for each materialization, and failures in the effect are stream defects.
Attributes
- Source
- Stream.scala
Flattens an asynchronously produced stream. The effect is evaluated lazily once per materialization; effect failures are defects, while the produced stream retains its typed error channel.
Flattens an asynchronously produced stream. The effect is evaluated lazily once per materialization; effect failures are defects, while the produced stream retains its typed error channel.
Attributes
- Source
- Stream.scala
Concrete fields
The empty stream that emits no elements.