Skip to content

Instantly share code, notes, and snippets.

@asheshambasta
Created February 13, 2016 21:21
Show Gist options
  • Save asheshambasta/2109b96ef326ee1e3e4a to your computer and use it in GitHub Desktop.
Save asheshambasta/2109b96ef326ee1e3e4a to your computer and use it in GitHub Desktop.
simple IO stuff
--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