request for reviews for my first patch -- ticket 7401

Austin Seipp aseipp at pobox.com
Mon Aug 12 04:28:59 CEST 2013


Technically, EmptyDataDecls is part of Haskell 2010, so it is standard
these days (and H2010 is our default in GHC.)

As far as I know, the 2010 standard doesn't address this point about
deriving for empty data decls, but I agree with your reasoning here.
It's more consistent to have it apply to all of the base classes which
are derivable.

On Sun, Aug 11, 2013 at 9:14 PM, Richard Eisenberg <eir at cis.upenn.edu> wrote:
> Maybe it's best if Show, Ord, etc., echo the new behavior for Eq, if EmmptyDataDecls is specified. The reason for the check in cond_stdOK is to make sure that we're conforming to the Haskell standard. But, if the user has specified EmptyDataDecls, then we're not bound to that requirement anymore. So, to me, it seems reasonable that the "null data_cons" check should be omitted for any class if EmptyDataDecls is specified.
>
> What do others think? This would go beyond the scope of the particular reported bug, but it seems to make sense to me.
>
> Thanks,
> Richard
>
> On Aug 9, 2013, at 3:16 PM, Ömer Sinan Ağacan wrote:
>
>> Removing `null data_cons`(compiler/typecheck/TcDeriv.lhs 1105) check
>> for eq instance declarations fixes this, code generation part would be
>> same(changes in TcGenDeriv.hs were wrong and TcGenDeriv needs to be
>> unchanged)but I'm not sure how to remove that check only for eq
>> instance(Show, Ord, etc. sould still fail with same error message and
>> they're checked by same function, `cond_stdOK` -- line 1053).
>>
>> ---
>> Ömer Sinan Ağacan
>> http://osa1.net
>>
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://www.haskell.org/mailman/listinfo/ghc-devs
>>
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



-- 
Regards,
Austin - PGP: 4096R/0x91384671




More information about the ghc-devs mailing list