Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created April 15, 2015 12:14
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/61f3dc12b937b5848b47 to your computer and use it in GitHub Desktop.
Save shigemk2/61f3dc12b937b5848b47 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