[commit: ghc] master: Parse the (!) type operator and allow type operators in existential context (bd78985)
git at git.haskell.org
git at git.haskell.org
Thu Oct 4 13:28:40 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/bd7898537768f936d05c0c83eef1cd9b00933347/ghc
>---------------------------------------------------------------
commit bd7898537768f936d05c0c83eef1cd9b00933347
Author: Vladislav Zavialov <vlad.z.4096 at gmail.com>
Date: Thu Oct 4 09:17:55 2018 -0400
Parse the (!) type operator and allow type operators in existential context
Summary:
Improve the way `(!)`, `(~)`, and other type operators are handled in the parser,
fixing two issues at once:
1. `(!)` can now be used as a type operator
that respects fixity and precedence (#15457)
2. Existential context of a data constructor
no longer needs parentheses (#15675)
In addition to that, with this patch it is now trivial to adjust precedence of
the `{-# UNPACK #-}` pragma, as suggested in
https://ghc.haskell.org/trac/ghc/ticket/14761#comment:7
There was a small change to API Annotations. Before this patch, `(~)` was a
strange special case that produced an annotation unlike any other type
operator. After this patch, when `(~)` or `(!)` are used to specify strictness they
produce AnnTilde and AnnBang annotations respectively, and when they are used
as type operators, they produce no annotations.
Test Plan: Validate
Reviewers: simonpj, bgamari, alanz, RyanGlScott
Reviewed By: RyanGlScott
Subscribers: RyanGlScott, rwbarton, mpickering, carter
GHC Trac Issues: #15457, #15675
Differential Revision: https://phabricator.haskell.org/D5180
>---------------------------------------------------------------
bd7898537768f936d05c0c83eef1cd9b00933347
compiler/parser/Lexer.x | 20 +-
compiler/parser/Parser.y | 156 +++---
compiler/parser/RdrHsSyn.hs | 566 ++++++++++++++++-----
docs/users_guide/8.8.1-notes.rst | 10 +
testsuite/tests/ghc-api/annotations/T11321.stdout | 2 -
testsuite/tests/ghci/prog006/prog006.stderr | 7 +-
testsuite/tests/parser/should_compile/T15457.hs | 12 +
testsuite/tests/parser/should_compile/T15675.hs | 13 +
testsuite/tests/parser/should_compile/all.T | 2 +
testsuite/tests/parser/should_fail/T3811b.stderr | 5 +-
testsuite/tests/parser/should_fail/T3811c.stderr | 8 +-
testsuite/tests/parser/should_fail/T3811f.stderr | 5 +-
testsuite/tests/parser/should_fail/all.T | 4 +
.../parser/should_fail/strictnessDataCon_A.hs | 1 +
.../parser/should_fail/strictnessDataCon_A.stderr | 3 +
.../parser/should_fail/strictnessDataCon_B.hs | 1 +
.../parser/should_fail/strictnessDataCon_B.stderr | 3 +
.../tests/parser/should_fail/typeopsDataCon_A.hs | 1 +
.../parser/should_fail/typeopsDataCon_A.stderr | 4 +
.../tests/parser/should_fail/typeopsDataCon_B.hs | 1 +
.../parser/should_fail/typeopsDataCon_B.stderr | 2 +
.../tests/rename/should_fail/rnfail053.stderr | 7 +-
.../tests/typecheck/should_fail/T14761a.stderr | 10 +-
.../tests/typecheck/should_fail/T14761b.stderr | 10 +-
testsuite/tests/typecheck/should_fail/T7210.stderr | 10 +-
testsuite/tests/typecheck/should_fail/T9634.stderr | 5 +-
26 files changed, 606 insertions(+), 262 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bd7898537768f936d05c0c83eef1cd9b00933347
More information about the ghc-commits
mailing list