
Simon Peyton Jones
writes: Oh, that's helpful thank you. I have added comments!
I've added a further use case (Example 3 -- from my one-eyed focus on Records). And apologies if these are two dumb questions, but is there a bigger prize here? If we can figure out rules for when a GADT can be 'newtype'd; then can we also figure it out for ordinary 'data'? Then 'newtype' becomes more of an optimisation pragma than a distinct declaration. And we can smooth over that nervous cluelessness for newbies agonising about what/whether they can newtype. (Ref the examples in Haskell 12010 report 4.2.3.) Also: are the conditions under which we can newtype a GADT also the conditions under which we can implement deriving ... That is, deriving as part of the decl, rather than standalone. (A Summer-of-code project?) AntC