
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@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
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