default roles

Joachim Breitner mail
Wed Oct 9 22:24:23 UTC 2013


Hi,

not sure if this is not old news to you all, but I think that for this
discussion, it helps to consider these two aspects of a class instance
separately:
  (1) An instance is a record of functions
  (2) An instance is a function of sorts? from types to (1)
and clearly, type parameters of (1) can be representational, but the
function in (2) should have its parameters nominal.

Therefore it is fine to coerce the dictionary of a function (and would
we want to implement GND this ways, that would be fine), but not a type
involving a constraint.

Inside GHC, as far as I can tell, (2) exists in the form of the instance
metadata, and disappears after desugaring, while (1) is the actual
dictionary that exists in core as a regular data type.

So the conclusion is indeed: Let type class constraints have a nominal
role, and all is fine.

Greetings,
Joachim

? well, a kind of function. But not that type of kind, but the other
type. Sort of, at least.

-- 
Joachim ?nomeata? Breitner
  mail at joachim-breitner.de ? http://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  ? GPG-Key: 0x4743206C
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20131010/8e52984d/attachment.sig>



More information about the Glasgow-haskell-users mailing list