Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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