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
Interesting reduction not caught by hlint. #110
Comments
Thanks for the bug report. Running your example, I get:
That's using version 1.9.16. Do you see any suggestions for your original input? |
Oops, so I guess it seems when the function has a wildcard instead of a named variable is when it fails. This works: pam :: a -> [a -> b] -> [b]
pam a (f:fs) = f a : pam a fs
pam a [] = [] This doesn't: pam :: a -> [a -> b] -> [b]
pam a (f:fs) = f a : pam a fs
pam _ [] = [] |
I have a custom recogniser for these types of expression, it just needs generalizing a little. Three examples which don't match but which should are:
|
Interesting! Seems like you know about it and this issue is probably redundant. On my end it's really not a game-ending issue, so no reason to keep this thing around. Thanks for the speedy replies! Well either way thanks a bunch for this super great project! I can't imagine life without it! |
Nope, I only investigated after your report, and I'll use this ticket to record the cases I should still do better. |
Oh! Sounds great! |
Should hlint further suggest pam a = map ($ a) or even pam = map . flip ($) ? |
Yes, I would agree if generalize is turned on, it would be good to have those suggestions recommended. |
The final For reducing |
So I have this function:
I was able to reduce it to:
Sadly hlint didn't catch this reduction(Although it's able to catch a whole bunch of other reductions in my code any other day!), maybe this might lighten the way for a whole set of new reductions? Thanks for the awesome tool!
The text was updated successfully, but these errors were encountered: