summaryrefslogtreecommitdiff
path: root/compiler/basicTypes/PatSyn.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-12-22 14:33:35 +0100
committerBen Gamari <ben@smart-cactus.org>2015-12-22 14:34:36 +0100
commitf40e122b7709c11d4ad20fd5cb26bf719235dbf1 (patch)
treea335cef2c5f5ff1a1a0f6dc57aef45937c18d864 /compiler/basicTypes/PatSyn.hs
parent29928f29d53cfc7aceb7e8ab81967f784cf06159 (diff)
downloadhaskell-f40e122b7709c11d4ad20fd5cb26bf719235dbf1.tar.gz
Fix typechecking for pattern synonym signatures
Various tickets have revealed bad shortcomings in the typechecking of pattern type synonyms. Discussed a lot in (the latter part of) Trac #11224. This patch fixes the most complex issues: - Both parser and renamer now treat pattern synonyms as an ordinary LHsSigType. Nothing special. Hooray. - tcPatSynSig (now in TcPatSyn) typechecks the signature, and decomposes it into its pieces. See Note [Pattern synonym signatures] - tcCheckPatSyn has had a lot of refactoring. See Note [Checking against a pattern signature] The result is a lot tidier and more comprehensible. Plus, it actually works! NB: this patch doesn't actually address the precise target of #11224, namely "inlining pattern synonym does not preserve semantics". That's an unrelated bug, with a separate patch. ToDo: better documentation in the user manual Test Plan: Validate Reviewers: austin, hvr, goldfire Subscribers: goldfire, mpickering, thomie, simonpj Differential Revision: https://phabricator.haskell.org/D1685 GHC Trac Issues: #11224
Diffstat (limited to 'compiler/basicTypes/PatSyn.hs')
-rw-r--r--compiler/basicTypes/PatSyn.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/basicTypes/PatSyn.hs b/compiler/basicTypes/PatSyn.hs
index b7aff18534..c35bcf3e13 100644
--- a/compiler/basicTypes/PatSyn.hs
+++ b/compiler/basicTypes/PatSyn.hs
@@ -159,8 +159,8 @@ so pattern P has type
with the following typeclass constraints:
- provides: (Show (Maybe t), Ord b)
requires: (Eq t, Num t)
+ provides: (Show (Maybe t), Ord b)
In this case, the fields of MkPatSyn will be set as follows: