Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created April 15, 2015 12:41
Show Gist options
  • Save shigemk2/f51c46bc45338960d4eb to your computer and use it in GitHub Desktop.
Save shigemk2/f51c46bc45338960d4eb to your computer and use it in GitHub Desktop.
import Control.Monad
main = do
colors <- forM [1,2,3,4] $ \a -> do
putStrLn $ "Which color do you associate with the number "
++ show a ++ "?"
color <- getLine
return color
putStrLn "The colors that you associate with 1, 2, 3 and 4 are: "
mapM putStrLn colors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment