Copyright | (c) 2018 Composewell Technologies |
---|---|
License | BSD-3-Clause |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- read :: MonadIO m => Unfold m () Word8
- getBytes :: MonadIO m => SerialT m Word8
- getChars :: MonadIO m => SerialT m Char
- readChunks :: MonadIO m => Unfold m () (Array Word8)
- getChunks :: MonadIO m => SerialT m (Array Word8)
- write :: MonadIO m => Fold m Word8 ()
- writeErr :: MonadIO m => Fold m Word8 ()
- putBytes :: MonadIO m => SerialT m Word8 -> m ()
- putChars :: MonadIO m => SerialT m Char -> m ()
- writeChunks :: MonadIO m => Fold m (Array Word8) ()
- writeErrChunks :: MonadIO m => Fold m (Array Word8) ()
- putChunks :: MonadIO m => SerialT m (Array Word8) -> m ()
- putStringsWith :: MonadIO m => (SerialT m Char -> SerialT m Word8) -> SerialT m String -> m ()
- putStrings :: MonadIO m => SerialT m String -> m ()
- putStringsLn :: MonadIO m => SerialT m String -> m ()
Read
read :: MonadIO m => Unfold m () Word8 Source #
Unfold standard input into a stream of Word8
.
Since: 0.8.0
getBytes :: MonadIO m => SerialT m Word8 Source #
Read a byte stream from standard input.
getBytes = Handle.toBytes stdin getBytes = Stream.unfold Stdio.read ()
Pre-release
getChars :: MonadIO m => SerialT m Char Source #
Read a character stream from Utf8 encoded standard input.
getChars = Unicode.decodeUtf8 Stdio.getBytes
Pre-release
readChunks :: MonadIO m => Unfold m () (Array Word8) Source #
Unfolds standard input into a stream of Word8
arrays.
Since: 0.8.0
getChunks :: MonadIO m => SerialT m (Array Word8) Source #
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
.
getChunks = Handle.toChunks stdin getChunks = Stream.unfold Stdio.readChunks ()
Pre-release
Write
write :: MonadIO m => Fold m Word8 () Source #
Fold a stream of Word8
to standard output.
Since: 0.8.0
writeErr :: MonadIO m => Fold m Word8 () Source #
Fold a stream of Word8
to standard error.
Since: 0.8.0
putBytes :: MonadIO m => SerialT m Word8 -> m () Source #
Write a stream of bytes to standard output.
putBytes = Handle.putBytes stdout putBytes = Stream.fold Stdio.write
Pre-release
putChars :: MonadIO m => SerialT m Char -> m () Source #
Encode a character stream to Utf8 and write it to standard output.
putChars = Stdio.putBytes . Unicode.encodeUtf8
Pre-release
writeChunks :: MonadIO m => Fold m (Array Word8) () Source #
Fold a stream of Array Word8
to standard output.
Since: 0.8.0
writeErrChunks :: MonadIO m => Fold m (Array Word8) () Source #
Fold a stream of Array Word8
to standard error.
Since: 0.8.0
putChunks :: MonadIO m => SerialT m (Array Word8) -> m () Source #
Write a stream of chunks to standard output.
putChunks = Handle.putChunks stdout putChunks = Stream.fold Stdio.writeChunks
Pre-release
putStringsWith :: MonadIO m => (SerialT m Char -> SerialT m Word8) -> SerialT m String -> m () Source #
Write a stream of strings to standard output using the supplied encoding. Output is flushed to the device for each string.
Pre-release
putStrings :: MonadIO m => SerialT m String -> m () Source #
Write a stream of strings to standard output using UTF8 encoding. Output is flushed to the device for each string.
Pre-release
putStringsLn :: MonadIO m => SerialT m String -> m () Source #
Like putStrings
but adds a newline at the end of each string.
XXX This is not portable, on Windows we need to use "rn" instead.
Pre-release