() has moved to ghc-prim:GHC.Unit, and the Eq and Ord instances to Data.Tuple
authorIan Lynagh <igloo@earth.li>
Tue, 24 Jun 2008 14:49:32 +0000 (14:49 +0000)
committerIan Lynagh <igloo@earth.li>
Tue, 24 Jun 2008 14:49:32 +0000 (14:49 +0000)
Data/Tuple.hs
GHC/Base.lhs

index 69a2c9d..d16ce02 100644 (file)
@@ -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)
index 622ad02..341a630 100644 (file)
@@ -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@}
 %*                                                      *
 %*********************************************************