ndmitchell / hlint

Haskell source code suggestions
Other
1.48k stars 195 forks source link

Incorrect foldr hint #1511

Closed hw202207 closed 1 year ago

hw202207 commented 1 year ago

I meant this suggestion

<td>Use foldr</td>
<td>
LHS:
<code>
foldr f z (concat x)
</code>
<br>
RHS:
<code>
foldr (foldr f) z x
</code>

Here is my reasoning

Which version report this hint?

gruhn commented 1 year ago

You're right and I think the same applies to:

Use foldr LHS: foldr f z (concatMap g x)
RHS:foldr (foldr f . g) z x
Suggestion

I removed both rules: #1520