Skip to content

Commit 6ee004e

Browse files
authored
Merge pull request ndmitchell#1569 from jvoigtlaender/toList
avoid redundant toList-calls
2 parents 2839fe8 + 433f981 commit 6ee004e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

data/hlint.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,32 @@
903903
- hint: {lhs: foldr f z (fmap g x), rhs: foldr (f . g) z x, name: Fuse foldr/fmap}
904904
- hint: {lhs: foldr f z (g <$> x), rhs: foldr (f . g) z x, name: Fuse foldr/<$>}
905905
- hint: {lhs: foldr f z (x <&> g), rhs: foldr (f . g) z x, name: Fuse foldr/<&>}
906+
- warn: {lhs: fold (Data.Foldable.toList x), rhs: fold x}
907+
- warn: {lhs: foldMap f (Data.Foldable.toList x), rhs: foldMap f x}
908+
- warn: {lhs: foldMap' f (Data.Foldable.toList x), rhs: foldMap' f x}
909+
- warn: {lhs: foldr f z (Data.Foldable.toList x), rhs: foldr f z x}
910+
- warn: {lhs: foldr' f z (Data.Foldable.toList x), rhs: foldr' f z x}
911+
- warn: {lhs: foldl f z (Data.Foldable.toList x), rhs: foldl f z x}
912+
- warn: {lhs: foldl' f z (Data.Foldable.toList x), rhs: foldl' f z x}
913+
- warn: {lhs: foldr1 f (Data.Foldable.toList x), rhs: foldr1 f x}
914+
- warn: {lhs: foldl1 f (Data.Foldable.toList x), rhs: foldl1 f x}
915+
- warn: {lhs: null (Data.Foldable.toList x), rhs: null x}
916+
- warn: {lhs: length (Data.Foldable.toList x), rhs: length x}
917+
- warn: {lhs: elem y (Data.Foldable.toList x), rhs: elem y x}
918+
- warn: {lhs: notElem y (Data.Foldable.toList x), rhs: notElem y x}
919+
- warn: {lhs: maximum (Data.Foldable.toList x), rhs: maximum x}
920+
- warn: {lhs: minimum (Data.Foldable.toList x), rhs: minimum x}
921+
- warn: {lhs: maximumBy f (Data.Foldable.toList x), rhs: maximumBy f x}
922+
- warn: {lhs: minimumBy f (Data.Foldable.toList x), rhs: minimumBy f x}
923+
- warn: {lhs: sum (Data.Foldable.toList x), rhs: sum x}
924+
- warn: {lhs: product (Data.Foldable.toList x), rhs: product x}
925+
- warn: {lhs: and (Data.Foldable.toList x), rhs: and x}
926+
- warn: {lhs: or (Data.Foldable.toList x), rhs: or x}
927+
- warn: {lhs: all f (Data.Foldable.toList x), rhs: all f x}
928+
- warn: {lhs: any f (Data.Foldable.toList x), rhs: any f x}
929+
- warn: {lhs: find f (Data.Foldable.toList x), rhs: find f x}
930+
- warn: {lhs: concat (Data.Foldable.toList x), rhs: concat x}
931+
- warn: {lhs: concatMap f (Data.Foldable.toList x), rhs: concatMap f x}
906932

907933
# STATE MONAD
908934

0 commit comments

Comments
 (0)