ndmitchell / hlint

Haskell source code suggestions
Other
1.45k stars 194 forks source link

avoid redundant toList-calls #1569

Open jvoigtlaender opened 5 months ago

jvoigtlaender commented 5 months ago

This is per the hint

If the entire list is intended to be reduced via a fold, just fold the structure directly bypassing the list.

from the documentation: https://hackage.haskell.org/package/base-4.19.0.0/docs/Data-Foldable.html#v:toList