data Handle = MkHandle Int
An open file handle (opaque).
import System.File.Handledata Handle = MkHandle Intdata Mode = Read | Write | AppendopenFile : Path -> Mode -> Result FileError Handle with FShGetLine : Handle -> Result FileError String with FShPutStr : Handle -> String -> Result FileError () with FShClose : Handle -> () with FSwithFile : Path -> Mode -> (Handle -> a with FS) -> Result FileError a with FSdata Handle = MkHandle Int
An open file handle (opaque).
data Mode = Read | Write | Append
How to open a file.
openFile : Path -> Mode -> Result FileError Handle with FS
Open a file in the given mode.
hGetLine : Handle -> Result FileError String with FS
Read the next line from a handle opened for reading (without the newline). Returns an error at end of file.
hPutStr : Handle -> String -> Result FileError () with FS
Write a string to a handle opened for writing/appending.
hClose : Handle -> () with FS
Close a handle.
withFile : Path -> Mode -> (Handle -> a with FS) -> Result FileError a with FS
Open a file, run an action with the handle, and close it afterwards (whether or not the action succeeds in producing its value).