[commit: base] master: FIX #7263: derive Eq, Show, and Read for GHC.Generics representation types (219ea0e)
José Pedro Magalhães
jpm at cs.uu.nl
Wed Oct 3 10:49:00 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/219ea0e539aca217fe1819baf02d4cdd1d670f51
>---------------------------------------------------------------
commit 219ea0e539aca217fe1819baf02d4cdd1d670f51
Author: Jose Pedro Magalhaes <jpm at cs.ox.ac.uk>
Date: Wed Oct 3 09:35:02 2012 +0100
FIX #7263: derive Eq, Show, and Read for GHC.Generics representation types
>---------------------------------------------------------------
GHC/Generics.hs | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/GHC/Generics.hs b/GHC/Generics.hs
index fe86600..a858057 100644
--- a/GHC/Generics.hs
+++ b/GHC/Generics.hs
@@ -45,31 +45,38 @@ data V1 p
-- | Unit: used for constructors without arguments
data U1 p = U1
+ deriving (Eq, Read, Show)
-- | Used for marking occurrences of the parameter
newtype Par1 p = Par1 { unPar1 :: p }
-
+ deriving (Eq, Read, Show)
-- | Recursive calls of kind * -> *
newtype Rec1 f p = Rec1 { unRec1 :: f p }
+ deriving (Eq, Read, Show)
-- | Constants, additional parameters and recursion of kind *
newtype K1 i c p = K1 { unK1 :: c }
+ deriving (Eq, Read, Show)
-- | Meta-information (constructor names, etc.)
newtype M1 i c f p = M1 { unM1 :: f p }
+ deriving (Eq, Read, Show)
-- | Sums: encode choice between constructors
infixr 5 :+:
data (:+:) f g p = L1 (f p) | R1 (g p)
+ deriving (Eq, Read, Show)
-- | Products: encode multiple arguments to constructors
infixr 6 :*:
data (:*:) f g p = f p :*: g p
+ deriving (Eq, Read, Show)
-- | Composition of functors
infixr 7 :.:
newtype (:.:) f g p = Comp1 { unComp1 :: f (g p) }
+ deriving (Eq, Read, Show)
-- | Tag for K1: recursion (of kind *)
data R
More information about the Cvs-libraries
mailing list