12 Dec
2006
12 Dec
'06
9:07 a.m.
Hi Steve, On 12/11/06, Steve Downey <sdowney@gmail.com> wrote:
transforming "one two three four " into " four three two one", how could this be done?
This is a good problem for Parsec<http://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