text-locale-encoding-0.1.0.2: Encode and decode Text to/from ByteString using TextEncoding

PortabilityGHC-only
Stabilityexperimental
Maintainerkudahkukarek@gmail.com
Safe HaskellTrustworthy

Data.Text.IO.Locale

Description

This module offers much faster locale-aware I/O than Data.Text.IO due to the usage of hPutBuf to write the resulting ByteString all at once, while Data.Text.IO writes characters one at a time, taking the Handle lock each time. Since functions in this module take the lock just once, they can safely be used from multiple threads without fear of messed up output.

Functions in this module require at least twice as much memory as the Text they operate on to output it. For strings more than a half of available RAM in size, this may result in memory exhaustion.

This module is intended to be imported qualified.

Synopsis

Documentation

putStr :: Text -> IO ()Source

Like putStr, but writes the Text all at once.

putStrLn :: Text -> IO ()Source

Like putStrLn, but writes the Text all at once.

hPutStr :: Handle -> Text -> IO ()Source

Like hPutStr, but writes the Text all at once.

hPutStrLn :: Handle -> Text -> IO ()Source

Like hPutStrLn, but writes the Text all at once.

writeFile :: FilePath -> Text -> IO ()Source

Like writeFile, but writes the Text all at once.

appendFile :: FilePath -> Text -> IO ()Source

Like appendFile, but writes the Text all at once.