
27 Apr
2005
27 Apr
'05
9:37 a.m.
On Wed, 27 Apr 2005, Anuj Seth wrote:
Excuse the newbie'ness of my question. Saw an example in Two Dozen Questions by Rexx Page.
blocks blockSize = takeWhile ( not . null ) . map fst . iterate (splitAt blockSize . snd) . splitAt blockSize
What is the meaning of the . operators outside the parentheses ?
The same as inside. :-) (splitAt blockSize) transforms a list to a pair of lists. So imagine a list input at the right of (splitAt blockSize) and a pair output at the left. This pair is piped into the 'iterate' part which transforms a list of pairs into a list of pairs of lists. This in turn is piped to (map fst) and so on.