enumerator-0.4.3.1: Implementation of Oleg Kiselyov's left-fold enumeratorsSource codeContentsIndex
Data.Enumerator.Text
Portabilityportable
Maintainerjmillikin@gmail.com
Contents
Enumerators and iteratees
Codecs
Description
Enumerator-based text IO
Synopsis
enumHandle :: MonadIO m => Handle -> Enumerator Text m b
enumFile :: FilePath -> Enumerator Text IO b
iterHandle :: MonadIO m => Handle -> Iteratee Text m ()
data Codec
encode :: Monad m => Codec -> Enumeratee Text ByteString m b
decode :: Monad m => Codec -> Enumeratee ByteString Text m b
utf8 :: Codec
utf16_le :: Codec
utf16_be :: Codec
utf32_le :: Codec
utf32_be :: Codec
ascii :: Codec
iso8859_1 :: Codec
Enumerators and iteratees
enumHandle :: MonadIO m => Handle -> Enumerator Text m bSource

Read lines of text from the handle, and stream them to an Iteratee. If an exception occurs during file IO, enumeration will stop and Error will be returned. Exceptions from the iteratee are not caught.

The handle should be opened with an appropriate text encoding, and in ReadMode or ReadWriteMode.

enumFile :: FilePath -> Enumerator Text IO bSource
Opens a file path in text mode, and passes the handle to enumHandle. The file will be closed when the Iteratee finishes.
iterHandle :: MonadIO m => Handle -> Iteratee Text m ()Source

Read text from a stream and write it to a handle. If an exception occurs during file IO, enumeration will stop and Error will be returned.

The handle should be opened with an appropriate text encoding, and in WriteMode or ReadWriteMode.

Codecs
data Codec Source
show/hide Instances
encode :: Monad m => Codec -> Enumeratee Text ByteString m bSource
decode :: Monad m => Codec -> Enumeratee ByteString Text m bSource
utf8 :: CodecSource
utf16_le :: CodecSource
utf16_be :: CodecSource
utf32_le :: CodecSource
utf32_be :: CodecSource
ascii :: CodecSource
iso8859_1 :: CodecSource
Produced by Haddock version 2.6.0