More GND + role inference woes

Simon Peyton-Jones simonpj at microsoft.com
Tue Dec 31 10:07:50 UTC 2013


So I think we are agreed that what is currently implemented is the right thing; and that it’s expressive enough for now.

There’s a lot of interesting stuff in this thread that it would be a shame to lose.  It would be great if the wiki page on roles could cover this stuff: https://ghc.haskell.org/trac/ghc/wiki/Roles

Specifically,

·         the way that GND is implemented (as described in the attached email) by looking at the method types, is manifestly non-obvious (since we missed it for ages)

·         Richard’s observations about the things it still doesn’t do are interesting

·         Some poster-child examples for where the simple roles we have are insufficiently expressive and a sketch of how it could be extended if necessary (I agree with Richard’s assessment that it’s not worth it right now).

Richard, you are the obvious person to do this, if you have time. Maybe just pointers to the right places would do.

Simon

From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Edward Kmett
Sent: 15 December 2013 09:28
To: Ben Gamari
Cc: ghc-devs
Subject: Re: More GND + role inference woes

Correct. With 7.8 we'll need to hand-implement those instances rather than derive them.

On Sat, Dec 14, 2013 at 7:59 PM, Ben Gamari <bgamari.foss at gmail.com<mailto:bgamari.foss at gmail.com>> wrote:
Richard Eisenberg <eir at cis.upenn.edu<mailto:eir at cis.upenn.edu>> writes:

> Yes, I believe that's right. As far as I can figure out, these classes
> really *are* problematic, in that if we allowed
> GeneralizedNewtypeDeriving for them, there would be a way to subvert
> the type system. To make these derivable, we would need to be able to
> restrict various type parameters from taking on values that take a
> nominal argument. Without the ability to restrict the values in this
> way, there could be trouble.
>
I suppose it's unlikely that the roles mechanism will be extended to
allow for such restriction?

Cheers,

- Ben

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131231/8b4b105f/attachment-0001.html>
-------------- next part --------------
An embedded message was scrubbed...
From: Simon Peyton-Jones <simonpj at microsoft.com>
Subject: RE: More GND + role inference woes
Date: Wed, 16 Oct 2013 13:28:28 +0000
Size: 48528
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131231/8b4b105f/attachment-0002.mht>
-------------- next part --------------
An embedded message was scrubbed...
From: Richard Eisenberg <eir at cis.upenn.edu>
Subject: Re: More GND + role inference woes
Date: Sun, 15 Dec 2013 01:06:08 +0000
Size: 4517
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131231/8b4b105f/attachment-0003.mht>


More information about the ghc-devs mailing list