Guest User

Untitled

a guest
Feb 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. -- I don't want to have an IO thing anymore.
  2. -- Why does this expect an IO?
  3. readInput = do
  4. input <- getLine
  5. map Char.toUpper input
  6.  
  7. sayInvalid what = putStrLn $ "The command " ++ what ++ " it not valid."
  8.  
  9. actionLoop = do
  10. putStrLn "Enter action: read (or r), write (or w), quit (or q) >>"
  11. let action = readInput
  12. case action of -- IO
  13. "READ" -> doReadFile
  14. "WRITE" -> doWriteFile
  15. "QUIT" -> return ()
  16. _ -> sayInvalid action
Add Comment
Please, Sign In to add comment