diff options
author | Ian Lynagh <igloo@earth.li> | 2009-11-23 20:22:53 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2009-11-23 20:22:53 +0000 |
commit | b7d693ca80da7e36167f1e3458f70b4a285fc082 (patch) | |
tree | 49b31bfd1ef06fa8108d8452e850c682a42cf6db /libraries/base/GHC/Base.lhs | |
parent | 08c5e81edc6842062e678232c1f3a6f8c230bd2e (diff) | |
download | haskell-b7d693ca80da7e36167f1e3458f70b4a285fc082.tar.gz |
De-orphan the Eq/Ord Char instances
Diffstat (limited to 'libraries/base/GHC/Base.lhs')
-rw-r--r-- | libraries/base/GHC/Base.lhs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/libraries/base/GHC/Base.lhs b/libraries/base/GHC/Base.lhs index c1db364631..52d125211f 100644 --- a/libraries/base/GHC/Base.lhs +++ b/libraries/base/GHC/Base.lhs @@ -468,20 +468,6 @@ by Unicode, use 'Prelude.toEnum' and 'Prelude.fromEnum' from the 'Prelude.Enum' class respectively (or equivalently 'ord' and 'chr'). -} --- We don't use deriving for Eq and Ord, because for Ord the derived --- instance defines only compare, which takes two primops. Then --- '>' uses compare, and therefore takes two primops instead of one. - -instance Eq Char where - (C# c1) == (C# c2) = c1 `eqChar#` c2 - (C# c1) /= (C# c2) = c1 `neChar#` c2 - -instance Ord Char where - (C# c1) > (C# c2) = c1 `gtChar#` c2 - (C# c1) >= (C# c2) = c1 `geChar#` c2 - (C# c1) <= (C# c2) = c1 `leChar#` c2 - (C# c1) < (C# c2) = c1 `ltChar#` c2 - {-# RULES "x# `eqChar#` x#" forall x#. x# `eqChar#` x# = True "x# `neChar#` x#" forall x#. x# `neChar#` x# = False |