Case split plugin - #5014
Conversation
|
Everybody is eagerly anticipating this change, thank you! Given the many WIP commits, I just wanted to ask if you could sqaush or reword them. I guess you had this in mind anyways. |
Glad to hear that!
Yep, see 3rd paragraph at the top :P |
|
Ah, the second sub-clause :-P my attention had already shifted before that one, I apologize :-)! Thanks! |
5456d10 to
038348b
Compare
MangoIV
left a comment
There was a problem hiding this comment.
First pass. I think after you clean up the main logic a bit more and add some documentation there, I can take another look. :)
Very good work, looking forward to having this in HLS!
82aad14 to
c7f9b61
Compare
There was a problem hiding this comment.
Very nice, this looks like it is making great progress!
I reviewed the plugin, I have mostly comments regarding readability and suggestions for improvements that hopefully improve the maintainability in the long run.
Some things are nitpicks, and you should feel free to ignore them.
I think we need one Note that outlines what the implementation strategy of the case split plugin is (e.g., reads the structured error message, etc...) so that it is easier to tell what the individual steps for case splitting are.
1fe48da to
38c773c
Compare
This PR is for (re-¹)introducing the so called case-split plugin, as requested in #5013, and it is part of my project for GSoC 2026.
To see the full summary of the project, click here. The summary also contains a list of stretch goals, some of which have been addressed already.
The work I've done and that I plan to submit via the present pull request, has consisted mainly of:
ghc-exactprintfor correctly layout out the patterns to be inserted,The result of such work is a plugin providing a code action for adding missing patterns to a
case/\caseexpression that has a non-exhaustive list of patterns.For instance, the plugin turns this
into this
¹ Earlier attempts
Indeed, there were some earlier attempts. See the summary for some pointers.