Open complyue opened 3 years ago
Agreed that this not firing for lambda case makes sense. I wonder if it's more general - perhaps anywhere that ends up introducing brackets around either g
or f
?
Eliminating redundant fmap
s is a performance win for some Functor
s, so that hint isn't just supposed to be for readability. Is there some alternative way we could rewrite it, rather than removing the hint in that case altogether?
Or the suggestion may be sth like this?
chkQue :: STM ()
chkQue =
(swapTVar backlog fifoEmpty >>=) $
(. fifoDeque) $ \case
(Nothing, _) -> finallyDone
!more -> go more
I personally like this form to get rid of fmap
.
Regarding this hint:
I'm against the suggestion as I feel
<$>
working with the lambda case reads more pleasing (especially when the branches of the cases go rather lengthy):(as formatted by Ormolu FYI)
I'm not sure if it is produced due to
from #949 ?
And would you agree to silent it in presence of lambda cases?
I'm using
{- HLINT ignore "Redundant <$>" -}
to disable it for now, but think it's desirable for cases without lambda case.