Read a byte stream from standard input.
read = Handle.read stdin
read = Stream.unfold Stdio.reader ()Pre-release
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11
Modulestreamly-core-0.3.1Haskell2010
Combinators to work with standard input, output, and error streams. This module supports reading and writing binary data or UTF-8 encoded text only. However, it is possible to use specific encoders and decoders to implement other encodings.
These streaming APIs use the stdin and stdout handles for reading from and writing to the console. The reads and writes are buffered, meaning each stream has its own buffer. Be cautious when switching between these APIs and handle-based APIs (e.g., readChars, getLine), between different stream APIs (e.g., readChars, readChunks), or even between different calls to the same API (e.g., readChars, readChars). If you switch from one stream to another, you should drain the first stream completely if you care about preserving any buffered data.
See also: Streamly.Internal.Console.Stdio
Read a byte stream from standard input.
read = Handle.read stdin
read = Stream.unfold Stdio.reader ()Pre-release
Read a character stream from Utf8 encoded standard input.
readChars = Unicode.decodeUtf8 Stdio.readPre-release
Read a stream of chunks from standard input. The maximum size of a single
chunk is limited to defaultChunkSize. The actual size read may be less
than defaultChunkSize.
readChunks = Handle.readChunks stdin
readChunks = Stream.unfold Stdio.chunkReader ()Pre-release
Write a stream of chunks to standard output.
putChunks = Handle.putChunks stdout
putChunks = Stream.fold Stdio.writeChunksPre-release
Unfold standard input into a stream of Word8.
Unfolds standard input into a stream of Word8 arrays.
Fold a stream of Word8 to standard output.
Fold a stream of Array Word8 to standard output.
Fold a stream of Word8 to standard error.
Fold a stream of Array Word8 to standard error.