From: Ian Lynagh Date: Tue, 24 Jun 2008 14:49:32 +0000 (+0000) Subject: () has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e8d0c7d30e8fbf89113e661e7ede45dd5832c6e4;hp=81013c3eff32c6f2959e88fc0f73a77d9d35ca77;p=ghc-base.git () has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple --- diff --git a/Data/Tuple.hs b/Data/Tuple.hs index 69a2c9d..d16ce02 100644 --- a/Data/Tuple.hs +++ b/Data/Tuple.hs @@ -67,6 +67,19 @@ import Prelude default () -- Double isn't available yet #ifdef __GLASGOW_HASKELL__ +instance Eq () where + () == () = True + () /= () = False + +instance Ord () where + () <= () = True + () < () = False + () >= () = True + () > () = False + max () () = () + min () () = () + compare () () = EQ + data (,) a b = (,) a b deriving (Eq, Ord) data (,,) a b c = (,,) a b c deriving (Eq, Ord) data (,,,) a b c d = (,,,) a b c d deriving (Eq, Ord) diff --git a/GHC/Base.lhs b/GHC/Base.lhs index 622ad02..341a630 100644 --- a/GHC/Base.lhs +++ b/GHC/Base.lhs @@ -522,39 +522,6 @@ otherwise = True %********************************************************* %* * -\subsection{The @()@ type} -%* * -%********************************************************* - -The Unit type is here because virtually any program needs it (whereas -some programs may get away without consulting GHC.Tup). Furthermore, -the renamer currently *always* asks for () to be in scope, so that -ccalls can use () as their default type; so when compiling GHC.Base we -need (). (We could arrange suck in () only if -XForeignFunctionInterface, -but putting it here seems more direct.) - -\begin{code} --- | The unit datatype @()@ has one non-undefined member, the nullary --- constructor @()@. -data () = () - -instance Eq () where - () == () = True - () /= () = False - -instance Ord () where - () <= () = True - () < () = False - () >= () = True - () > () = False - max () () = () - min () () = () - compare () () = EQ -\end{code} - - -%********************************************************* -%* * \subsection{Type @Ordering@} %* * %*********************************************************