[Haskell-cafe] Point-free style
benjamin.franksen at bessy.de
Mon Feb 14 22:10:30 EST 2005
On Monday 14 February 2005 17:08, Thomas Jäger wrote:
> > s' = flip flip (span ((0 ==) . fst) . zip [0..] . repeat) . ((.) .) . (id
> > .) . (uncurry .) . flip ((.) . flip (.) . (. (snd . head))) . (. (snd .
> > head))
This one is a little bit shorter and somewhat more 'elementary':
s = (.) (flip (.) (head . uncurry zip . splitAt 1 . replicate 2) . uncurry) .
(flip (.) (flip (.)) . flip (.))
The really hard part was to find a nice & short point-less version of
\x -> (x,x)
head . uncurry zip . splitAt 1 . replicate 2
This stuff is really crazy =8-)))
More information about the Haskell-Cafe