reader package:streamly-core
Unfold standard input into a stream of
Word8.
Unfold an array into a stream.
Unfold an array into a stream.
Unfold an array into a stream.
Unfolds a file handle into a byte stream. IO requests to the device
are performed in sizes of
defaultChunkSize.
>>> reader = Unfold.many Array.reader Handle.chunkReader
Unfolds a file path into a byte stream. IO requests to the device are
performed in sizes of
defaultChunkSize.
Pre-release
Unfold an array into a stream in reverse order.
Unfold an array into a stream in reverse order.
Unfolds the tuple
(bufsize, handle) into a byte stream, read
requests to the IO device are performed using buffers of
bufsize.
>>> readerWith = Unfold.many Array.reader Handle.chunkReaderWith
Unfold an array into a stream, does not check the end of the array,
the user is responsible for terminating the stream within the array
bounds. For high performance application where the end condition can
be determined by a terminating fold.
Written in the hope that it may be faster than "read", however, in the
case for which this was written, "read" proves to be faster even
though the core generated with unsafeRead looks simpler.
Pre-release
Unfolds the tuple (bufsize, filepath) into a byte stream,
read requests to the IO device are performed using buffers of
bufsize.
Pre-release
Unfolds standard input into a stream of
Word8 arrays.
Evaluate the inner monad of a stream as
ReaderT.
Unfolds a handle into a stream of
Word8 arrays. Requests to the
IO device are performed using a buffer of size
defaultChunkSize. The size of arrays in the resulting stream
are therefore less than or equal to
defaultChunkSize.
>>> chunkReader = Unfold.first IO.defaultChunkSize Handle.chunkReaderWith
Unfold the tuple
(bufsize, handle) into a stream of
Word8 arrays. Read requests to the IO device are performed
using a buffer of size
bufsize. The size of an array in the
resulting stream is always less than or equal to
bufsize.
Given a stream of array indices, read the elements on those indices
from the supplied Array. An exception is thrown if an index is out of
bounds.
This is the most general operation. We can implement other operations
in terms of this:
read =
let u = lmap (arr -> (0, length arr - 1)) Unfold.enumerateFromTo
in Unfold.lmap f (indexReader arr)
readRev =
let i = length arr - 1
in Unfold.lmap f (indexReaderFromThenTo i (i - 1) 0)
Pre-release
Unfolds
(from, then, to, array) generating a finite stream
whose first element is the array value from the index
from
and the successive elements are from the indices in increments of
then up to
to. Index enumeration can occur downwards
or upwards depending on whether
then comes before or after
from.
getIndicesFromThenTo =
let f (from, next, to, arr) =
(Stream.enumerateFromThenTo from next to, arr)
in Unfold.lmap f getIndices
Unimplemented
Given an unfold that generates array indices, read the elements on
those indices from the supplied MutArray. An error is thrown if an
index is out of bounds.
Pre-release
Run a stream transformation using a given environment.
Read directories only. Filter out "." and ".." entries.
Internal
Read directories as Left and files as Right. Filter out "." and ".."
entries.
Internal