Safe Haskell | None |
---|---|
Language | Haskell2010 |
Random and Binary IO with generic Iteratees. These functions use Handles for IO operations, and are provided for compatibility. When available, the File Descriptor based functions are preferred as these wastefully allocate memory rather than running in constant space.
- enumHandle :: (MonadIO m, MonadMask m) => Int -> Handle -> Enumerator Bytes m a
- enumHandleCatch :: forall e m a. (IException e, MonadIO m, MonadMask m) => Int -> Handle -> (e -> m (Maybe EnumException)) -> Enumerator Bytes m a
- enumHandleRandom :: forall m a. (MonadIO m, MonadMask m) => Int -> Handle -> Enumerator Bytes m a
- enumFile :: (MonadIO m, MonadMask m) => Int -> FilePath -> Enumerator Bytes m a
- enumFileRandom :: (MonadIO m, MonadMask m) => Int -> FilePath -> Enumerator Bytes m a
- fileDriverHandle :: (MonadIO m, MonadMask m) => Int -> Iteratee Bytes m a -> FilePath -> m a
- fileDriverRandomHandle :: (MonadIO m, MonadMask m) => Int -> Iteratee Bytes m a -> FilePath -> m a
File enumerators
:: (MonadIO m, MonadMask m) | |
=> Int | Buffer size (number of elements per read) |
-> Handle | |
-> Enumerator Bytes m a |
The (monadic) enumerator of a file Handle. This version enumerates over the entire contents of a file, in order, unless stopped by the iteratee. In particular, seeking is not supported. Data is read into a buffer of the specified size.
:: (IException e, MonadIO m, MonadMask m) | |
=> Int | Buffer size (number of elements per read) |
-> Handle | |
-> (e -> m (Maybe EnumException)) | |
-> Enumerator Bytes m a |
An enumerator of a file handle that catches exceptions raised by the Iteratee.
:: (MonadIO m, MonadMask m) | |
=> Int | Buffer size (number of elements per read) |
-> Handle | |
-> Enumerator Bytes m a |
The enumerator of a Handle: a variation of enumHandle that supports RandomIO (seek requests). Data is read into a buffer of the specified size.