Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created May 13, 2015 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/8c0ba01fa28bd671b175 to your computer and use it in GitHub Desktop.
Save shigemk2/8c0ba01fa28bd671b175 to your computer and use it in GitHub Desktop.
main = do
line <- getLine
if null line
then return ()
else do
putStrLn $ reverseWords line
main
reverseWords :: String -> String
reverseWords = unwords . map reverse . words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment