diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-10-24 13:52:36 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-07 08:39:36 -0500 |
commit | 708c60aa144ed68a5b67a61f16539258dbcdb24e (patch) | |
tree | 1c73dfe7395871f7986eb12701d19b46825f3f39 /docs | |
parent | b4fb232892ec420059e767bbf464bd09361aaefa (diff) | |
download | haskell-708c60aa144ed68a5b67a61f16539258dbcdb24e.tar.gz |
Clean up TH's treatment of unary tuples (or, #16881 part two)
!1906 left some loose ends in regards to Template Haskell's treatment
of unary tuples. This patch ends to tie up those loose ends:
* In addition to having `TupleT 1` produce unary tuples, `TupE [exp]`
and `TupP [pat]` also now produce unary tuples.
* I have added various special cases in GHC's pretty-printers to
ensure that explicit 1-tuples are printed using the `Unit` type.
See `testsuite/tests/th/T17380`.
* The GHC 8.10.1 release notes entry has been tidied up a little.
Fixes #16881. Fixes #17371. Fixes #17380.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/8.10.1-notes.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/users_guide/8.10.1-notes.rst b/docs/users_guide/8.10.1-notes.rst index b405520c70..5e7356ab2c 100644 --- a/docs/users_guide/8.10.1-notes.rst +++ b/docs/users_guide/8.10.1-notes.rst @@ -219,9 +219,12 @@ Template Haskell :extension:`DeriveLift` has been simplified to take advantage of expression quotations. -- Explicit boxed 1-tuples from ``HsSyn`` are now treated as actual 1-tuples, - without flattening. In most of the cases these will be obtained using - Template Haskell since it is uncommon to deal with 1-tuples in the source. +- Using ``TupleT 1``, ``TupE [exp]``, or ``TupP [pat]`` will now produce unary + tuples (i.e., involving the ``Unit`` type from ``GHC.Tuple``) instead of + silently dropping the parentheses. This brings Template Haskell's treatment + of boxed tuples in line with that of unboxed tuples, as ``UnboxedTupleT`, + ``UnboxedTupE``, and ``UnboxedTupP`` also produce unary unboxed tuples + (i.e., ``Unit#``) when applied to only one argument. - GHC's constraint solver now solves constraints in each top-level group sooner. This has practical consequences for Template Haskell, as TH splices |