Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. --file: ch07/return2.hs
  2. import Data.Char(toUpper)
  3.  
  4. isYes :: String -> Bool
  5. isYes str = (toUpper . head $ str) == 'Y'
  6.  
  7. isGreen :: IO Bool
  8. isGreen = putStrLn "green your favourite colour dawg?" >>
  9. getLine >>= (\str -> return (isYes str))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement