Commit 58e05c8c authored by Matthew Pickering's avatar Matthew Pickering Committed by Ben Gamari
Browse files

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 c3a496d7
......@@ -1058,7 +1058,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
......@@ -21,3 +21,4 @@ test('T8968-3', normal, compile, [''])
test('ImpExp_Imp', [extra_clean(['ImpExp_Exp.hi', 'ImpExp_Exp.o'])], multimod_compile, ['ImpExp_Imp', '-v0'])
test('T9857', normal, compile, [''])
test('T9889', 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