Skip to content
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

Suggest less liftM #132

Closed
ndmitchell opened this issue May 30, 2015 · 3 comments
Closed

Suggest less liftM #132

ndmitchell opened this issue May 30, 2015 · 3 comments

Comments

@ndmitchell
Copy link
Owner

From #131 @watashi asked "In there any plan for hlint to suggest fmap or <$> instead of liftM in future? As ghc 7.10 is released, Functor is a supperclass of Monad now according to Functor-Applicative-Monad Proposal". I replied:

Yes, I'd be happy to do that now (specifically a ticket for me to do in future, or a patch from someone else doing it now). Taking a quick look, where I have patterns that match on liftM they should probably match on both fmap and <$> as well as liftM. For the liftM fusion rule, there should probably be fmap and <$> versions which stick to producing the same. Where I suggest something it should never be liftM. The only debate is if to suggest liftM ==> fmap, and I think my inclination is that's now a good idea too - I certainly never use liftM.

@watashi
Copy link
Contributor

watashi commented May 30, 2015

I love the idea of deprecating liftM. It's usually a good suggestion to follow and it will also reduce the number of "equivalent" or "duplicate" rules in hlint.

@ndmitchell
Copy link
Owner Author

True - if we have the rule to avoid liftM, we don't need to match on it - I hadn't thought of that.

@ndmitchell
Copy link
Owner Author

All done now, one hint to replace liftM with fmap, and all other liftM hints now suggest fmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants