enumerator-0.2: Implementation of Oleg Kiselyov's left-fold enumerators

Portabilityportable
Maintainerjmillikin@gmail.com

Data.Enumerator.Text

Contents

Description

Enumerator-based text IO

Synopsis

Enumerators and iteratees

enumHandle :: Handle -> Enumerator SomeException Text IO 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.

enumFile :: FilePath -> Enumerator SomeException 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 :: Handle -> Iteratee SomeException Text IO ()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.

iterFile :: FilePath -> Iteratee SomeException Text IO ()Source

Opens a file path in text mode, and passes the handle to iterHandle. The file will be closed when the Iteratee finishes.

Codecs

data Codec Source

Instances