closeFile : HasIO io => File -> io ()
Close the given file handle.
@ fh the file handle to close
openFile : HasIO io => String -> Mode -> io (Either FileError File)
Open the given file name with the specified mode.
@ f the file name to open
@ m the mode to open the file with
withFile : HasIO io => String -> Mode -> (FileError -> io a) -> (File -> io (Either a b)) -> io (Either a b)
Perform a given operation on successful file open
and ensure the file is closed afterwards or perform
a different operation if the file fails to open.