From e8d0c7d30e8fbf89113e661e7ede45dd5832c6e4 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 24 Jun 2008 14:49:32 +0000 Subject: [PATCH] () has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple --- Data/Tuple.hs | 13 +++++++++++++ GHC/Base.lhs | 33 --------------------------------- 2 files changed, 13 insertions(+), 33 deletions(-) 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@} %* * %********************************************************* -- 1.7.10.4