import IO import Directory main = do hdl <- openFile "/tmp/foo.txt" WriteMode hPutStr hdl "HELLO" hClose hdl a <- doesFileExist "/tmp/foo.txt" renameFile "/tmp/foo.txt" "/tmp/bar.txt" b <- doesFileExist "/tmp/foo.txt" c <- doesFileExist "/tmp/bar.txt" print (a,b,c)