Template Haskell support for unboxed sums
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 23 Aug 2016 18:20:36 +0000 (14:20 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 23 Aug 2016 19:35:18 +0000 (15:35 -0400)
commit613d745523f181991f6f916bbe58082b7970f7e6
treeb93c010d19b953271a828eb97fa8fcdb05c2a8c7
parent1766bb3cfd1460796c78bd5651f89d53603586f9
Template Haskell support for unboxed sums

This adds new constructors `UnboxedSumE`, `UnboxedSumT`, and
`UnboxedSumP` to represent unboxed sums in Template Haskell.

One thing you can't currently do is, e.g., `reify ''(#||#)`, since I
don't believe unboxed sum type/data constructors can be written in
prefix form.  I will look at fixing that as part of #12514.

Fixes #12478.

Test Plan: make test TEST=T12478_{1,2,3}

Reviewers: osa1, goldfire, austin, bgamari

Reviewed By: goldfire, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2448

GHC Trac Issues: #12478
18 files changed:
compiler/deSugar/DsMeta.hs
compiler/hsSyn/Convert.hs
compiler/prelude/THNames.hs
compiler/typecheck/TcSplice.hs
docs/users_guide/8.2.1-notes.rst
libraries/template-haskell/Language/Haskell/TH.hs
libraries/template-haskell/Language/Haskell/TH/Lib.hs
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
libraries/template-haskell/changelog.md
testsuite/tests/th/T12478_1.hs [new file with mode: 0644]
testsuite/tests/th/T12478_1.stdout [new file with mode: 0644]
testsuite/tests/th/T12478_2.hs [new file with mode: 0644]
testsuite/tests/th/T12478_2.stdout [new file with mode: 0644]
testsuite/tests/th/T12478_3.hs [new file with mode: 0644]
testsuite/tests/th/T12478_4.hs [new file with mode: 0644]
testsuite/tests/th/T12478_4.stderr [new file with mode: 0644]
testsuite/tests/th/all.T