iteratee-0.8.9.4: Iteratee-based I/O

Safe Haskell | None

Data.Iteratee.IO

Contents

- Data
- File enumerators
  - Handle-based enumerators
  - FileDescriptor based enumerators
- Iteratee drivers

Description

Random and Binary IO with generic Iteratees.

Synopsis

- defaultBufSize :: Int
- enumHandle :: forall s el m a. (NullPoint s, ReadableChunk s el, MonadCatchIO m) => Int -> Handle -> Enumerator s m a
- enumHandleRandom :: forall s el m a. (NullPoint s, ReadableChunk s el, MonadCatchIO m) => Int -> Handle -> Enumerator s m a
- enumFile :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> FilePath -> Enumerator s m a
- enumFileRandom :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> FilePath -> Enumerator s m a
- enumFd :: forall s el m a. (NullPoint s, ReadableChunk s el, MonadCatchIO m) => Int -> Fd -> Enumerator s m a
- enumFdRandom :: forall s el m a. (NullPoint s, ReadableChunk s el, MonadCatchIO m) => Int -> Fd -> Enumerator s m a
- fileDriver :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Iteratee s m a -> FilePath -> m a
- fileDriverVBuf :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> Iteratee s m a -> FilePath -> m a
- fileDriverRandom :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Iteratee s m a -> FilePath -> m a
- fileDriverRandomVBuf :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> Iteratee s m a -> FilePath -> m a

# Data

defaultBufSize :: Int

The default buffer size.

# File enumerators

## Handle-based enumerators

enumHandle

Arguments

:: forall s el m a . (NullPoint s, ReadableChunk s el, MonadCatchIO m) |
=> Int | Buffer size (number of elements per read)
-> Handle |
-> Enumerator s 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.

enumHandleRandom

Arguments

:: forall s el m a . (NullPoint s, ReadableChunk s el, MonadCatchIO m) |
=> Int | Buffer size (number of elements per read)
-> Handle |
-> Enumerator s 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.

enumFile :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> FilePath -> Enumerator s m a

enumFileRandom :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> FilePath -> Enumerator s m a

## FileDescriptor based enumerators

enumFd :: forall s el m a. (NullPoint s, ReadableChunk s el, MonadCatchIO m) => Int -> Fd -> Enumerator s m a

The enumerator of a POSIX File Descriptor. This version enumerates over the entire contents of a file, in order, unless stopped by the iteratee. In particular, seeking is not supported.

enumFdRandom :: forall s el m a. (NullPoint s, ReadableChunk s el, MonadCatchIO m) => Int -> Fd -> Enumerator s m a

The enumerator of a POSIX File Descriptor: a variation of `enumFd` that supports RandomIO (seek requests).

# Iteratee drivers

fileDriver :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Iteratee s m a -> FilePath -> m a

Process a file using the given Iteratee. This function wraps enumFd as a convenience.

fileDriverVBuf :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> Iteratee s m a -> FilePath -> m a

A version of fileDriver with a user-specified buffer size (in elements).

fileDriverRandom :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Iteratee s m a -> FilePath -> m a

Process a file using the given Iteratee. This function wraps enumFdRandom as a convenience.

fileDriverRandomVBuf :: (MonadCatchIO m, NullPoint s, ReadableChunk s el) => Int -> Iteratee s m a -> FilePath -> m a