Fix newtype instance GADTs
ClosedPublic

Authored by RyanGlScott on Jun 27 2018, 9:17 AM.

Details

Summary

Ryan helpfully pointed out this commit from Richard's branch which fixed a problem I was having with newtype instances.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mpickering created this revision.Jun 27 2018, 9:17 AM
mpickering retitled this revision from Fix newtype instance GADTs Ryan helpfully pointed out this commit from Richard's branch which fixed a problem I was having with newtype instances. to Fix newtype instance GADTs.Jun 27 2018, 9:18 AM
mpickering edited the summary of this revision. (Show Details)
simonpj requested changes to this revision.Jun 28 2018, 3:48 AM
simonpj added a subscriber: simonpj.

see comment:2 on the ticket.

This revision now requires changes to proceed.Jun 28 2018, 3:48 AM
RyanGlScott commandeered this revision.Jun 29 2018, 8:43 AM
RyanGlScott edited reviewers, added: mpickering; removed: RyanGlScott.

Macro imcommandeeringthisdiff:

mpickering requested changes to this revision.Jun 29 2018, 8:57 AM

The patch is missing the test now.

This revision now requires changes to proceed.Jun 29 2018, 8:57 AM

Yes, I think that's it! Thank you. Does it work?

I think it'd be worth a Note (perhaps drawing on my Trac comments) to explain that every family-instance data con (whether newtype or not) gets a wrapper -- and why -- giving an example or two.

  • Add back the test I accidentally deleted
  • Expand a Note

The patch is missing the test now.

Oh lord, how did that happen... I am not very good with computer, apparently. Fixed.

Yes, I think that's it! Thank you. Does it work?

Yep. At least, the tests pass.

I think it'd be worth a Note (perhaps drawing on my Trac comments) to explain that every family-instance data con (whether newtype or not) gets a wrapper -- and why -- giving an example or two.

Good idea. I've expanded Note [Wrappers for data instance tycons] accordingly.

mpickering accepted this revision.Jun 30 2018, 1:38 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 5 2018, 9:08 AM
This revision was automatically updated to reflect the committed changes.