Use Cxt for deriving clauses in TH (#10819)
ClosedPublic

Authored by bgamari on Sep 1 2015, 10:26 PM.

Details

Summary

Deriving clauses in the TH representations of data, newtype, data
instance, and newtype instance declarations previously were just [Name],
which didn't allow for more complex derived classes, eg. multi-parameter
typeclasses.

This switches out [Name] for Cxt, representing the derived classes as
types instead of names.

Test Plan

validate

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.
spinda retitled this revision from to Use Cxt for deriving clauses in TH (#10819).Sep 1 2015, 10:26 PM
spinda updated this object.
spinda edited the test plan for this revision. (Show Details)
spinda added a reviewer: austin.
spinda updated the Trac tickets for this revision.
spinda updated this object.Sep 2 2015, 1:04 PM
goldfire accepted this revision.Sep 3 2015, 1:36 AM

Macro applause:

testsuite/tests/th/Lib.hs
1 ↗(On Diff #4011)

Did you mean for this to be here?

spinda updated this revision to Diff 4044.Sep 3 2015, 1:51 AM

Remove unintentionally-included file

testsuite/tests/th/Lib.hs
1 ↗(On Diff #4011)

Oh dear, no I did not. That's from when I was experimenting with bypassing Safe Haskell (Trac #10826). Looks like I saved it in the wrong directory.

austin accepted this revision.Sep 6 2015, 4:13 PM

Nice.

compiler/hsSyn/Convert.hs
485–489

goodwilldancing

Please rebase this patch onto current master, so it can be validated.

bgamari added a comment.EditedSep 18 2015, 4:44 AM

@spinda, do you think you could rebase this?

edit: oops, looks like @thomie already asked. Take your time.

bgamari requested changes to this revision.Sep 21 2015, 5:56 AM

Bumping from review queue.

This revision now requires changes to proceed.Sep 21 2015, 5:56 AM
bgamari commandeered this revision.Dec 7 2015, 8:26 AM
bgamari edited reviewers, added: spinda; removed: bgamari.
This revision is now accepted and ready to land.Dec 7 2015, 8:26 AM
bgamari updated this revision to Diff 5563.Dec 8 2015, 7:55 AM
bgamari marked an inline comment as done.

Fix TH

bgamari updated this revision to Diff 5566.Dec 8 2015, 9:14 AM

Should compile now

bgamari updated this revision to Diff 5567.Dec 8 2015, 9:18 AM
  • Fix release notes
bgamari updated this revision to Diff 5623.Dec 11 2015, 7:08 PM
  • Fix
  • Fix tests
  • Fix release notes
  • Fix

@goldfire, any last requests on this?

No. Ship it!

This revision was automatically updated to reflect the committed changes.