
20 Sep
2007
20 Sep
'07
6:54 a.m.
pairWise :: (b -> b -> c) -> (a -> b) -> a -> a -> c pairWise pair project x y = pair (project x) (project y)
We call this function "on", and I believe it has been recently added to the standard libraries.
x = groupBy (equating snd) pairs
In Data.Functions. thus becomes x = groupBy ((==) `on` snd) pairs Regards, Malcolm