[project @ 2005-03-14 15:46:12 by simonmar]
authorsimonmar <unknown>
Mon, 14 Mar 2005 15:46:12 +0000 (15:46 +0000)
committersimonmar <unknown>
Mon, 14 Mar 2005 15:46:12 +0000 (15:46 +0000)
Add Data.Ord and Data.Eq.  Data.Ord also exports the new function
'comparing', as discussed on the libraries list a while back.

Data/Eq.hs [new file with mode: 0644]
Data/Ord.hs [new file with mode: 0644]
Prelude.hs
base.cabal
package.conf.in

diff --git a/Data/Eq.hs b/Data/Eq.hs
new file mode 100644 (file)
index 0000000..2020233
--- /dev/null
@@ -0,0 +1,22 @@
+{-# OPTIONS_GHC -fno-implicit-prelude #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Data.Eq
+-- Copyright   :  (c) The University of Glasgow 2005
+-- License     :  BSD-style (see the file libraries/base/LICENSE)
+-- 
+-- Maintainer  :  libraries@haskell.org
+-- Stability   :  stable
+-- Portability :  portable
+--
+-- Equality
+--
+-----------------------------------------------------------------------------
+
+module Data.Eq (
+   Eq(..),
+ ) where
+
+#if __GLASGOW_HASKELL__
+import GHC.Base
+#endif
diff --git a/Data/Ord.hs b/Data/Ord.hs
new file mode 100644 (file)
index 0000000..2be636c
--- /dev/null
@@ -0,0 +1,27 @@
+{-# OPTIONS_GHC -fno-implicit-prelude #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Data.Ord
+-- Copyright   :  (c) The University of Glasgow 2005
+-- License     :  BSD-style (see the file libraries/base/LICENSE)
+-- 
+-- Maintainer  :  libraries@haskell.org
+-- Stability   :  stable
+-- Portability :  portable
+--
+-- Orderings
+--
+-----------------------------------------------------------------------------
+
+module Data.Ord (
+   Ord(..),
+   Ordering,
+   comparing,
+ ) where
+
+#if __GLASGOW_HASKELL__
+import GHC.Base
+#endif
+
+comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering
+comparing p x y = compare (p x) (p y)
index 578ba7b..2f0a510 100644 (file)
@@ -172,10 +172,12 @@ import GHC.Err   ( error, undefined )
 import Hugs.Prelude
 #endif
 
+import Data.Eq
+import Data.Ord
+
 #ifndef __HUGS__
 infixr 0 $!
 
-
 -- -----------------------------------------------------------------------------
 -- Miscellaneous functions
 
index 1a920de..2124d35 100644 (file)
@@ -40,6 +40,7 @@ exposed-modules:
        Data.Complex,
        Data.Dynamic,
        Data.Either,
+       Data.Eq,
        Data.FiniteMap,
        Data.FunctorM,
        -- Data.Generics,
@@ -60,6 +61,7 @@ exposed-modules:
        Data.Maybe,
        Data.Map,
        Data.Monoid,
+       Data.Ord,
        Data.PackedString,
        Data.Queue,
        Data.Ratio,
index 91a64ce..a68f25d 100644 (file)
@@ -38,6 +38,7 @@ exposed-modules:
        Data.Complex,
        Data.Dynamic,
        Data.Either,
+       Data.Eq,
        Data.FiniteMap,
        Data.FunctorM,
        Data.Generics,
@@ -58,6 +59,7 @@ exposed-modules:
        Data.Maybe,
        Data.Map,
        Data.Monoid,
+       Data.Ord,
        Data.PackedString,
        Data.Queue,
        Data.Ratio,