Allow as-patterns in unidirectional patttern synonyms
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 21 Mar 2018 17:21:15 +0000 (17:21 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 21 Mar 2018 17:34:52 +0000 (17:34 +0000)
commit411a97e2c0083529b4259d0cad8f453bae110dee
treec84731b7c3bb2513910da88a2e782edd6dcce5c9
parent49ac3f0f2a13f66fea31a258fa98b0de39bfbf10
Allow as-patterns in unidirectional patttern synonyms

This patch implements GHC Proposal #94, described here
   https://github.com/ghc-proposals/ghc-proposals/pull/94

The effect is simply to lift a totally-undocumented restriction to
unidirecional pattern synonyms, namely that they can't have as-patterns
or n+k patterns.

The fix is easy: just remove the checks.

I also took the opportunity to improve the manual entry for
the semantics of pattern matching for pattern synonyms.
compiler/typecheck/TcPatSyn.hs
docs/users_guide/glasgow_exts.rst
testsuite/tests/patsyn/should_fail/all.T
testsuite/tests/patsyn/should_fail/as-pattern.hs
testsuite/tests/patsyn/should_fail/as-pattern.stderr [deleted file]