System.IO.Streams.Text

io-streams-1.5.2.2: Simple, composable, and easy-to-use stream I/O

Safe Haskell | None
Language | Haskell2010

System.IO.Streams.Text

Contents

- Decoders and Encoders

Description

Stream primitives for decoding and encoding `Text` values in UTF-8 format.

Synopsis

- decodeUtf8 :: InputStream ByteString -> IO (InputStream Text)
- decodeUtf8With :: OnDecodeError -> InputStream ByteString -> IO (InputStream Text)
- encodeUtf8 :: OutputStream ByteString -> IO (OutputStream Text)

# Decoders and Encoders

decodeUtf8 :: InputStream ByteString -> IO (InputStream Text) #

Decode an `InputStream` of `ByteString`s in UTF-8 format into an `InputStream` of `Text` values. If decoding fails, will throw an exception. See `Data.Text.Encoding.`decodeUtf8``.

decodeUtf8With :: OnDecodeError -> InputStream ByteString -> IO (InputStream Text) #

Decode an `InputStream` of `ByteString`s in UTF-8 format into an `InputStream` of `Text` values. If decoding fails, invokes the given `OnDecodeError` function to decide what to do. See `Data.Text.Encoding.`decodeUtf8With``.

encodeUtf8 :: OutputStream ByteString -> IO (OutputStream Text) #

Convert an `OutputStream` taking `ByteString`s to an `OutputStream` that takes `Text`, encoding the data as UTF-8. See `Data.Text.Encoding.`encodeUtf8``.