We need to add role annotations for 7.8
Austin Seipp
austin at well-typed.com
Thu Mar 13 22:03:12 UTC 2014
That's right. If you had another instance of Ord for a newtype with
compare = flip compare, and were allowed to coerce the keys, you can
break it.
On Thu, Mar 13, 2014 at 5:00 PM, Andres Löh <andres at well-typed.com> wrote:
> [Sorry for the self-reply.]
>
> Oh, perhaps I actually understand this:
>
>> Please forgive my ignorance w.r.t. roles, but why aren't all of these
>> representational?
>>
>>> Map k v -- k: nominal, v: represententional
>>> Set a -- k: nominal
>>
>> AFAIK both Map and Set are "normal" datatypes. Not GADTs, no type
>> families involved. Why would anything need to be "nominal" then?
>
> Is this because the integrity of these types relies on the Ord
> instance being sane, and a newtype could have a different Ord instance
> defined?
>
> Cheers,
> Andres
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
--
Regards,
Austin Seipp, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com/
More information about the Libraries
mailing list