Commit 69a6e425 authored by Matthew Pickering's avatar Matthew Pickering Committed by Austin Seipp

Allow non-operator infix pattern synonyms

For example

```
pattern head `Cons` tail = head : tail
```

Reviewed By: goldfire, austin

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

GHC Trac Issues: #10747
parent 7b443bb1
......@@ -1148,7 +1148,7 @@ pattern_synonym_decl :: { LHsDecl RdrName }
pattern_synonym_lhs :: { (Located RdrName, HsPatSynDetails (Located RdrName)) }
: con vars0 { ($1, PrefixPatSyn $2) }
| varid consym varid { ($2, InfixPatSyn $1 $3) }
| varid conop varid { ($2, InfixPatSyn $1 $3) }
vars0 :: { [Located RdrName] }
: {- empty -} { [] }
......
{-# LANGUAGE PatternSynonyms #-}
module T10747 where
pattern head `Cons` tail = head : tail
......@@ -24,3 +24,4 @@ test('T9889', normal, compile, [''])
test('T9867', normal, compile, [''])
test('T9975a', normal, compile_fail, [''])
test('T9975b', normal, compile, [''])
test('T10747', normal, compile, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment