ToPull
Projection of a Stream
providing various ways to get a Pull
from the Stream
.
Value members
Concrete methods
Drops the first n
elements of this Stream
, and returns the new Stream
.
Drops the first n
elements of this Stream
, and returns the new Stream
.
Drops elements of the this stream until the predicate p
fails, and returns the new stream.
If defined, the first element of the returned stream will fail p
.
Drops elements of the this stream until the predicate p
fails, and returns the new stream.
If defined, the first element of the returned stream will fail p
.
Writes all inputs to the output of the returned Pull
.
Writes all inputs to the output of the returned Pull
.
Reads a single element from the input and emits it to the output.
Reads a single element from the input and emits it to the output.
Reads the next available chunk from the input and emits it to the output.
Reads the next available chunk from the input and emits it to the output.
Like [[unconsN]]
, but leaves the buffered input unconsumed.
Like [[unconsN]]
, but leaves the buffered input unconsumed.
Awaits the next available element where the predicate returns true.
Awaits the next available element where the predicate returns true.
Folds all inputs using an initial value z
and supplied binary operator, and writes the final
result to the output of the supplied Pull
when the stream has no more values.
Folds all inputs using an initial value z
and supplied binary operator, and writes the final
result to the output of the supplied Pull
when the stream has no more values.
Folds all inputs using the supplied binary operator, and writes the final result to the output of
the supplied Pull
when the stream has no more values.
Folds all inputs using the supplied binary operator, and writes the final result to the output of
the supplied Pull
when the stream has no more values.
Writes a single true
value if all input matches the predicate, false
otherwise.
Writes a single true
value if all input matches the predicate, false
otherwise.
Takes the first value output by this stream and returns it in the result of a pull.
If no value is output before the stream terminates, the pull is failed with a NoSuchElementException
.
If more than 1 value is output, everything beyond the first is ignored.
Takes the first value output by this stream and returns it in the result of a pull.
If no value is output before the stream terminates, the pull is failed with a NoSuchElementException
.
If more than 1 value is output, everything beyond the first is ignored.
Returns the last element of the input, if non-empty.
Returns the last element of the input, if non-empty.
Returns the last element of the input, if non-empty, otherwise fails the pull with a NoSuchElementException
.
Returns the last element of the input, if non-empty, otherwise fails the pull with a NoSuchElementException
.
Like scan
but f
is applied to each chunk of the source stream.
The resulting chunk is emitted and the result of the chunk is used in the
next invocation of f
. The final state value is returned as the result of the pull.
Like scan
but f
is applied to each chunk of the source stream.
The resulting chunk is emitted and the result of the chunk is used in the
next invocation of f
. The final state value is returned as the result of the pull.
More general version of scanChunks
where the current state (i.e., S
) can be inspected
to determine if another chunk should be pulled or if the pull should terminate.
Termination is signaled by returning None
from f
. Otherwise, a function which consumes
the next chunk is returned wrapped in Some
. The final state value is returned as the
result of the pull.
More general version of scanChunks
where the current state (i.e., S
) can be inspected
to determine if another chunk should be pulled or if the pull should terminate.
Termination is signaled by returning None
from f
. Otherwise, a function which consumes
the next chunk is returned wrapped in Some
. The final state value is returned as the
result of the pull.
Like uncons
, but instead of performing normal uncons
, this will
run the stream up to the first chunk available.
Useful when zipping multiple streams (legs) into one stream.
Assures that scopes are correctly held for each stream leg
independently of scopes from other legs.
Like uncons
, but instead of performing normal uncons
, this will
run the stream up to the first chunk available.
Useful when zipping multiple streams (legs) into one stream.
Assures that scopes are correctly held for each stream leg
independently of scopes from other legs.
If you are not pulling from multiple streams, consider using uncons
.
Emits the elements of the stream until the predicate p
fails,
and returns the remaining Stream
. If non-empty, the returned stream will have
a first element i
for which p(i)
is false
.
Emits the elements of the stream until the predicate p
fails,
and returns the remaining Stream
. If non-empty, the returned stream will have
a first element i
for which p(i)
is false
.
Waits for a chunk of elements to be available in the source stream.
The chunk of elements along with a new stream are provided as the resource of the returned pull.
The new stream can be used for subsequent operations, like awaiting again.
A None
is returned as the resource of the pull upon reaching the end of the stream.
Waits for a chunk of elements to be available in the source stream.
The chunk of elements along with a new stream are provided as the resource of the returned pull.
The new stream can be used for subsequent operations, like awaiting again.
A None
is returned as the resource of the pull upon reaching the end of the stream.