add GHC.HetMet.{hetmet_kappa,hetmet_kappa_app}
[ghc-base.git] / Data / Ord.hs
1 {-# LANGUAGE CPP, NoImplicitPrelude #-}
2
3 -----------------------------------------------------------------------------
4 -- |
5 -- Module      :  Data.Ord
6 -- Copyright   :  (c) The University of Glasgow 2005
7 -- License     :  BSD-style (see the file libraries/base/LICENSE)
8 -- 
9 -- Maintainer  :  libraries@haskell.org
10 -- Stability   :  stable
11 -- Portability :  portable
12 --
13 -- Orderings
14 --
15 -----------------------------------------------------------------------------
16
17 module Data.Ord (
18    Ord(..),
19    Ordering(..),
20    comparing,
21  ) where
22
23 #if __GLASGOW_HASKELL__
24 import GHC.Base
25 #endif
26
27 -- | 
28 -- > comparing p x y = compare (p x) (p y)
29 --
30 -- Useful combinator for use in conjunction with the @xxxBy@ family
31 -- of functions from "Data.List", for example:
32 --
33 -- >   ... sortBy (comparing fst) ...
34 comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering
35 comparing p x y = compare (p x) (p y)