HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerebase-1.21.2Haskell2010

Rebase.Data.Text.Lazy.IO

  • 12 values
  • Packagerebase-1.21.2
  • Exports12
  • LanguageHaskell2010
  • LicenceMIT
  • SourceIO.hs
valuewriteFile :: FilePath -> Text -> IO ()
#

Write a string to a file. The file is truncated to zero length before writing begins.

valueinteract :: (Text -> Text) -> IO ()
#

The interact function takes a function of type Text -> Text as its argument. The entire input from the standard input device is passed (lazily) to this function as its argument, and the resulting string is output on the standard output device.

valuereadFile :: FilePath -> IO Text
#

Read a file and return its contents as a string. The file is read lazily, as with getContents.

Beware that this function (similarly to readFile) is locale-dependent. Unexpected system locale may cause your application to read corrupted data or throw runtime exceptions about "invalid argument (invalid byte sequence)" or "invalid argument (invalid character)". This is also slow, because GHC first converts an entire input to UTF-32, which is afterwards converted to UTF-8.

If your data is UTF-8, using decodeUtf8 . readFile is a much faster and safer alternative.