Add Data.Eq.equating to match Data.Ord.comparing?

Neil Mitchell ndmitchell at gmail.com
Thu Sep 20 06:32:51 EDT 2007


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%3Acomparing

Thanks

Neil


More information about the Libraries mailing list