module Data.Iteratee.IO(
defaultBufSize,
H.enumHandle,
H.enumHandleRandom,
enumFile,
enumFileRandom,
#if defined(USE_POSIX)
FD.enumFd,
FD.enumFdRandom,
#endif
fileDriver,
fileDriverVBuf,
fileDriverRandom,
fileDriverRandomVBuf,
)
where
import Data.Iteratee.Base.ReadableChunk
import Data.Iteratee.Iteratee
import Data.Iteratee.Binary()
import qualified Data.Iteratee.IO.Handle as H
#if defined(USE_POSIX)
import qualified Data.Iteratee.IO.Fd as FD
#endif
import Control.Monad.Catch
import Control.Monad.IO.Class
#if MIN_VERSION_exceptions(0,6,0)
#else
type MonadMask = MonadCatch
#endif
defaultBufSize :: Int
defaultBufSize = 1024
#if defined(USE_POSIX)
enumFile
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> FilePath
-> Enumerator s m a
enumFile = FD.enumFile
enumFileRandom
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> FilePath
-> Enumerator s m a
enumFileRandom = FD.enumFileRandom
fileDriver
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Iteratee s m a
-> FilePath
-> m a
fileDriver = FD.fileDriverFd defaultBufSize
fileDriverVBuf
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> Iteratee s m a
-> FilePath
-> m a
fileDriverVBuf = FD.fileDriverFd
fileDriverRandom
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Iteratee s m a
-> FilePath
-> m a
fileDriverRandom = FD.fileDriverRandomFd defaultBufSize
fileDriverRandomVBuf
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> Iteratee s m a
-> FilePath
-> m a
fileDriverRandomVBuf = FD.fileDriverRandomFd
#else
fileDriver ::
(MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Iteratee s m a
-> FilePath
-> m a
fileDriver = H.fileDriverHandle defaultBufSize
fileDriverVBuf ::
(MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> Iteratee s m a
-> FilePath
-> m a
fileDriverVBuf = H.fileDriverHandle
fileDriverRandom
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Iteratee s m a
-> FilePath
-> m a
fileDriverRandom = H.fileDriverRandomHandle defaultBufSize
fileDriverRandomVBuf
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> Iteratee s m a
-> FilePath
-> m a
fileDriverRandomVBuf = H.fileDriverRandomHandle
enumFile
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> FilePath
-> Enumerator s m a
enumFile = H.enumFile
enumFileRandom
:: (MonadIO m, MonadMask m, NullPoint s, ReadableChunk s el) =>
Int
-> FilePath
-> Enumerator s m a
enumFileRandom = H.enumFileRandom
#endif