I understand why the new system of roles and annotations require that the parameters of the family (and data) be in the role of nominal .
So, I was expecting to announce
data family CoordinateRepresentation ty a :: *
so ty and a get nominal roles. (My actual example is a related data family, but since I don't think it is changing anything, I miss the extra noise that comes with it.)
I did not expect that when I changed it to
data family CoordinateRepresentation ty :: * -> *
lies in the fact that the indefinite argument of the second type still gets the role of nominal .
Why is this? Could he safely get the representational role because there is no need for a data instance CoordinateRepresentation ... = ... create a new constructor? How could this constructor use its parameter in the role of nominal so that the compiler could not see? Despite the fact that this is an open system and there is a separate compilation, I still do not understand it.
haskell ghc type-families
Doug mcclean
source share