readFileText depends on the system's locale settings and can throw unexpected exceptions. Use readFileBS instead.
Lifted version of readFile.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulerelude-1.2.0.0Haskell2010
SPDX-License-Identifier : MIT Maintainer : Kowainik xrom.xkov@gmail.com Stability : Stable Portability : Portable
Lifted to MonadIO families of file processing functions for the Text, LText, ByteString and LByteString types.
These functions are lifted which means that you can also use them inside various Monad Transformers without adding liftIO call explicitly.
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.
To be more precise, avoid the following functions:
See the following blog post for more details:
readFileText depends on the system's locale settings and can throw unexpected exceptions. Use readFileBS instead.
Lifted version of readFile.
Lifted version of writeFile.
Lifted version of appendFile.
readFileLText depends on the system's locale settings and can throw unexpected exceptions. Use readFileLBS instead.
Lifted version of readFile.
Lifted version of writeFile.
Lifted version of appendFile.
Lifted version of readFile.
Lifted version of writeFile.
Lifted version of appendFile.
Lifted version of readFile.
Lifted version of writeFile.
Lifted version of appendFile.