Skip to content

Instantly share code, notes, and snippets.

@miaout17
Created April 29, 2012 15:13
Show Gist options
  • Save miaout17/2551099 to your computer and use it in GitHub Desktop.
Save miaout17/2551099 to your computer and use it in GitHub Desktop.
import Data.Char (toUpper)
import Control.Monad (liftM)
upper = map toUpper
main = do
putStrLn "Please enter your name: "
name <- liftM upper getLine
putStrLn $ "Hello " ++ name ++ " with liftM!"
putStrLn "Please enter your name again: "
name2 <- fmap upper getLine
putStrLn $ "Hello " ++ name2 ++ " with liftM!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment