Skip to content

Instantly share code, notes, and snippets.

@MiyamonY
Created February 28, 2015 05:27
Show Gist options
  • Save MiyamonY/aa6717a4794e66753e52 to your computer and use it in GitHub Desktop.
Save MiyamonY/aa6717a4794e66753e52 to your computer and use it in GitHub Desktop.
-- instance Functor IO where
-- fmap f action = do
-- result <- action
-- return (f result)
main :: IO ()
-- main = do line <- getLine
-- let line' = reverse line
-- putStrLn $ "You said " ++ line' ++ " backwards!"
-- putStrLn $ "Yes, you said " ++ line' ++ " backwards"
main = do line <- fmap reverse getLine
putStrLn $ "You said " ++ line ++ " backwards"
putStrLn $ "Yes, you said " ++ line ++ " backwards"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment