Created
February 13, 2016 21:21
-
-
Save asheshambasta/2109b96ef326ee1e3e4a to your computer and use it in GitHub Desktop.
simple IO stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--file: ch07/return2.hs | |
import Data.Char(toUpper) | |
isYes :: String -> Bool | |
isYes str = (toUpper . head $ str) == 'Y' | |
isGreen :: IO Bool | |
isGreen = putStrLn "green your favourite colour dawg?" >> | |
getLine >>= (\str -> return (isYes str)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment