projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3a63929
)
We can now derive Ord ()
author
Ian Lynagh
<igloo@earth.li>
Tue, 24 Nov 2009 01:14:16 +0000
(
01:14
+0000)
committer
Ian Lynagh
<igloo@earth.li>
Tue, 24 Nov 2009 01:14:16 +0000
(
01:14
+0000)
GHC/Classes.hs
patch
|
blob
|
history
diff --git
a/GHC/Classes.hs
b/GHC/Classes.hs
index
8b53676
..
c3dd026
100644
(file)
--- a/
GHC/Classes.hs
+++ b/
GHC/Classes.hs
@@
-144,19
+144,7
@@
class (Eq a) => Ord a where
max x y = if x <= y then y else x
min x y = if x <= y then x else y
max x y = if x <= y then y else x
min x y = if x <= y then x else y
--- XXX Deriving this doesn't work:
--- ghc-stage1: panic! (the 'impossible' happened)
--- (GHC version 6.13.20091123 for x86_64-unknown-linux):
--- TcGenDeriv:mk_FunBind
-instance Ord () where
- () <= () = True
- () < () = False
- () >= () = True
- () > () = False
- max () () = ()
- min () () = ()
- compare () () = EQ
-
+deriving instance Ord ()
deriving instance (Ord a, Ord b) => Ord (a, b)
deriving instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
deriving instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
deriving instance (Ord a, Ord b) => Ord (a, b)
deriving instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
deriving instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)