relude-0.5.0: Custom prelude from Kowainik

Copyright(c) 2018-2019 Kowainik
LicenseMIT
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Relude.File

Contents

Description

Lifted to MonadIO families of file processing functions for Text, LText, ByteString and LByteString types.

NOTE: These functions are for working with textual data. Functions that work with Text or LText types are system and locale-sensitive (encoding, line-endings). If you want binary data, use ByteString functions (they are also faster since they don't check encoding). However, you can then decode that data with the help of functions from the Relude.String.Conversion module, e. g. decodeUtf8.

Synopsis

Text

readFileText :: MonadIO m => FilePath -> m Text #

Lifted version of readFile.

writeFileText :: MonadIO m => FilePath -> Text -> m () #

Lifted version of writeFile.

appendFileText :: MonadIO m => FilePath -> Text -> m () #

Lifted version of appendFile.

Lazy Text

readFileLText :: MonadIO m => FilePath -> m LText #

Lifted version of readFile.

writeFileLText :: MonadIO m => FilePath -> LText -> m () #

Lifted version of writeFile.

appendFileLText :: MonadIO m => FilePath -> LText -> m () #

Lifted version of appendFile.

ByteString

readFileBS :: MonadIO m => FilePath -> m ByteString #

Lifted version of readFile.

writeFileBS :: MonadIO m => FilePath -> ByteString -> m () #

Lifted version of writeFile.

appendFileBS :: MonadIO m => FilePath -> ByteString -> m () #

Lifted version of appendFile.

Lazy ByteString

readFileLBS :: MonadIO m => FilePath -> m LByteString #

Lifted version of readFile.

writeFileLBS :: MonadIO m => FilePath -> LByteString -> m () #

Lifted version of writeFile.

appendFileLBS :: MonadIO m => FilePath -> LByteString -> m () #

Lifted version of appendFile.