ndmitchell / hlint

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

Suggest foldable changes #305

Open ndmitchell opened 7 years ago

ndmitchell commented 7 years ago

Suggestion from @nilthehuman.

Instead of "Data.Foldable.any id" => Why not Data.Foldable.or ? Instead of "Data.Foldable.all id" => Why not Data.Foldable.and ?

Very sensible - in fact, I should probably let hlint know that Data.Foldable.all is Data.List.all, so it can apply the hint to all of them.

nilthehuman commented 7 years ago

One more:

"mconcat . map f" => Why not foldMap f ?

ndmitchell commented 7 years ago

Yep, good point.