
11 Dec
2006
11 Dec
'06
8:07 p.m.
Hi Steve,
On 12/11/06, Steve Downey
transforming "one two three four " into " four three two one", how could this be done?
This is a good problem for Parsechttp://www.cs.uu.nl/%7Edaan/download/parsec/parsec.html : import Text.ParserCombinators.Parsec reverseWords = concat . reverse . split where split = fromRight . parse wordsSpaces "" fromRight (Right s) = s wordsSpaces = many (many1 space <|> many1 alphaNum) -Greg