
13 Dec
2006
13 Dec
'06
9:27 a.m.
ulfn:
On Dec 13, 2006, at 3:54 AM, Yitz Gale wrote:
Nice. Here is something similar:
reverseWords = concat . reverse . groupBy eqsp where eqsp x y = isSpace x == isSpace y
This can be made even nicer using the 'on' function [1]:
reverseWords = concat . reverse . groupBy ((==) `on` isSpace)
[1] http://www.haskell.org/pipermail/libraries/2006-November/006156.html
Lambdabot trick(tm), use 'join' in the [] monad, instead of 'concat' join . reverse . groupBy ((==) `on` isSpace) -- Don