summaryrefslogtreecommitdiff
path: root/ghc/lib/prelude/ITup0.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/lib/prelude/ITup0.hs')
-rw-r--r--ghc/lib/prelude/ITup0.hs43
1 files changed, 43 insertions, 0 deletions
diff --git a/ghc/lib/prelude/ITup0.hs b/ghc/lib/prelude/ITup0.hs
new file mode 100644
index 0000000000..32776c8d47
--- /dev/null
+++ b/ghc/lib/prelude/ITup0.hs
@@ -0,0 +1,43 @@
+module PreludeBuiltin where
+
+--- 0-tuple (trivial type "()" ) ---------------------------------
+
+import Cls
+import Core
+import IChar
+import IList
+import List ( (++), foldr )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+instance Eq () where
+ () == () = True
+ () /= () = False
+
+instance Ord () where
+ () <= () = True
+ () < () = False
+ () >= () = True
+ () > () = False
+ max () () = ()
+ min () () = ()
+ _tagCmp () () = _EQ
+
+instance Text () where
+ readsPrec p = readParen False
+ (\r -> [((),t) | ("(",s) <- lex r,
+ (")",t) <- lex s ] )
+ showsPrec p () = showString "()"
+
+instance Ix () where
+ range ((), ()) = [()]
+ index ((), ()) () = 0
+ inRange ((), ()) () = True
+
+instance Enum () where
+ enumFrom () = [()]
+ enumFromThen () () = [()]
+ enumFromTo () () = [()]
+ enumFromThenTo () () () = [()]
+
+-- ToDo: something for Binary