WIP: Basic support for explicitly typed smart constructors in pattern synonyms. (#14602)
This MR implements the accepted GHC Proposal 42: Pattern synonym construction function signatures
Ticket: #14602
Developer
That proposal links #14602 at the top. Things remaining to do:
- Some manner of restriction of the type that the smart constructor is allowed to have; it's presently allowed to be anything and this lets it be defined in a way which is completely unrelated to the pattern, which is probably not good for anyone's sanity
- HIE support currently ignores the new optional type, probably shouldn't
- Template Haskell support
- A handful of tests
- Documentation
Thank you for your contribution to GHC!
Please take a few moments to verify that your commits fulfill the following:
-
are either individually buildable or squashed -
have commit messages which describe what they do (referring to Notes and tickets using #NNNN
syntax when appropriate) -
have added source comments describing your change. For larger changes you likely should add a Note and cross-reference it from the relevant places. -
add a testcase to the testsuite. -
replace this message with a description motivating your change
If you have any questions don't hesitate to open your merge request and inquire
in a comment. If your patch isn't quite done yet please do add prefix your MR
title with WIP:
.