
20 Sep
2007
20 Sep
'07
6:32 a.m.
Hi
This could be generalised to a function such as
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.
comparing = pairWise compare equating = pairWise (==)
"comparing" has certainly been added recently, and I think "equating" as well. http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Ord.html#v%3Acom... Thanks Neil