Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- I don't want to have an IO thing anymore.
- -- Why does this expect an IO?
- readInput = do
- input <- getLine
- map Char.toUpper input
- sayInvalid what = putStrLn $ "The command " ++ what ++ " it not valid."
- actionLoop = do
- putStrLn "Enter action: read (or r), write (or w), quit (or q) >>"
- let action = readInput
- case action of -- IO
- "READ" -> doReadFile
- "WRITE" -> doWriteFile
- "QUIT" -> return ()
- _ -> sayInvalid action
Add Comment
Please, Sign In to add comment