iteratee-0.8.7.2: Iteratee-based I/O

Data.Iteratee.Char

Contents

Description

Utilities for Char-based iteratee processing.

Synopsis

Word and Line processors

printLines :: Iteratee String IO ()Source

Print lines as they are received. This is the first impure iteratee with non-trivial actions during chunk processing

Only lines ending with a newline are printed, data terminated with EOF is not printed.

printLinesUnterminated :: forall s el. (Eq el, Nullable s, StringLike s, ListLike s el) => Iteratee s IO ()Source

Print lines as they are received.

All lines are printed, including a line with a terminating EOF. If the final line is terminated by EOF without a newline, no newline is printed. this function should be used in preference to printLines when possible, as it is more efficient with long lines.

enumLines :: (ListLike s el, StringLike s, Nullable s, Monad m) => Enumeratee s [s] m aSource

Convert the stream of characters to the stream of lines, and apply the given iteratee to enumerate the latter. The stream of lines is normally terminated by the empty line. When the stream of characters is terminated, the stream of lines is also terminated. This is the first proper iteratee-enumerator: it is the iteratee of the character stream and the enumerator of the line stream.

enumWords :: (ListLike s Char, Nullable s, Monad m) => Enumeratee s [s] m aSource

Convert the stream of characters to the stream of words, and apply the given iteratee to enumerate the latter. Words are delimited by white space. This is the analogue of List.words