antelude-0.1.0: Yet another alternative Prelude for Haskell.
Maintainerdneavesdev@pm.me
Safe HaskellSafe
LanguageGHC2021

Antelude.File

Description

 
Synopsis

Documentation

type FilePath = String #

File and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

Reexport from Prelude

appendFile :: FilePath -> String -> IO () #

The computation appendFile file str function appends the string str, to the file file.

Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first.

main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])

Reexport from Prelude

readFile :: FilePath -> IO String #

The readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents.

Reexport from Prelude

writeFile :: FilePath -> String -> IO () #

The computation writeFile file str function writes the string str, to the file file.