Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hledger.Utils.UTF8IOCompat
Description
UTF-8 aware string IO functions that will work across multiple platforms and GHC versions. Includes code from Text.Pandoc.UTF8 ((C) 2010 John MacFarlane).
Example usage:
import Prelude hiding (readFile,writeFile,appendFile,getContents,putStr,putStrLn) import UTF8IOCompat (readFile,writeFile,appendFile,getContents,putStr,putStrLn) import UTF8IOCompat (SystemString,fromSystemString,toSystemString,error',userError')
2013410 update: we now trust that current GHC versions & platforms do the right thing, so this file is a no-op and on its way to being removed. Not carefully tested.
20191020 update: all packages have base>=4.9 which corresponds to GHC v8.0.1 and higher. Tear this file apart!
Synopsis
- readFile :: FilePath -> IO String
- writeFile :: FilePath -> String -> IO ()
- appendFile :: FilePath -> String -> IO ()
- getContents :: IO String
- hGetContents :: Handle -> IO String
- putStr :: String -> IO ()
- putStrLn :: String -> IO ()
- hPutStr :: Handle -> String -> IO ()
- hPutStrLn :: Handle -> String -> IO ()
- error' :: String -> a
- userError' :: String -> IOError
- usageError :: String -> a
Documentation
appendFile :: FilePath -> String -> IO () #
getContents :: IO String #
hGetContents :: Handle -> IO String #
userError' :: String -> IOError Source #
A SystemString-aware version of userError.
usageError :: String -> a Source #
A SystemString-aware version of error that adds a usage hint.