From: Ian Lynagh Date: Tue, 24 Nov 2009 01:14:16 +0000 (+0000) Subject: We can now derive Ord () X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=6e10ad01213942b3ef4a27c16f2f9360334955a8;p=ghc-base.git We can now derive Ord () --- diff --git a/GHC/Classes.hs b/GHC/Classes.hs index 8b53676..c3dd026 100644 --- 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 --- 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)