enumerator-0.4.3.1: Implementation of Oleg Kiselyov's left-fold enumeratorsSource codeContentsIndex
Data.Enumerator.IO
Portabilityportable
Maintainerjmillikin@gmail.com
Description
Enumerator-based IO
Synopsis
enumHandle :: MonadIO m => Integer -> Handle -> Enumerator ByteString m b
enumFile :: FilePath -> Enumerator ByteString IO b
iterHandle :: MonadIO m => Handle -> Iteratee ByteString m ()
Documentation
enumHandleSource
:: MonadIO m
=> IntegerBuffer size
-> Handle
-> Enumerator ByteString m b

Read bytes (in chunks of the given buffer size) from the handle, and stream them to an Iteratee. If an exception occurs during file IO, enumeration will stop and Error will be returned. Exceptions from the iteratee are not caught.

This enumerator blocks until at least one byte is available from the handle, and might read less than the maximum buffer size in some cases.

The handle should be opened with no encoding, and in ReadMode or ReadWriteMode.

enumFile :: FilePath -> Enumerator ByteString IO bSource
Opens a file path in binary mode, and passes the handle to enumHandle. The file will be closed when the Iteratee finishes.
iterHandle :: MonadIO m => Handle -> Iteratee ByteString m ()Source

Read bytes from a stream and write them to a handle. If an exception occurs during file IO, enumeration will stop and Error will be returned.

The handle should be opened with no encoding, and in WriteMode or ReadWriteMode.

Produced by Haddock version 2.6.1