Proposal for stand-alone deriving declarations?

Bulat Ziganshin bulat.ziganshin at
Thu Nov 2 03:04:06 EST 2006

Hello Malcolm,

Thursday, November 2, 2006, 12:46:43 AM, you wrote:

>     instance Num (Bar z) where
> and 
>     instance Num (Bar z)

> The former declares that _no_ methods are defined (except for defaults),
> and the latter, with your proposal, that _all_ methods are defined. The

i join to this note. moreover, currently GHC supports "generics for
the masses" that may mean very subtle semantic changes between code
generated by these two forms :))

i think it will be better to use derive/deriving/derived prepended to the

derive instance Num (Bar z)
derive instance Num z => Num (Bar z)

and allow generics/TH/other forms of user-specified deriving to catch
such declarations and provide alternative to compiler-wired deriving
mechanism. so we can imagine that we discuss some general deriving
syntax that in future will be reused by new Haskell extensions

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at

More information about the Haskell-prime mailing list