rio-0.0.3.0: A standard library for Haskell

Safe HaskellNone
LanguageHaskell2010

RIO.Prelude.IO

Synopsis

Documentation

withLazyFile :: MonadUnliftIO m => FilePath -> (ByteString -> m a) -> m a Source #

Lazily get the contents of a file. Unlike readFile, this ensures that if an exception is thrown, the file handle is closed immediately.

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

Same as readFile, but generalized to MonadIO

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

Same as writeFile, but generalized to MonadIO

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

Read a file in UTF8 encoding, throwing an exception on invalid character encoding.

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

Write a file in UTF8 encoding