iteratee-0.3.4: Iteratee-based I/O




Monadic and General Iteratees: incremental input parsers, processors and transformers



class ListLike (c el) el => StreamChunk c el whereSource

Class of types that can be used to hold chunks of data within Iteratee streams.


length :: c el -> IntSource

Length of currently available data.

null :: c el -> BoolSource

Test if the current stream is null.

cons :: el -> c el -> c elSource

Prepend an element to the front of the data.

head :: c el -> elSource

Return the first element of the stream.

tail :: c el -> c elSource

Return the tail of the stream.

findIndex :: (el -> Bool) -> c el -> Maybe IntSource

First index matching the predicate.

splitAt :: Int -> c el -> (c el, c el)Source

Split the data at the specified index.

dropWhile :: (el -> Bool) -> c el -> c elSource

Drop data matching the predicate.

fromList :: [el] -> c elSource

Create a stream from a list.

toList :: c el -> [el]Source

Create a list from the stream.

cMap :: StreamChunk c el' => (el -> el') -> c el -> c el'Source

Map a computation over the stream.

class (StreamChunk s el, Storable el) => ReadableChunk s el whereSource

Class of streams which can be filled from a Ptr. Typically these are streams which can be read from a file. The Int parameter is the length of the data in bytes. N.B. The pointer must not be returned or used after readFromPtr completes.


readFromPtr :: Ptr el -> Int -> IO (s el)Source