-
Notifications
You must be signed in to change notification settings - Fork 94
Add support for LambdaCase #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes exact printing and the broken test.
Two comments, one easier to fix than the other. First, there's a discrepancy in the parser vs the exact-printer. You treat the '' 'case' as two different lexemes (like GHC does), but the exact-printer treats them as a single "printeme". That means that the last of your commits should be un-done, and the exact-printer updated accordingly. Test code: foo = \ case { _ -> True } Second, and much harder to fix, GHC allows I would be happy to merge the patch even without support for this though, but we shouldn't forget that the problem isn't fixed. |
Conflicts: Test/failing.txt
This reverts commit 3628874.
I tried to come up with a relevant test case for your second point but was unsuccessful. I didn't get anything to work in GHC, maybe I've not understood the extension properly. Maybe it should be noted as a bug report as well, I could make one. |
Note that users in HLint are asking for this feature, so it would be useful. |
+1, this is important for stylish-haskell, verified that building it against this works. |
Merging based on @niklasbroberg initial feedback and popular demand. @niklasbroberg regarding your second point — please open a separate issue with a test case. @daoo — thanks for your work and patience :) |
Add support for LambdaCase
Is there a timescale for uploading a fresh release to hackage that'll incorporate this merged commit? An increasing number of users (e.g. hlint users) may stumble into this problem as use of LambdaCase become more frequent. I don't think the 1.14.0.1 version on hackage reflects this commit. |
Initially I was going to wait for #54 / #90 to get reviewed/merged in, but I don't have much free time now (and neither does @niklasbroberg), so maybe I should release what we have by now. Hopefully will do it this weekend, then. |
@feuerbach That's fine with me - feel free to ping me to rebase the changes in #90 atop whatever gets released. |
Version 1.15.0.1 on Hackage contains the Was it forgotten to update that? |
Updated the readme. |
Implemented support for the LambdaCase extension by adding a new expression constructor (LCase).
I have tested this with hlint, and it worked (!).
I'm eagerly waiting for comments/input on how to improve this patch.