Closed Lev135 closed 1 year ago
Hi @Lev135
I tried to recreate it, but it seems to work fine with current master
(5d33243
) :thinking:
Sample file:
module MapM (foo, foo2, foo3) where
foo f x = sequence (fmap f x)
foo2 f = sequence . fmap f
foo3 f x = sequence (f <$> x)
$ stack exec -- hlint MapM.hs
MapM.hs:3:11-29: Warning: Use mapM
Found:
sequence (fmap f x)
Perhaps:
mapM f x
MapM.hs:5:10-26: Warning: Use mapM
Found:
sequence . fmap f
Perhaps:
mapM f
MapM.hs:7:12-29: Warning: Use mapM
Found:
sequence (f <$> x)
Perhaps:
mapM f x
3 hints
HLint 3.4.1 indeed suggests mapM
for sequence (f <$> a)
. Closing the issue.
Sorry for disturbing you. I really have an old version.
Hlint suggests to replace
sequence . fmap f
andsequence (fmap f a)
withmapM
, but it doesn't forsequence (f <$> a)
. Is there any reason not to do so or this case is just accidently missed?