Monadic and General Iteratees: incremental input parsers, processors and transformers
- class StreamChunk c el where
- length :: c el -> Int
- empty :: c el
- null :: c el -> Bool
- cons :: el -> c el -> c el
- head :: c el -> el
- tail :: c el -> c el
- findIndex :: (el -> Bool) -> c el -> Maybe Int
- splitAt :: Int -> c el -> (c el, c el)
- dropWhile :: (el -> Bool) -> c el -> c el
- append :: c el -> c el -> c el
- fromList :: [el] -> c el
- toList :: c el -> [el]
- cMap :: StreamChunk c' el' => (el -> el') -> c el -> c' el'
- class StreamChunk s el => ReadableChunk s el where
- readFromPtr :: Ptr el -> Int -> IO (s el)
Types
class StreamChunk c el whereSource
Class of types that can be used to hold chunks of data within Iteratee streams.
Length of currently available data.
Create an empty chunk of data.
Test if the current stream is null.
cons :: el -> c el -> c elSource
Prepend an element to the front of the data.
Return the first element of the stream.
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.
append :: c el -> c el -> c elSource
Append to chunks of data into one.
fromList :: [el] -> c elSource
Create a stream from a list.
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 => 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.
readFromPtr :: Ptr el -> Int -> IO (s el)Source