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 m...@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nome...@joachim-breitner.de • GPG-Key: 0x4743206C Debian Developer: nome...@debian.org
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users