see my reply to Pedro | -----Original Message----- | From: andres.l...@googlemail.com [mailto:andres.l...@googlemail.com] On | Behalf Of Andres Loeh | Sent: 12 January 2011 11:58 | To: José Pedro Magalhães | Cc: Simon Peyton-Jones; Johan Jeuring; cvs-ghc@haskell.org; atze | Subject: Re: Generic deriving: new default methods | | Hi. | | Pedro's point is the reason why I suggested to make "generic" scope | over both the type signature and the definition, whereas Simon wanted | it to be only for the type signature. | | So, for the Eq example, I'd propose | | class Eq a where | (==) , (/=) :: a -> a -> Bool | | a == b = not (a /= b) | a /= b = not (a == b) | | generic | (==) :: (Representable a) => a -> a -> Bool | a == b = genericEqDefault a b | | And it would still be possible to omit the type signature (if so | desired), but *not* the "generic" keyword, to have the type signature | inferred from the type of "genericEqDefault". Of course, minor | syntactic variations are possible. If we'd rather not introduce a new | layout block, then we could also require "generic" to be written | twice, for the type signature and the definition. | | Cheers, | Andres
_______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc