We need to add role annotations for 7.8

Austin Seipp austin at well-typed.com
Thu Mar 13 20:26:18 UTC 2014

That would be ideal if you don't mind, so we can go ahead and merge it
and get that out of the way (vector etc can come soon after, but we
don't ship that in the GHC distributions, so it's less of a problem).

On Thu, Mar 13, 2014 at 3:22 PM, Johan Tibell <johan.tibell at gmail.com> wrote:
> Applied. Do you need a containers release ASAP so it can ship with 7.8?
> On Thu, Mar 13, 2014 at 9:11 PM, Richard Eisenberg <eir at cis.upenn.edu>
> wrote:
>> Patch attached. I only needed Map and Set -- the others are inferred. I
>> guess this was simpler than I thought. :)
>> Richard
>> On Mar 13, 2014, at 2:49 PM, Johan Tibell <johan.tibell at gmail.com> wrote:
>> If you send a pull request for containers I'll merge it and make a
>> release. It needs to be backwards compatible with the last 3 major GHC
>> releases. I think we need to bump the minor version number so people can
>> reliable write dependency bounds to depend on the role being there (as that
>> might be the difference between code compiling or not).
>> Here's a guess which params should be representational:
>> Map k v -- k: nominal, v: represententional
>> Set a -- k: nominal
>> IntMap v -- v: represententional
>> Sequence a -- a: represententional
>> Tree a -- a: represententional
>> On Thu, Mar 13, 2014 at 7:41 PM, Richard Eisenberg <eir at cis.upenn.edu>
>> wrote:
>>> Hi libraries, Johan, Edward,
>>> tl;dr: We really should add role annotations to the libraries that ship
>>> with GHC 7.8.
>>> In November, I sent this out:
>>> http://www.haskell.org/pipermail/libraries/2013-November/021707.html
>>> It got several good responses. Some time later, Joachim and I noticed
>>> that no action was taken, so we made a bug report, #8718, with a milestone
>>> of 7.8.1. I believe we both assumed that would take care of it. However,
>>> Simon PJ and I were surprised earlier this week to discover that Map and Set
>>> still do not have role annotations. Perhaps the GHC Trac isn't the right
>>> place for libraries issues, but posting here didn't quite work, so that
>>> seemed like the logical next step.
>>> In any case, now that we have the ability to prevent abuses of datatypes
>>> like Map and Set through erroneous use of GeneralizedNewtypeDeriving (and
>>> the new `coerce`), we should take advantage of this fact for 7.8. See my
>>> earlier email for a full explanation.
>>> Possibly folks' unfamiliarity with roles are in part to blame for not
>>> adding these role annotations. I am happy to help sort out what goes where.
>>> But, I need to work with someone with an intimate familiarity with the
>>> libraries themselves to help determine what the correct annotations are. For
>>> example, Map's first parameter should be nominal (its Ord instance is very
>>> relevant) but its second should be representational (there are no particular
>>> invariants related to the values of a map). Map is straightforward in this
>>> respect; other types probably aren't. Furthermore, I don't have anywhere
>>> near a complete list of what even needs attention. (It should be any type
>>> abstractly exported from a library.)
>>> Can someone help? I've included Johan as the most recent uploader of
>>> `containers` and Edward as the head of the core libraries committee.
>>> Thanks!
>>> Richard
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries


Austin Seipp, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/

More information about the Libraries mailing list