summaryrefslogtreecommitdiff
path: root/compiler/parser/Parser.y.pp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser/Parser.y.pp')
-rw-r--r--compiler/parser/Parser.y.pp12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 45b0a2bccc..4773e9be6a 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -829,12 +829,15 @@ role : VARID { L1 $ Just $ getVARID $1 }
pattern_synonym_decl :: { LHsDecl RdrName }
: 'pattern' pat '=' pat
{% do { (name, args) <- splitPatSyn $2
- ; return $ LL . ValD $ mkPatSynBind name args $4 ImplicitBidirectional
- }}
+ ; return $ LL . ValD $ mkPatSynBind name args $4 ImplicitBidirectional }}
| 'pattern' pat '<-' pat
{% do { (name, args) <- splitPatSyn $2
- ; return $ LL . ValD $ mkPatSynBind name args $4 Unidirectional
- }}
+ ; return . LL $ ValD $ mkPatSynBind name args $4 Unidirectional }}
+
+pattern_synonym_sig :: { LSig RdrName }
+ : 'pattern' 'type' ctype '::' ctype
+ {% do { (name, details, ty, prov, req) <- splitPatSynSig $3 $5
+ ; return . LL $ PatSynSig name details ty prov req }}
vars0 :: { [Located RdrName] }
: {- empty -} { [] }
@@ -1445,6 +1448,7 @@ sigdecl :: { Located (OrdList (LHsDecl RdrName)) }
{ LL $ toOL [ LL $ SigD (TypeSig ($1 : reverse (unLoc $3)) $5) ] }
| infix prec ops { LL $ toOL [ LL $ SigD (FixSig (FixitySig n (Fixity $2 (unLoc $1))))
| n <- unLoc $3 ] }
+ | pattern_synonym_sig { LL . unitOL $ LL . SigD . unLoc $ $1 }
| '{-# INLINE' activation qvar '#-}'
{ LL $ unitOL (LL $ SigD (InlineSig $3 (mkInlinePragma (getINLINE $1) $2))) }
| '{-# SPECIALISE' activation qvar '::' sigtypes1 '#-}'