chunked-data-0.3.1: Typeclasses for dealing with various chunked data representations

Safe Haskell | None
Language | Haskell2010

Data.IOData

Synopsis

- class IOData a where
  - readFile :: MonadIO m => FilePath -> m a
  - writeFile :: MonadIO m => FilePath -> a -> m ()
  - getLine :: MonadIO m => m a
  - hGetContents :: MonadIO m => Handle -> m a
  - hGetLine :: MonadIO m => Handle -> m a
  - hPut :: MonadIO m => Handle -> a -> m ()
  - hPutStrLn :: MonadIO m => Handle -> a -> m ()
  - hGetChunk :: MonadIO m => Handle -> m a

# Documentation

class IOData a where Source #

Data which can be read to and from files and handles.

Note that, for lazy sequences, these operations may perform lazy I/O.

Methods

readFile :: MonadIO m => FilePath -> m a Source #

writeFile :: MonadIO m => FilePath -> a -> m () Source #

getLine :: MonadIO m => m a Source #

hGetContents :: MonadIO m => Handle -> m a Source #

hGetLine :: MonadIO m => Handle -> m a Source #

hPut :: MonadIO m => Handle -> a -> m () Source #

hPutStrLn :: MonadIO m => Handle -> a -> m () Source #

hGetChunk :: MonadIO m => Handle -> m a Source #

#### Instances

Instances details

IOData ByteString Source # |

Instance details

Defined in Data.IOData

Methods

readFile :: MonadIO m => FilePath -> m ByteString Source #

writeFile :: MonadIO m => FilePath -> ByteString -> m () Source #

getLine :: MonadIO m => m ByteString Source #

hGetContents :: MonadIO m => Handle -> m ByteString Source #

hGetLine :: MonadIO m => Handle -> m ByteString Source #

hPut :: MonadIO m => Handle -> ByteString -> m () Source #

hPutStrLn :: MonadIO m => Handle -> ByteString -> m () Source #

hGetChunk :: MonadIO m => Handle -> m ByteString Source #

IOData ByteString Source # |

Instance details

Defined in Data.IOData

Methods

readFile :: MonadIO m => FilePath -> m ByteString Source #

writeFile :: MonadIO m => FilePath -> ByteString -> m () Source #

getLine :: MonadIO m => m ByteString Source #

hGetContents :: MonadIO m => Handle -> m ByteString Source #

hGetLine :: MonadIO m => Handle -> m ByteString Source #

hPut :: MonadIO m => Handle -> ByteString -> m () Source #

hPutStrLn :: MonadIO m => Handle -> ByteString -> m () Source #

hGetChunk :: MonadIO m => Handle -> m ByteString Source #

IOData Text Source # |

Instance details

Defined in Data.IOData

Methods

readFile :: MonadIO m => FilePath -> m Text Source #

writeFile :: MonadIO m => FilePath -> Text -> m () Source #

getLine :: MonadIO m => m Text Source #

hGetContents :: MonadIO m => Handle -> m Text Source #

hGetLine :: MonadIO m => Handle -> m Text Source #

hPut :: MonadIO m => Handle -> Text -> m () Source #

hPutStrLn :: MonadIO m => Handle -> Text -> m () Source #

hGetChunk :: MonadIO m => Handle -> m Text Source #

IOData Text Source # |

Instance details

Defined in Data.IOData

Methods

readFile :: MonadIO m => FilePath -> m Text Source #

writeFile :: MonadIO m => FilePath -> Text -> m () Source #

getLine :: MonadIO m => m Text Source #

hGetContents :: MonadIO m => Handle -> m Text Source #

hGetLine :: MonadIO m => Handle -> m Text Source #

hPut :: MonadIO m => Handle -> Text -> m () Source #

hPutStrLn :: MonadIO m => Handle -> Text -> m () Source #

hGetChunk :: MonadIO m => Handle -> m Text Source #

Char ~ c => IOData [c] Source # |

Instance details

Defined in Data.IOData

Methods

readFile :: MonadIO m => FilePath -> m [c] Source #

writeFile :: MonadIO m => FilePath -> [c] -> m () Source #

getLine :: MonadIO m => m [c] Source #

hGetContents :: MonadIO m => Handle -> m [c] Source #

hGetLine :: MonadIO m => Handle -> m [c] Source #

hPut :: MonadIO m => Handle -> [c] -> m () Source #

hPutStrLn :: MonadIO m => Handle -> [c] -> m () Source #

hGetChunk :: MonadIO m => Handle -> m [c] Source #