X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FBase.lhs;fp=GHC%2FBase.lhs;h=52d125211f0e211bac2f7190489ec0ced860562b;hb=67cf2e25aea39f9be8aab1c2269b1d3ebf6bfe3e;hp=c1db36463123d918499a742c7c7151d72286344b;hpb=ca102a0efb1c88bca67462101403e99e448494bc;p=ghc-base.git diff --git a/GHC/Base.lhs b/GHC/Base.lhs index c1db364..52d1252 100644 --- a/GHC/Base.lhs +++ b/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