RE: Implementing pattern synonym constructor signatures

0. Parsing. I wasn't actually able to find the code that parses pattern synonyms. Can someone point me in the right direction?
Parser.y line 1356, production ‘patteron_synonym_decl’ looks plausible.
Currently we have
data HsPatSynDir id
= Unidirectional
| ImplicitBidirectional
| ExplicitBidirectional (MatchGroup id (LHsExpr id))
so in the bidirectional case all we have a MatchGroup, built with mkPatSynMatchGroup. To serve the proposal we need an optional signature in there too.
1. When there is a constructor signature, it needs to be used for the construction function instead of the pattern signature. Can someone give point me in the right direction about how to do this?
TcPatSyn.tcPatSynBuilderBind is a good place to start.
2. When there is a constructor signature but no pattern signature, what should we do? I think "give up" sounds okay for now.
I don’t understand. Can you give an example?
Simon
From: David Feuer [mailto:david@well-typed.com]
Sent: 15 January 2018 19:11
To: Simon Peyton Jones

3. Someone could write
pattern P x <- ... where P :: ... P x = ...
The pattern signature has to be the same as the constructor signature except for constraints, so it doesn't necessarily sound trivial to infer.
David FeuerWell-Typed, LLP
-------- Original message --------From: Simon Peyton Jones
participants (2)
-
David Feuer
-
Simon Peyton Jones