-
Notifications
You must be signed in to change notification settings - Fork 0
/
.hlint.yaml
1058 lines (1000 loc) · 59.2 KB
/
.hlint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
- package:
name: base
modules:
- import Prelude
- import Control.Arrow
- import Control.Exception
- import Control.Monad
- import Control.Monad.Trans.State
- import qualified Data.Foldable
- import Data.Foldable(asum, sequenceA_, traverse_, for_)
- import Data.Traversable(traverse, for)
- import Control.Applicative
- import Data.Bifunctor
- import Data.Function
- import Data.Int
- import Data.Char
- import Data.List as Data.List
- import Data.List as X
- import Data.Maybe
- import Data.Monoid
- import System.IO
- import Control.Concurrent.Chan
- import System.Mem.Weak
- import Control.Exception.Base
- import System.Exit
- import Data.Either
- import Numeric
- import IO as System.IO
- import List as Data.List
- import Maybe as Data.Maybe
- import Monad as Control.Monad
- import Char as Data.Char
- import Language.Haskell.TH as TH
- package:
name: lens
modules:
- import Control.Lens
- import Control.Lens.Operators
- import Control.Monad.Reader
- package:
name: attoparsec
modules:
- import Data.Attoparsec.Text
- import Data.Attoparsec.ByteString
- package:
name: quickcheck
modules:
- import Test.QuickCheck
- package:
name: codeworld-api
modules:
- import CodeWorld
- group:
name: default
enabled: true
imports:
- package base
rules:
- warn: {lhs: putStrLn (show x), rhs: print x}
- warn: {lhs: putStr (x ++ "\n"), rhs: putStrLn x}
- warn: {lhs: putStr (x ++ y ++ "\n"), rhs: putStrLn (x ++ y)}
- warn: {lhs: mapM_ putChar, rhs: putStr}
- warn: {lhs: hGetChar stdin, rhs: getChar}
- warn: {lhs: hGetLine stdin, rhs: getLine}
- warn: {lhs: hGetContents stdin, rhs: getContents}
- warn: {lhs: hPutChar stdout, rhs: putChar}
- warn: {lhs: hPutStr stdout, rhs: putStr}
- warn: {lhs: hPutStrLn stdout, rhs: putStrLn}
- warn: {lhs: hPrint stdout, rhs: print}
- warn: {lhs: hWaitForInput a 0, rhs: hReady a}
- warn: {lhs: hPutStrLn a (show b), rhs: hPrint a b}
- warn: {lhs: hIsEOF stdin, rhs: isEOF}
- warn: {lhs: withFile f WriteMode (\h -> hPutStr h x), rhs: writeFile f x}
- warn: {lhs: withFile f WriteMode (\h -> hPutStrLn h x), rhs: writeFile f (x ++ "\n")}
- warn: {lhs: withFile f AppendMode (\h -> hPutStr h x), rhs: appendFile f x}
- warn: {lhs: withFile f AppendMode (\h -> hPutStrLn h x), rhs: appendFile f (x ++ "\n")}
- warn: {lhs: exitWith ExitSuccess, rhs: exitSuccess}
- warn: {lhs: not (a == b), rhs: a /= b, note: incorrect if either value is NaN}
- warn: {lhs: not (a /= b), rhs: a == b, note: incorrect if either value is NaN}
- warn: {lhs: not (a > b), rhs: a <= b, note: incorrect if either value is NaN}
- warn: {lhs: not (a >= b), rhs: a < b, note: incorrect if either value is NaN}
- warn: {lhs: not (a < b), rhs: a >= b, note: incorrect if either value is NaN}
- warn: {lhs: not (a <= b), rhs: a > b, note: incorrect if either value is NaN}
- warn: {lhs: compare x y /= GT, rhs: x <= y}
- warn: {lhs: compare x y == LT, rhs: x < y}
- warn: {lhs: compare x y /= LT, rhs: x >= y}
- warn: {lhs: compare x y == GT, rhs: x > y}
- warn: {lhs: compare x y == EQ, rhs: x == y}
- warn: {lhs: compare x y /= EQ, rhs: x /= y}
- warn: {lhs: head (sort x), rhs: minimum x}
- warn: {lhs: last (sort x), rhs: maximum x}
- warn: {lhs: head (sortBy f x), rhs: minimumBy f x, side: isCompare f}
- warn: {lhs: last (sortBy f x), rhs: maximumBy f x, side: isCompare f}
- warn: {lhs: reverse (sortBy f x), rhs: sortBy (flip f) x, name: Avoid reverse, side: isCompare f, note: Stabilizes sort order}
- warn: {lhs: sortBy (flip (comparing f)), rhs: sortBy (comparing (Data.Ord.Down . f))}
- warn: {lhs: reverse (sortOn f x), rhs: sortOn (Data.Ord.Down . f) x, name: Avoid reverse, note: Stabilizes sort order}
- warn: {lhs: reverse (sort x), rhs: sortBy (comparing Data.Ord.Down) x, name: Avoid reverse, note: Stabilizes sort order}
- hint: {lhs: flip (g `on` h), rhs: flip g `on` h, name: Move flip}
- hint: {lhs: (f `on` g) `on` h, rhs: f `on` (g . h), name: Fuse on/on}
- warn: {lhs: if a >= b then a else b, rhs: max a b}
- warn: {lhs: if a >= b then b else a, rhs: min a b}
- warn: {lhs: if a > b then a else b, rhs: max a b}
- warn: {lhs: if a > b then b else a, rhs: min a b}
- warn: {lhs: if a <= b then a else b, rhs: min a b}
- warn: {lhs: if a <= b then b else a, rhs: max a b}
- warn: {lhs: if a < b then a else b, rhs: min a b}
- warn: {lhs: if a < b then b else a, rhs: max a b}
- warn: {lhs: "maximum [a, b]", rhs: max a b}
- warn: {lhs: "minimum [a, b]", rhs: min a b}
- warn: {lhs: showsPrec 0 x "", rhs: show x}
- warn: {lhs: "showsPrec 0 x []", rhs: show x}
- warn: {lhs: readsPrec 0, rhs: reads}
- warn: {lhs: showsPrec 0, rhs: shows}
- hint: {lhs: showIntAtBase 16 intToDigit, rhs: showHex}
- hint: {lhs: showIntAtBase 8 intToDigit, rhs: showOct}
- warn: {lhs: concat (map f x), rhs: concatMap f x}
- warn: {lhs: concat (f <$> x), rhs: concatMap f x}
- warn: {lhs: concat (fmap f x), rhs: concatMap f x}
- hint: {lhs: "concat [a, b]", rhs: a ++ b}
- hint: {lhs: map f (map g x), rhs: map (f . g) x, name: Use map once}
- hint: {lhs: concatMap f (map g x), rhs: concatMap (f . g) x, name: Fuse concatMap/map}
- hint: {lhs: x !! 0, rhs: head x}
- warn: {lhs: take n (repeat x), rhs: replicate n x}
- warn: {lhs: map f (replicate n x), rhs: replicate n (f x)}
- warn: {lhs: map f (repeat x), rhs: repeat (f x)}
- warn: {lhs: "cycle [x]", rhs: repeat x}
- warn: {lhs: head (reverse x), rhs: last x}
- warn: {lhs: last (reverse x), rhs: head x, note: IncreasesLaziness}
- warn: {lhs: head (drop n x), rhs: x !! n, side: isNat n}
- warn: {lhs: head (drop n x), rhs: x !! max 0 n, side: not (isNat n) && not (isNeg n)}
- warn: {lhs: reverse (init x), rhs: tail (reverse x)}
- warn: {lhs: reverse (tail (reverse x)), rhs: init x, note: IncreasesLaziness}
- warn: {lhs: reverse (reverse x), rhs: x, note: IncreasesLaziness, name: Avoid reverse}
- warn: {lhs: isPrefixOf (reverse x) (reverse y), rhs: isSuffixOf x y}
- warn: {lhs: "foldr (++) []", rhs: concat}
- warn: {lhs: foldr (++) "", rhs: concat}
- warn: {lhs: "foldr ((++) . f) []", rhs: concatMap f}
- warn: {lhs: foldr ((++) . f) "", rhs: concatMap f}
- warn: {lhs: "foldl (++) []", rhs: concat, note: IncreasesLaziness}
- warn: {lhs: foldl (++) "", rhs: concat, note: IncreasesLaziness}
- warn: {lhs: foldl f (head x) (tail x), rhs: foldl1 f x}
- warn: {lhs: foldr f (last x) (init x), rhs: foldr1 f x}
- warn: {lhs: "foldr (\\c a -> x : a) []", rhs: "map (\\c -> x)"}
- warn: {lhs: foldr (.) id l z, rhs: foldr ($) z l}
- warn: {lhs: span (not . p), rhs: break p}
- warn: {lhs: break (not . p), rhs: span p}
- warn: {lhs: "(takeWhile p x, dropWhile p x)", rhs: span p x, note: DecreasesLaziness}
- warn: {lhs: fst (span p x), rhs: takeWhile p x}
- warn: {lhs: snd (span p x), rhs: dropWhile p x}
- warn: {lhs: fst (break p x), rhs: takeWhile (not . p) x}
- warn: {lhs: snd (break p x), rhs: dropWhile (not . p) x}
- warn: {lhs: "(take n x, drop n x)", rhs: splitAt n x, note: DecreasesLaziness}
- warn: {lhs: fst (splitAt p x), rhs: take p x}
- warn: {lhs: snd (splitAt p x), rhs: drop p x}
- warn: {lhs: concatMap (++ "\n"), rhs: unlines}
- warn: {lhs: map id, rhs: id}
- warn: {lhs: concatMap id, rhs: concat}
- warn: {lhs: or (map p x), rhs: any p x}
- warn: {lhs: and (map p x), rhs: all p x}
- warn: {lhs: any f (map g x), rhs: any (f . g) x}
- warn: {lhs: all f (map g x), rhs: all (f . g) x}
- warn: {lhs: "zipWith (,)", rhs: zip}
- warn: {lhs: "zipWith3 (,,)", rhs: zip3}
- hint: {lhs: map fst &&& map snd, rhs: unzip}
- hint: {lhs: length x == 0, rhs: null x, note: IncreasesLaziness}
- hint: {lhs: 0 == length x, rhs: null x, note: IncreasesLaziness}
- hint: {lhs: length x < 1, rhs: null x, note: IncreasesLaziness}
- hint: {lhs: 1 > length x, rhs: null x, note: IncreasesLaziness}
- hint: {lhs: length x <= 0, rhs: null x, note: IncreasesLaziness}
- hint: {lhs: 0 >= length x, rhs: null x, note: IncreasesLaziness}
- hint: {lhs: "x == []", rhs: null x}
- hint: {lhs: "[] == x", rhs: null x}
- hint: {lhs: all (const False), rhs: "null"}
- hint: {lhs: any (const True) x, rhs: not (null x), name: Use null}
- hint: {lhs: length x /= 0, rhs: not (null x), note: IncreasesLaziness, name: Use null}
- hint: {lhs: 0 /= length x, rhs: not (null x), note: IncreasesLaziness, name: Use null}
- hint: {lhs: "\\x -> [x]", rhs: "(:[])", name: "Use :"}
- hint: {lhs: map f (zip x y), rhs: zipWith (curry f) x y, side: not (isApp f)}
- hint: {lhs: "map f (fromMaybe [] x)", rhs: "maybe [] (map f) x"}
- warn: {lhs: not (elem x y), rhs: notElem x y}
- hint: {lhs: foldr f z (map g x), rhs: foldr (f . g) z x, name: Fuse foldr/map}
- warn: {lhs: "x ++ concatMap (' ':) y", rhs: "unwords (x:y)"}
- warn: {lhs: intercalate " ", rhs: unwords}
- hint: {lhs: concat (intersperse x y), rhs: intercalate x y, side: notEq x " "}
- hint: {lhs: concat (intersperse " " x), rhs: unwords x}
- warn: {lhs: null (concat x), rhs: all null x}
- warn: {lhs: null (filter f x), rhs: not (any f x), name: Use any}
- warn: {lhs: "filter f x == []", rhs: not (any f x), name: Use any}
- warn: {lhs: "filter f x /= []", rhs: any f x}
- warn: {lhs: any id, rhs: or}
- warn: {lhs: all id, rhs: and}
- warn: {lhs: any (not . f) x, rhs: not (all f x), name: Hoist not}
- warn: {lhs: all (not . f) x, rhs: not (any f x), name: Hoist not}
- warn: {lhs: any ((==) a), rhs: elem a, note: ValidInstance Eq a}
- warn: {lhs: any (== a), rhs: elem a}
- warn: {lhs: any (a ==), rhs: elem a, note: ValidInstance Eq a}
- warn: {lhs: all ((/=) a), rhs: notElem a, note: ValidInstance Eq a}
- warn: {lhs: all (/= a), rhs: notElem a, note: ValidInstance Eq a}
- warn: {lhs: all (a /=), rhs: notElem a, note: ValidInstance Eq a}
- warn: {lhs: elem True, rhs: or}
- warn: {lhs: notElem False, rhs: and}
- warn: {lhs: True `elem` l, rhs: or l}
- warn: {lhs: False `notElem` l, rhs: and l}
- warn: {lhs: findIndex ((==) a), rhs: elemIndex a}
- warn: {lhs: findIndex (a ==), rhs: elemIndex a}
- warn: {lhs: findIndex (== a), rhs: elemIndex a}
- warn: {lhs: findIndices ((==) a), rhs: elemIndices a}
- warn: {lhs: findIndices (a ==), rhs: elemIndices a}
- warn: {lhs: findIndices (== a), rhs: elemIndices a}
- warn: {lhs: "lookup b (zip l [0..])", rhs: elemIndex b l}
- hint: {lhs: "elem x [y]", rhs: x == y, note: ValidInstance Eq a}
- hint: {lhs: "notElem x [y]", rhs: x /= y, note: ValidInstance Eq a}
- hint: {lhs: "length [1..n]", rhs: max 0 n}
- hint: {lhs: length x >= 0, rhs: "True", name: Length always non-negative}
- hint: {lhs: 0 <= length x, rhs: "True", name: Length always non-negative}
- hint: {lhs: length x > 0, rhs: not (null x), note: IncreasesLaziness, name: Use null}
- hint: {lhs: 0 < length x, rhs: not (null x), note: IncreasesLaziness, name: Use null}
- hint: {lhs: length x >= 1, rhs: not (null x), note: IncreasesLaziness, name: Use null}
- hint: {lhs: 1 <= length x, rhs: not (null x), note: IncreasesLaziness, name: Use null}
- warn: {lhs: take i x, rhs: "[]", side: isNegZero i, name: Take on a non-positive}
- warn: {lhs: drop i x, rhs: x, side: isNegZero i, name: Drop on a non-positive}
- warn: {lhs: last (scanl f z x), rhs: foldl f z x}
- warn: {lhs: head (scanr f z x), rhs: foldr f z x}
- warn: {lhs: "scanl (\\x _ -> a) b (replicate c d)", rhs: "take c (iterate (\\x -> a) b)"}
- warn: {lhs: "foldl (\\x _ -> a) b [1..c]", rhs: "iterate (\\x -> a) b !! c"}
- warn: {lhs: iterate id, rhs: repeat}
- warn: {lhs: zipWith f (repeat x), rhs: map (f x)}
- warn: {lhs: zip (repeat x), rhs: "map (_noParen_ x,)", note: RequiresExtension TupleSections, name: "Use map with tuple-section"}
- warn: {lhs: zipWith f y (repeat z), rhs: map (`f` z) y}
- warn: {lhs: zip y (repeat z), rhs: "map (,_noParen_ z) y", note: RequiresExtension TupleSections, name: "Use map with tuple-section"}
- warn: {lhs: listToMaybe (filter p x), rhs: find p x}
- warn: {lhs: zip (take n x) (take n y), rhs: take n (zip x y)}
- warn: {lhs: zip (take n x) (take m y), rhs: take (min n m) (zip x y), side: notEq n m, note: [IncreasesLaziness, DecreasesLaziness], name: Redundant take}
- warn: {lhs: mempty <> x, rhs: x, name: "Monoid law, left identity"}
- warn: {lhs: mempty `mappend` x, rhs: x, name: "Monoid law, left identity"}
- warn: {lhs: x <> mempty, rhs: x, name: "Monoid law, right identity"}
- warn: {lhs: x `mappend` mempty, rhs: x, name: "Monoid law, right identity"}
- warn: {lhs: foldr (<>) mempty, rhs: Data.Foldable.fold}
- warn: {lhs: foldr mappend mempty, rhs: Data.Foldable.fold}
- warn: {lhs: mempty x, rhs: mempty, name: Evaluate}
- warn: {lhs: x `mempty` y, rhs: mempty, name: Evaluate, note: "Make sure you didn't mean to use mappend instead of mempty"}
- warn: {lhs: traverse pure, rhs: pure, name: "Traversable law"}
- warn: {lhs: traverse (pure . f) x, rhs: pure (fmap f x), name: "Traversable law"}
- warn: {lhs: sequenceA (map f x), rhs: traverse f x}
- warn: {lhs: sequenceA (f <$> x), rhs: traverse f x}
- warn: {lhs: sequenceA (fmap f x), rhs: traverse f x}
- warn: {lhs: sequenceA_ (map f x), rhs: traverse_ f x}
- warn: {lhs: sequenceA_ (f <$> x), rhs: traverse_ f x}
- warn: {lhs: sequenceA_ (fmap f x), rhs: traverse_ f x}
- warn: {lhs: foldMap id, rhs: fold}
- warn: {lhs: fold (f <$> x), rhs: foldMap f x}
- warn: {lhs: fold (fmap f x), rhs: foldMap f x}
- warn: {lhs: fold (map f x), rhs: foldMap f x}
- warn: {lhs: foldMap f (g <$> x), rhs: foldMap (f . g) x, name: Fuse foldMap/fmap}
- warn: {lhs: foldMap f (fmap g x), rhs: foldMap (f . g) x, name: Fuse foldMap/fmap}
- warn: {lhs: foldMap f (map g x), rhs: foldMap (f . g) x, name: Fuse foldMap/map}
- warn: {lhs: deleteBy (==), rhs: delete}
- warn: {lhs: groupBy (==), rhs: group}
- warn: {lhs: insertBy compare, rhs: insert}
- warn: {lhs: intersectBy (==), rhs: intersect}
- warn: {lhs: maximumBy compare, rhs: maximum}
- warn: {lhs: minimumBy compare, rhs: minimum}
- warn: {lhs: nubBy (==), rhs: nub}
- warn: {lhs: sortBy compare, rhs: sort}
- warn: {lhs: unionBy (==), rhs: union}
- warn: {lhs: foldr (>>) (pure ()), rhs: sequence_}
- warn: {lhs: foldr (>>) (return ()), rhs: sequence_}
- warn: {lhs: foldr (&&) True, rhs: and}
- warn: {lhs: foldl (&&) True, rhs: and, note: IncreasesLaziness}
- warn: {lhs: foldr1 (&&) , rhs: and, note: "RemovesError on `[]`"}
- warn: {lhs: foldl1 (&&) , rhs: and, note: "RemovesError on `[]`"}
- warn: {lhs: foldr (||) False, rhs: or}
- warn: {lhs: foldl (||) False, rhs: or, note: IncreasesLaziness}
- warn: {lhs: foldr1 (||) , rhs: or, note: "RemovesError on `[]`"}
- warn: {lhs: foldl1 (||) , rhs: or, note: "RemovesError on `[]`"}
- warn: {lhs: foldl (+) 0, rhs: sum}
- warn: {lhs: foldr (+) 0, rhs: sum}
- warn: {lhs: foldl1 (+) , rhs: sum, note: "RemovesError on `[]`"}
- warn: {lhs: foldr1 (+) , rhs: sum, note: "RemovesError on `[]`"}
- warn: {lhs: foldl (*) 1, rhs: product}
- warn: {lhs: foldr (*) 1, rhs: product}
- warn: {lhs: foldl1 (*) , rhs: product, note: "RemovesError on `[]`"}
- warn: {lhs: foldr1 (*) , rhs: product, note: "RemovesError on `[]`"}
- warn: {lhs: foldl1 max , rhs: maximum}
- warn: {lhs: foldr1 max , rhs: maximum}
- warn: {lhs: foldl1 min , rhs: minimum}
- warn: {lhs: foldr1 min , rhs: minimum}
- warn: {lhs: foldr mplus mzero, rhs: msum}
- warn: {lhs: \x -> x, rhs: id}
- warn: {lhs: \x y -> x, rhs: const}
- warn: {lhs: curry fst, rhs: const}
- warn: {lhs: curry snd, rhs: \_ x -> x, note: "Alternatively, use const id"}
- warn: {lhs: flip const, rhs: \_ x -> x, note: "Alternatively, use const id"}
- warn: {lhs: "\\(x,y) -> y", rhs: snd}
- warn: {lhs: "\\(x,y) -> x", rhs: fst}
- hint: {lhs: "\\x y -> f (x,y)", rhs: curry f}
- hint: {lhs: "\\(x,y) -> f x y", rhs: uncurry f, note: IncreasesLaziness}
- warn: {lhs: f (fst p) (snd p), rhs: uncurry f p}
- warn: {lhs: "uncurry (\\x y -> z)", rhs: "\\(x,y) -> z"}
- warn: {lhs: "curry (\\(x,y) -> z)", rhs: "\\x y -> z"}
- warn: {lhs: uncurry (curry f), rhs: f}
- warn: {lhs: curry (uncurry f), rhs: f}
- warn: {lhs: "uncurry f (a, b)", rhs: f a b}
- warn: {lhs: ($) (f x), rhs: f x, name: Redundant $}
- warn: {lhs: (f $), rhs: f, name: Redundant $}
- warn: {lhs: (& f), rhs: f, name: Redundant &}
- hint: {lhs: \x -> y, rhs: const y, side: isAtom y && not (isWildcard y)}
- warn: {lhs: flip f x y, rhs: f y x, side: isApp original && isAtom y}
- warn: {lhs: id x, rhs: x}
- warn: {lhs: id . x, rhs: x, name: Redundant id}
- warn: {lhs: x . id, rhs: x, name: Redundant id}
- warn: {lhs: "((,) x)", rhs: "(_noParen_ x,)", name: Use tuple-section, note: RequiresExtension TupleSections}
- warn: {lhs: "flip (,) x", rhs: "(,_noParen_ x)", name: Use tuple-section, note: RequiresExtension TupleSections}
- warn: {lhs: flip (flip f), rhs: f, note: DecreasesLaziness}
- warn: {lhs: flip f <*> g, rhs: f =<< g, name: Redundant flip}
- warn: {lhs: g <**> flip f, rhs: g >>= f, name: Redundant flip}
- warn: {lhs: flip f =<< g, rhs: f <*> g, name: Redundant flip}
- warn: {lhs: g >>= flip f, rhs: g Control.Applicative.<**> f, name: Redundant flip}
- warn: {lhs: "a >= 'a' && a <= 'z'", rhs: isAsciiLower a}
- warn: {lhs: "'a' <= a && a <= 'z'", rhs: isAsciiLower a}
- warn: {lhs: "a >= 'A' && a <= 'Z'", rhs: isAsciiUpper a}
- warn: {lhs: "'A' <= a && a <= 'Z'", rhs: isAsciiUpper a}
- warn: {lhs: "a >= '0' && a <= '9'", rhs: isDigit a}
- warn: {lhs: "'0' <= a && a <= '9'", rhs: isDigit a}
- warn: {lhs: "a >= '0' && a <= '7'", rhs: isOctDigit a}
- warn: {lhs: "'0' <= a && a <= '7'", rhs: isOctDigit a}
- warn: {lhs: isLower a || isUpper a, rhs: isAlpha a}
- warn: {lhs: isUpper a || isLower a, rhs: isAlpha a}
- warn: {lhs: x == True, rhs: x, name: Redundant ==}
- hint: {lhs: x == False, rhs: not x, name: Redundant ==}
- warn: {lhs: True == a, rhs: a, name: Redundant ==}
- hint: {lhs: False == a, rhs: not a, name: Redundant ==}
- hint: {lhs: (== True), rhs: id, name: Redundant ==}
- hint: {lhs: (== False), rhs: not, name: Redundant ==}
- hint: {lhs: (True ==), rhs: id, name: Redundant ==}
- hint: {lhs: (False ==), rhs: not, name: Redundant ==}
- warn: {lhs: a /= True, rhs: not a, name: Redundant /=}
- hint: {lhs: a /= False, rhs: a, name: Redundant /=}
- warn: {lhs: True /= a, rhs: not a, name: Redundant /=}
- hint: {lhs: False /= a, rhs: a, name: Redundant /=}
- hint: {lhs: (/= True), rhs: not, name: Redundant /=}
- hint: {lhs: (/= False), rhs: id, name: Redundant /=}
- hint: {lhs: (True /=), rhs: not, name: Redundant /=}
- hint: {lhs: (False /=), rhs: id, name: Redundant /=}
- warn: {lhs: if a then x else x, rhs: x, note: IncreasesLaziness, name: Redundant if}
- warn: {lhs: if a then True else False, rhs: a, name: Redundant if}
- warn: {lhs: if a then False else True, rhs: not a, name: Redundant if}
- warn: {lhs: if a then t else (if b then t else f), rhs: if a || b then t else f, name: Redundant if}
- warn: {lhs: if a then (if b then t else f) else f, rhs: if a && b then t else f, name: Redundant if}
- warn: {lhs: if x then True else y, rhs: x || y, side: notEq y False, name: Redundant if}
- warn: {lhs: if x then y else False, rhs: x && y, side: notEq y True, name: Redundant if}
- warn: {lhs: if | b -> t | otherwise -> f, rhs: if b then t else f, name: Redundant multi-way if}
- hint: {lhs: "case a of {True -> t; False -> f}", rhs: if a then t else f, name: Use if}
- hint: {lhs: "case a of {False -> f; True -> t}", rhs: if a then t else f, name: Use if}
- hint: {lhs: "case a of {True -> t; _ -> f}", rhs: if a then t else f, name: Use if}
- hint: {lhs: "case a of {False -> f; _ -> t}", rhs: if a then t else f, name: Use if}
- hint: {lhs: "if c then (True, x) else (False, x)", rhs: "(c, x)", note: IncreasesLaziness, name: Redundant if}
- hint: {lhs: "if c then (False, x) else (True, x)", rhs: "(not c, x)", note: IncreasesLaziness, name: Redundant if}
- hint: {lhs: "or [x, y]", rhs: x || y}
- hint: {lhs: "or [x, y, z]", rhs: x || y || z}
- hint: {lhs: "and [x, y]", rhs: x && y}
- hint: {lhs: "and [x, y, z]", rhs: x && y && z}
- warn: {lhs: if x then False else y, rhs: not x && y, side: notEq y True, name: Redundant if}
- warn: {lhs: if x then y else True, rhs: not x || y, side: notEq y False, name: Redundant if}
- warn: {lhs: not (not x), rhs: x, name: Redundant not}
- warn: {lhs: id *** g, rhs: second g}
- warn: {lhs: f *** id, rhs: first f}
- ignore: {lhs: zip (map f x) (map g x), rhs: map (f Control.Arrow.&&& g) x}
- ignore: {lhs: "\\x -> (f x, g x)", rhs: f Control.Arrow.&&& g}
- hint: {lhs: "(fst x, snd x)", rhs: x, note: DecreasesLaziness, name: Redundant pair}
- warn: {lhs: bimap id g, rhs: second g}
- warn: {lhs: bimap f id, rhs: first f}
- warn: {lhs: first id, rhs: id}
- warn: {lhs: second id, rhs: id}
- warn: {lhs: bimap id id, rhs: id}
- warn: {lhs: first f (second g x), rhs: bimap f g x}
- warn: {lhs: second g (first f x), rhs: bimap f g x}
- warn: {lhs: first f (first g x), rhs: first (f . g) x}
- warn: {lhs: second f (second g x), rhs: second (f . g) x}
- warn: {lhs: bimap f h (bimap g i x), rhs: bimap (f . g) (h . i) x}
- warn: {lhs: first f (bimap g h x), rhs: bimap (f . g) h x}
- warn: {lhs: second g (bimap f h x), rhs: bimap f (g . h) x}
- warn: {lhs: bimap f h (first g x), rhs: bimap (f . g) h x}
- warn: {lhs: bimap f g (second h x), rhs: bimap f (g . h) x}
- hint: {lhs: "\\(x,y) -> (f x, g y)", rhs: Data.Bifunctor.bimap f g, note: IncreasesLaziness}
- hint: {lhs: "\\(x,y) -> (f x,y)", rhs: Data.Bifunctor.first f, note: IncreasesLaziness}
- hint: {lhs: "\\(x,y) -> (x,f y)", rhs: Data.Bifunctor.second f, note: IncreasesLaziness}
- hint: {lhs: "(f (fst x), g (snd x))", rhs: Data.Bifunctor.bimap f g x}
- hint: {lhs: "(f (fst x), snd x)", rhs: Data.Bifunctor.first f x}
- hint: {lhs: "(fst x, g (snd x))", rhs: Data.Bifunctor.second g x}
- warn: {lhs: fmap f (fmap g x), rhs: fmap (f . g) x, name: Functor law}
- warn: {lhs: f <$> g <$> x, rhs: f . g <$> x, name: Functor law}
- warn: {lhs: fmap id, rhs: id, name: Functor law}
- warn: {lhs: id <$> x, rhs: x, name: Functor law}
- hint: {lhs: fmap f $ x, rhs: f <$> x, side: isApp x || isAtom x}
- hint: {lhs: \x -> a <$> b x, rhs: fmap a . b}
- hint: {lhs: x *> pure y, rhs: x Data.Functor.$> y}
- hint: {lhs: x *> return y, rhs: x Data.Functor.$> y}
- hint: {lhs: pure x <* y, rhs: x Data.Functor.<$ y}
- hint: {lhs: return x <* y, rhs: x Data.Functor.<$ y}
- hint: {lhs: const x <$> y, rhs: x <$ y}
- hint: {lhs: pure x <$> y, rhs: x <$ y}
- hint: {lhs: return x <$> y, rhs: x <$ y}
- hint: {lhs: x <&> const y, rhs: x Data.Functor.$> y}
- hint: {lhs: x <&> pure y, rhs: x Data.Functor.$> y}
- hint: {lhs: x <&> return y, rhs: x Data.Functor.$> y}
- hint: {lhs: pure x <*> y, rhs: x <$> y}
- hint: {lhs: return x <*> y, rhs: x <$> y}
- warn: {lhs: x <* pure y, rhs: x}
- warn: {lhs: x <* return y, rhs: x}
- warn: {lhs: pure x *> y, rhs: "y"}
- warn: {lhs: return x *> y, rhs: "y"}
- warn: {lhs: pure a >>= f, rhs: f a, name: "Monad law, left identity"}
- warn: {lhs: return a >>= f, rhs: f a, name: "Monad law, left identity"}
- warn: {lhs: f =<< pure a, rhs: f a, name: "Monad law, left identity"}
- warn: {lhs: f =<< return a, rhs: f a, name: "Monad law, left identity"}
- warn: {lhs: m >>= pure, rhs: m, name: "Monad law, right identity"}
- warn: {lhs: m >>= return, rhs: m, name: "Monad law, right identity"}
- warn: {lhs: pure =<< m, rhs: m, name: "Monad law, right identity"}
- warn: {lhs: return =<< m, rhs: m, name: "Monad law, right identity"}
- warn: {lhs: liftM, rhs: fmap}
- warn: {lhs: liftA, rhs: fmap}
- hint: {lhs: m >>= pure . f, rhs: m Data.Functor.<&> f}
- hint: {lhs: m >>= return . f, rhs: m Data.Functor.<&> f}
- hint: {lhs: pure . f =<< m, rhs: f <$> m}
- hint: {lhs: return . f =<< m, rhs: f <$> m}
- warn: {lhs: fmap f x >>= g, rhs: x >>= g . f}
- warn: {lhs: f <$> x >>= g, rhs: x >>= g . f}
- warn: {lhs: x Data.Functor.<&> f >>= g, rhs: x >>= g . f}
- warn: {lhs: g =<< fmap f x, rhs: g . f =<< x}
- warn: {lhs: g =<< f <$> x, rhs: g . f =<< x}
- warn: {lhs: g =<< (x Data.Functor.<&> f), rhs: g . f =<< x}
- warn: {lhs: if x then y else pure (), rhs: Control.Monad.when x $ _noParen_ y, side: not (isAtom y)}
- warn: {lhs: if x then y else return (), rhs: Control.Monad.when x $ _noParen_ y, side: not (isAtom y)}
- warn: {lhs: if x then y else pure (), rhs: Control.Monad.when x y, side: isAtom y}
- warn: {lhs: if x then y else return (), rhs: Control.Monad.when x y, side: isAtom y}
- warn: {lhs: if x then pure () else y, rhs: Control.Monad.unless x $ _noParen_ y, side: isAtom y}
- warn: {lhs: if x then return () else y, rhs: Control.Monad.unless x $ _noParen_ y, side: isAtom y}
- warn: {lhs: if x then pure () else y, rhs: Control.Monad.unless x y, side: isAtom y}
- warn: {lhs: if x then return () else y, rhs: Control.Monad.unless x y, side: isAtom y}
- warn: {lhs: sequence (map f x), rhs: mapM f x}
- warn: {lhs: sequence_ (map f x), rhs: mapM_ f x}
- warn: {lhs: sequence (f <$> x), rhs: mapM f x}
- warn: {lhs: sequence (fmap f x), rhs: mapM f x}
- warn: {lhs: sequence_ (f <$> x), rhs: mapM_ f x}
- warn: {lhs: sequence_ (fmap f x), rhs: mapM_ f x}
- hint: {lhs: flip mapM, rhs: Control.Monad.forM}
- hint: {lhs: flip mapM_, rhs: Control.Monad.forM_}
- hint: {lhs: flip forM, rhs: mapM}
- hint: {lhs: flip forM_, rhs: mapM_}
- warn: {lhs: when (not x), rhs: unless x}
- warn: {lhs: unless (not x), rhs: when x}
- warn: {lhs: x >>= id, rhs: Control.Monad.join x}
- warn: {lhs: id =<< x, rhs: Control.Monad.join x}
- hint: {lhs: join (f <$> x), rhs: f =<< x}
- hint: {lhs: join (fmap f x), rhs: f =<< x}
- hint: {lhs: a >> pure (), rhs: Control.Monad.void a, side: isAtom a || isApp a}
- hint: {lhs: a >> return (), rhs: Control.Monad.void a, side: isAtom a || isApp a}
- warn: {lhs: fmap (const ()), rhs: Control.Monad.void}
- warn: {lhs: const () <$> x, rhs: Control.Monad.void x}
- warn: {lhs: () <$ x, rhs: Control.Monad.void x}
- warn: {lhs: flip (>=>), rhs: (<=<)}
- warn: {lhs: flip (<=<), rhs: (>=>)}
- warn: {lhs: flip (>>=), rhs: (=<<)}
- warn: {lhs: flip (=<<), rhs: (>>=)}
- hint: {lhs: \x -> f x >>= g, rhs: f Control.Monad.>=> g}
- hint: {lhs: \x -> f =<< g x, rhs: f Control.Monad.<=< g}
- hint: {lhs: (>>= f) . g, rhs: f Control.Monad.<=< g}
- hint: {lhs: (f =<<) . g, rhs: f Control.Monad.<=< g}
- warn: {lhs: a >> forever a, rhs: forever a}
- hint: {lhs: liftM2 id, rhs: ap}
- warn: {lhs: liftM2 f (pure x), rhs: fmap (f x)}
- warn: {lhs: liftA2 f (return x), rhs: fmap (f x)}
- warn: {lhs: liftM2 f (pure x), rhs: fmap (f x)}
- warn: {lhs: liftM2 f (return x), rhs: fmap (f x)}
- warn: {lhs: fmap f (pure x), rhs: pure (f x)}
- warn: {lhs: fmap f (return x), rhs: return (f x)}
- warn: {lhs: f <$> pure x, rhs: pure (f x)}
- warn: {lhs: f <$> return x, rhs: return (f x)}
- warn: {lhs: mapM (uncurry f) (zip l m), rhs: zipWithM f l m}
- warn: {lhs: mapM_ (void . f), rhs: mapM_ f}
- warn: {lhs: forM_ x (void . f), rhs: forM_ x f}
- warn: {lhs: a >>= \_ -> b, rhs: a >> b}
- warn: {lhs: m <* pure x, rhs: m}
- warn: {lhs: m <* return x, rhs: m}
- warn: {lhs: pure x *> m, rhs: m}
- warn: {lhs: return x *> m, rhs: m}
- warn: {lhs: pure x >> m, rhs: m}
- warn: {lhs: return x >> m, rhs: m}
- warn: {lhs: fst (runState x y), rhs: evalState x y}
- warn: {lhs: snd (runState x y), rhs: execState x y}
- warn: {lhs: unzip <$> mapM f x, rhs: Control.Monad.mapAndUnzipM f x}
- warn: {lhs: fmap unzip (mapM f x), rhs: Control.Monad.mapAndUnzipM f x}
- warn: {lhs: sequence (zipWith f x y), rhs: Control.Monad.zipWithM f x y}
- warn: {lhs: sequence_ (zipWith f x y), rhs: Control.Monad.zipWithM_ f x y}
- warn: {lhs: sequence (replicate n x), rhs: Control.Monad.replicateM n x}
- warn: {lhs: sequence_ (replicate n x), rhs: Control.Monad.replicateM_ n x}
- warn: {lhs: sequenceA (zipWith f x y), rhs: Control.Monad.zipWithM f x y}
- warn: {lhs: sequenceA_ (zipWith f x y), rhs: Control.Monad.zipWithM_ f x y}
- warn: {lhs: sequenceA (replicate n x), rhs: Control.Monad.replicateM n x}
- warn: {lhs: sequenceA_ (replicate n x), rhs: Control.Monad.replicateM_ n x}
- warn: {lhs: mapM f (replicate n x), rhs: Control.Monad.replicateM n (f x)}
- warn: {lhs: mapM_ f (replicate n x), rhs: Control.Monad.replicateM_ n (f x)}
- warn: {lhs: mapM f (map g x), rhs: mapM (f . g) x, name: Fuse mapM/map}
- warn: {lhs: mapM_ f (map g x), rhs: mapM_ (f . g) x, name: Fuse mapM_/map}
- warn: {lhs: traverse f (map g x), rhs: traverse (f . g) x, name: Fuse traverse/map}
- warn: {lhs: traverse_ f (map g x), rhs: traverse_ (f . g) x, name: Fuse traverse_/map}
- warn: {lhs: mapM id, rhs: sequence}
- warn: {lhs: mapM_ id, rhs: sequence_}
- warn: {lhs: flip traverse, rhs: for}
- warn: {lhs: flip for, rhs: traverse}
- warn: {lhs: flip traverse_, rhs: for_}
- warn: {lhs: flip for_, rhs: traverse_}
- warn: {lhs: foldr (*>) (pure ()), rhs: sequenceA_}
- warn: {lhs: foldr (*>) (return ()), rhs: sequenceA_}
- warn: {lhs: foldr (<|>) empty, rhs: asum}
- warn: {lhs: liftA2 (flip ($)), rhs: (<**>)}
- warn: {lhs: liftA2 f (pure x), rhs: fmap (f x)}
- warn: {lhs: liftA2 f (return x), rhs: fmap (f x)}
- warn: {lhs: Just <$> a <|> pure Nothing, rhs: optional a}
- warn: {lhs: Just <$> a <|> return Nothing, rhs: optional a}
- warn: {lhs: empty <|> x, rhs: x, name: "Alternative law, left identity"}
- warn: {lhs: x <|> empty, rhs: x, name: "Alternative law, right identity"}
- warn: {lhs: traverse id, rhs: sequenceA}
- warn: {lhs: traverse_ id, rhs: sequenceA_}
- hint: {lhs: "if b then [x] else []", rhs: "[x | b]", name: Use list comprehension}
- hint: {lhs: "if b then [] else [x]", rhs: "[x | not b]", name: Use list comprehension}
- hint: {lhs: "[x | x <- y]", rhs: "y", side: isVar x, name: Redundant list comprehension}
- hint: {lhs: "[ f x | x <- [y] ]", rhs: "[f y]", side: isVar x, name: Redundant list comprehension}
- warn: {lhs: seq x x, rhs: x, name: Redundant seq}
- warn: {lhs: join seq, rhs: id, name: Redundant seq}
- warn: {lhs: id $! x, rhs: x, name: Redundant $!}
- warn: {lhs: seq x y, rhs: "y", side: isWHNF x, name: Redundant seq}
- warn: {lhs: f $! x, rhs: f x, side: isWHNF x, name: Redundant $!}
- warn: {lhs: evaluate x, rhs: return x, side: isWHNF x, name: Redundant evaluate}
- warn: {lhs: seq (rnf x) (), rhs: rnf x, name: Redundant seq}
- warn: {lhs: fst (unzip x), rhs: map fst x}
- warn: {lhs: snd (unzip x), rhs: map snd x}
- hint: {lhs: "\\x y -> (x, y)", rhs: "(,)"}
- hint: {lhs: "\\x y z -> (x, y, z)", rhs: "(,,)"}
- hint: {lhs: "(,b) a", rhs: "(a,b)", side: isAtom a, name: Evaluate}
- hint: {lhs: "(a,) b", rhs: "(a,b)", side: isAtom b, name: Evaluate}
- warn: {lhs: maybe x id, rhs: Data.Maybe.fromMaybe x}
- warn: {lhs: maybe Nothing Just, rhs: id, name: Redundant maybe}
- warn: {lhs: maybe False (const True), rhs: Data.Maybe.isJust}
- warn: {lhs: maybe True (const False), rhs: Data.Maybe.isNothing}
- warn: {lhs: maybe False (x ==), rhs: (Just x ==)}
- warn: {lhs: maybe True (x /=), rhs: (Just x /=)}
- warn: {lhs: maybe False (== x), rhs: (Just x ==), note: ValidInstance Eq x}
- warn: {lhs: maybe True (/= x), rhs: (Just x /=), note: ValidInstance Eq x}
- ignore: {lhs: fromMaybe False x, rhs: Just True == x}
- ignore: {lhs: fromMaybe True x, rhs: Just False /= x}
- warn: {lhs: not (isNothing x), rhs: isJust x}
- warn: {lhs: not (isJust x), rhs: isNothing x}
- warn: {lhs: "maybe [] (:[])", rhs: maybeToList}
- warn: {lhs: catMaybes (map f x), rhs: mapMaybe f x}
- warn: {lhs: catMaybes (f <$> x), rhs: mapMaybe f x}
- warn: {lhs: catMaybes (fmap f x), rhs: mapMaybe f x}
- hint: {lhs: case x of Nothing -> y; Just a -> a , rhs: Data.Maybe.fromMaybe y x, side: isAtom y, name: Replace case with fromMaybe}
- hint: {lhs: case x of Just a -> a; Nothing -> y, rhs: Data.Maybe.fromMaybe y x, side: isAtom y, name: Replace case with fromMaybe}
- hint: {lhs: case x of Nothing -> y; Just a -> f a , rhs: maybe y f x, side: isAtom y && isAtom f, name: Replace case with maybe}
- hint: {lhs: case x of Just a -> f a; Nothing -> y, rhs: maybe y f x, side: isAtom y && isAtom f, name: Replace case with maybe}
- warn: {lhs: if isNothing x then y else f (fromJust x), rhs: maybe y f x}
- warn: {lhs: if isJust x then f (fromJust x) else y, rhs: maybe y f x}
- warn: {lhs: maybe Nothing (Just . f), rhs: fmap f}
- hint: {lhs: map fromJust (filter isJust x), rhs: Data.Maybe.catMaybes x}
- warn: {lhs: x == Nothing , rhs: isNothing x}
- warn: {lhs: Nothing == x , rhs: isNothing x}
- warn: {lhs: x /= Nothing , rhs: Data.Maybe.isJust x}
- warn: {lhs: Nothing /= x , rhs: Data.Maybe.isJust x}
- warn: {lhs: concatMap (maybeToList . f), rhs: Data.Maybe.mapMaybe f}
- warn: {lhs: concatMap maybeToList, rhs: catMaybes}
- warn: {lhs: maybe n Just x, rhs: x Control.Applicative.<|> n}
- warn: {lhs: if isNothing x then y else fromJust x, rhs: fromMaybe y x}
- warn: {lhs: if isJust x then fromJust x else y, rhs: fromMaybe y x}
- warn: {lhs: isJust x && (fromJust x == y), rhs: x == Just y}
- warn: {lhs: mapMaybe f (map g x), rhs: mapMaybe (f . g) x, name: Fuse mapMaybe/map}
- warn: {lhs: fromMaybe a (fmap f x), rhs: maybe a f x}
- warn: {lhs: fromMaybe a (f <$> x), rhs: maybe a f x}
- warn: {lhs: mapMaybe id, rhs: catMaybes}
- hint: {lhs: "[x | Just x <- a]", rhs: Data.Maybe.catMaybes a, side: isVar x}
- hint: {lhs: case m of Nothing -> Nothing; Just x -> x, rhs: Control.Monad.join m}
- hint: {lhs: maybe Nothing id, rhs: join}
- hint: {lhs: maybe Nothing f x, rhs: f =<< x}
- warn: {lhs: maybe x f (g <$> y), rhs: maybe x (f . g) y, name: Redundant fmap}
- warn: {lhs: maybe x f (fmap g y), rhs: maybe x (f . g) y, name: Redundant fmap}
- warn: {lhs: isJust (f <$> x), rhs: isJust x}
- warn: {lhs: isJust (fmap f x), rhs: isJust x}
- warn: {lhs: isNothing (f <$> x), rhs: isNothing x}
- warn: {lhs: isNothing (fmap f x), rhs: isNothing x}
- warn: {lhs: fromJust (f <$> x), rhs: f (fromJust x), note: IncreasesLaziness}
- warn: {lhs: fromJust (fmap f x), rhs: f (fromJust x), note: IncreasesLaziness}
- warn: {lhs: mapMaybe f (g <$> x), rhs: mapMaybe (f . g) x, name: Redundant fmap}
- warn: {lhs: mapMaybe f (fmap g x), rhs: mapMaybe (f . g) x, name: Redundant fmap}
- warn: {lhs: catMaybes (nub x), rhs: nub (catMaybes x), name: Move nub out}
- warn: {lhs: lefts (nub x), rhs: nub (lefts x), name: Move nub out}
- warn: {lhs: rights (nub x), rhs: nub (rights x), name: Move nub out}
- warn: {lhs: catMaybes (reverse x), rhs: reverse (catMaybes x), name: Move reverse out}
- warn: {lhs: lefts (reverse x), rhs: reverse (lefts x), name: Move reverse out}
- warn: {lhs: rights (reverse x), rhs: reverse (rights x), name: Move reverse out}
- warn: {lhs: catMaybes (sort x), rhs: sort (catMaybes x), name: Move sort out}
- warn: {lhs: lefts (sort x), rhs: sort (lefts x), name: Move sort out}
- warn: {lhs: rights (sort x), rhs: sort (rights x), name: Move sort out}
- warn: {lhs: catMaybes (nubOrd x), rhs: nubOrd (catMaybes x), name: Move nubOrd out}
- warn: {lhs: lefts (nubOrd x), rhs: nubOrd (lefts x), name: Move nubOrd out}
- warn: {lhs: rights (nubOrd x), rhs: nubOrd (rights x), name: Move nubOrd out}
- warn: {lhs: filter f (reverse x), rhs: reverse (filter f x), name: Move reverse out}
- warn: {lhs: "[a | Left a <- b]", rhs: lefts b, side: isVar a}
- warn: {lhs: "[a | Right a <- b]", rhs: rights b, side: isVar a}
- warn: {lhs: either Left (Right . f), rhs: fmap f}
- warn: {lhs: either f g (fmap h x), rhs: either f (g . h) x, name: Redundant fmap}
- warn: {lhs: isLeft (fmap f x), rhs: isLeft x}
- warn: {lhs: isRight (fmap f x), rhs: isRight x}
- warn: {lhs: fromLeft x (fmap f y), rhs: fromLeft x y}
- warn: {lhs: fromRight x (fmap f y), rhs: either (const x) f y}
- warn: {lhs: either (const x) id, rhs: fromRight x}
- warn: {lhs: either id (const x), rhs: fromLeft x}
- warn: {lhs: either Left f x, rhs: f =<< x}
- hint: {lhs: elem x y, rhs: x `elem` y, side: not (isInfixApp original) && not (isParen result), name: Use infix}
- hint: {lhs: notElem x y, rhs: x `notElem` y, side: not (isInfixApp original) && not (isParen result), name: Use infix}
- hint: {lhs: isInfixOf x y, rhs: x `isInfixOf` y, side: not (isInfixApp original) && not (isParen result), name: Use infix}
- hint: {lhs: isSuffixOf x y, rhs: x `isSuffixOf` y, side: not (isInfixApp original) && not (isParen result), name: Use infix}
- hint: {lhs: isPrefixOf x y, rhs: x `isPrefixOf` y, side: not (isInfixApp original) && not (isParen result), name: Use infix}
- hint: {lhs: union x y, rhs: x `union` y, side: not (isInfixApp original) && not (isParen result), name: Use infix}
- hint: {lhs: intersect x y, rhs: x `intersect` y, side: not (isInfixApp original) && not (isParen result), name: Use infix}
- warn: {lhs: fromIntegral x, rhs: x, side: isLitInt x, name: Redundant fromIntegral}
- warn: {lhs: fromInteger x, rhs: x, side: isLitInt x, name: Redundant fromInteger}
- hint: {lhs: x + negate y, rhs: x - y}
- hint: {lhs: 0 - x, rhs: negate x}
- warn: {lhs: negate (negate x), rhs: x, name: Redundant negate}
- hint: {lhs: log y / log x, rhs: logBase x y}
- hint: {lhs: sin x / cos x, rhs: tan x}
- hint: {lhs: rem n 2 == 0, rhs: even n}
- hint: {lhs: 0 == rem n 2, rhs: even n}
- hint: {lhs: rem n 2 /= 0, rhs: odd n}
- hint: {lhs: 0 /= rem n 2, rhs: odd n}
- hint: {lhs: mod n 2 == 0, rhs: even n}
- hint: {lhs: 0 == mod n 2, rhs: even n}
- hint: {lhs: mod n 2 /= 0, rhs: odd n}
- hint: {lhs: 0 /= mod n 2, rhs: odd n}
- hint: {lhs: not (even x), rhs: odd x}
- hint: {lhs: not (odd x), rhs: even x}
- hint: {lhs: x ** 0.5, rhs: sqrt x}
- hint: {lhs: x ^ 0, rhs: "1", name: Use 1}
- hint: {lhs: round (x - 0.5), rhs: floor x}
- hint: {lhs: mapM_ (writeChan a), rhs: writeList2Chan a}
- error: {lhs: atomically (readTVar x), rhs: readTVarIO x}
- error: {lhs: atomically (newTVar x), rhs: newTVarIO x}
- error: {lhs: atomically (newTMVar x), rhs: newTMVarIO x}
- error: {lhs: atomically newEmptyTMVar, rhs: newEmptyTMVarIO}
- hint: {lhs: "typeOf (a :: b)", rhs: "typeRep (Proxy :: Proxy b)"}
- hint: {lhs: flip Control.Exception.catch, rhs: handle}
- hint: {lhs: flip handle, rhs: Control.Exception.catch}
- hint: {lhs: flip (catchJust p), rhs: handleJust p}
- hint: {lhs: flip (handleJust p), rhs: catchJust p}
- hint: {lhs: Control.Exception.bracket b (const a) (const t), rhs: Control.Exception.bracket_ b a t}
- hint: {lhs: Control.Exception.bracket (openFile x y) hClose, rhs: withFile x y}
- hint: {lhs: Control.Exception.bracket (openBinaryFile x y) hClose, rhs: withBinaryFile x y}
- hint: {lhs: throw (ErrorCall a), rhs: error a}
- warn: {lhs: toException NonTermination, rhs: nonTermination}
- warn: {lhs: toException NestedAtomically, rhs: nestedAtomically}
- hint: {lhs: modifyIORef r (const x), rhs: writeIORef r x}
- hint: {lhs: modifyIORef r (\v -> x), rhs: writeIORef r x}
- hint: {lhs: castPtr nullPtr, rhs: nullPtr}
- hint: {lhs: castPtr (castPtr x), rhs: castPtr x}
- hint: {lhs: plusPtr (castPtr x), rhs: plusPtr x}
- hint: {lhs: minusPtr (castPtr x), rhs: minusPtr x}
- hint: {lhs: minusPtr x (castPtr y), rhs: minusPtr x y}
- hint: {lhs: peekByteOff (castPtr x), rhs: peekByteOff x}
- hint: {lhs: pokeByteOff (castPtr x), rhs: pokeByteOff x}
- warn: {lhs: mkWeak a a b, rhs: mkWeakPtr a b}
- warn: {lhs: "mkWeak a (a, b) c", rhs: mkWeakPair a b c}
- warn: {lhs: case m of Nothing -> pure (); Just x -> f x, rhs: Data.Foldable.forM_ m f}
- warn: {lhs: case m of Nothing -> return (); Just x -> f x, rhs: Data.Foldable.forM_ m f}
- warn: {lhs: case m of Just x -> f x; Nothing -> pure (), rhs: Data.Foldable.forM_ m f}
- warn: {lhs: case m of Just x -> f x; Nothing -> return (), rhs: Data.Foldable.forM_ m f}
- warn: {lhs: case m of Just x -> f x; _ -> pure (), rhs: Data.Foldable.forM_ m f}
- warn: {lhs: case m of Just x -> f x; _ -> return (), rhs: Data.Foldable.forM_ m f}
- warn: {lhs: when (isJust m) (f (fromJust m)), rhs: Data.Foldable.forM_ m f}
- warn: {lhs: f <$> Control.Monad.State.get, rhs: gets f}
- warn: {lhs: fmap f Control.Monad.State.get, rhs: gets f}
- warn: {lhs: f <$> Control.Monad.State.gets g, rhs: gets (f . g)}
- warn: {lhs: fmap f (Control.Monad.State.gets g), rhs: gets (f . g)}
- warn: {lhs: f <$> Control.Monad.Reader.ask, rhs: asks f}
- warn: {lhs: fmap f Control.Monad.Reader.ask, rhs: asks f}
- warn: {lhs: f <$> Control.Monad.Reader.asks g, rhs: asks (f . g)}
- warn: {lhs: fmap f (Control.Monad.Reader.asks g), rhs: asks (f . g)}
- warn: {lhs: fst (runState m s), rhs: evalState m s}
- warn: {lhs: snd (runState m s), rhs: execState m s}
- warn: {lhs: True && x, rhs: x, name: Evaluate}
- warn: {lhs: False && x, rhs: "False", name: Evaluate}
- warn: {lhs: True || x, rhs: "True", name: Evaluate}
- warn: {lhs: False || x, rhs: x, name: Evaluate}
- warn: {lhs: not True, rhs: "False", name: Evaluate}
- warn: {lhs: not False, rhs: "True", name: Evaluate}
- warn: {lhs: Nothing >>= k, rhs: Nothing, name: Evaluate}
- warn: {lhs: k =<< Nothing, rhs: Nothing, name: Evaluate}
- warn: {lhs: either f g (Left x), rhs: f x, name: Evaluate}
- warn: {lhs: either f g (Right y), rhs: g y, name: Evaluate}
- warn: {lhs: "fst (x,y)", rhs: x, name: Evaluate}
- warn: {lhs: "snd (x,y)", rhs: "y", name: Evaluate}
- warn: {lhs: "init [x]", rhs: "[]", name: Evaluate}
- warn: {lhs: "null [x]", rhs: "False", name: Evaluate}
- warn: {lhs: "null []", rhs: "True", name: Evaluate}
- warn: {lhs: "null \"\"", rhs: "True", name: Evaluate}
- warn: {lhs: "length []", rhs: "0", name: Evaluate}
- warn: {lhs: "length \"\"", rhs: "0", name: Evaluate}
- warn: {lhs: "foldl f z []", rhs: z, name: Evaluate}
- warn: {lhs: "foldr f z []", rhs: z, name: Evaluate}
- warn: {lhs: "foldr1 f [x]", rhs: x, name: Evaluate}
- warn: {lhs: "scanr f z []", rhs: "[z]", name: Evaluate}
- warn: {lhs: "scanr1 f []", rhs: "[]", name: Evaluate}
- warn: {lhs: "scanr1 f [x]", rhs: "[x]", name: Evaluate}
- warn: {lhs: "take n []", rhs: "[]", note: IncreasesLaziness, name: Evaluate}
- warn: {lhs: "take n \"\"", rhs: "\"\"", note: IncreasesLaziness, name: Evaluate}
- warn: {lhs: "drop n []", rhs: "[]", note: IncreasesLaziness, name: Evaluate}
- warn: {lhs: "drop n \"\"", rhs: "\"\"", note: IncreasesLaziness, name: Evaluate}
- warn: {lhs: "takeWhile p []", rhs: "[]", name: Evaluate}
- warn: {lhs: "takeWhile p \"\"", rhs: "\"\"", name: Evaluate}
- warn: {lhs: "dropWhile p []", rhs: "[]", name: Evaluate}
- warn: {lhs: "dropWhile p \"\"", rhs: "\"\"", name: Evaluate}
- warn: {lhs: "span p []", rhs: "([],[])", name: Evaluate}
- warn: {lhs: "span p \"\"", rhs: "(\"\",\"\")", name: Evaluate}
- warn: {lhs: "lines \"\"", rhs: "[]", name: Evaluate}
- warn: {lhs: "lines []", rhs: "[]", name: Evaluate}
- warn: {lhs: "unwords []", rhs: "\"\"", name: Evaluate}
- warn: {lhs: x - 0, rhs: x, name: Evaluate}
- warn: {lhs: x * 1, rhs: x, name: Evaluate}
- warn: {lhs: x / 1, rhs: x, name: Evaluate}
- warn: {lhs: "concat [a]", rhs: a, name: Evaluate}
- warn: {lhs: "concat []", rhs: "[]", name: Evaluate}
- warn: {lhs: "zip [] []", rhs: "[]", name: Evaluate}
- warn: {lhs: const x y, rhs: x, name: Evaluate}
- warn: {lhs: any (const False), rhs: const False, note: IncreasesLaziness, name: Evaluate}
- warn: {lhs: all (const True), rhs: const True, note: IncreasesLaziness, name: Evaluate}
- warn: {lhs: "[] ++ x", rhs: x, name: Evaluate}
- warn: {lhs: "\"\" ++ x", rhs: x, name: Evaluate}
- warn: {lhs: "x ++ []", rhs: x, name: Evaluate}
- warn: {lhs: "x ++ \"\"", rhs: x, name: Evaluate}
- warn: {lhs: "all f [a]", rhs: f a, name: Evaluate}
- warn: {lhs: "all f []", rhs: "True", name: Evaluate}
- warn: {lhs: "any f [a]", rhs: f a, name: Evaluate}
- warn: {lhs: "any f []", rhs: "False", name: Evaluate}
- warn: {lhs: "maximum [a]", rhs: a, name: Evaluate}
- warn: {lhs: "minimum [a]", rhs: a, name: Evaluate}
- warn: {lhs: "map f []", rhs: "[]", name: Evaluate}
- warn: {lhs: "map f [a]", rhs: "[f a]", name: Evaluate}
- warn: {lhs: "foldr f z (x,b)", rhs: f b z, name: Using foldr on tuple}
- warn: {lhs: "foldr' f z (x,b)", rhs: f b z, name: Using foldr' on tuple}
- warn: {lhs: "foldl f z (x,b)", rhs: f z b, name: Using foldl on tuple}
- warn: {lhs: "foldl' f z (x,b)", rhs: f z b, name: Using foldl' on tuple}
- warn: {lhs: "foldMap f (x,b)", rhs: f b, name: Using foldMap on tuple}
- warn: {lhs: "foldr1 f (x,b)", rhs: b, name: Using foldr1 on tuple}
- warn: {lhs: "foldl1 f (x,b)", rhs: b, name: Using foldl1 on tuple}
- warn: {lhs: "elem e (x,b)", rhs: e == b, name: Using elem on tuple}
- warn: {lhs: "fold (x,b)", rhs: b, name: Using fold on tuple}
- warn: {lhs: "toList (x,b)", rhs: b, name: Using toList on tuple}
- warn: {lhs: "maximum (x,b)", rhs: b, name: Using maximum on tuple}
- warn: {lhs: "minimum (x,b)", rhs: b, name: Using minimum on tuple}
- warn: {lhs: "sum (x,b)", rhs: b, name: Using sum on tuple}
- warn: {lhs: "product (x,b)", rhs: b, name: Using product on tuple}
- warn: {lhs: "concat (x,b)", rhs: b, name: Using concat on tuple}
- warn: {lhs: "and (x,b)", rhs: b, name: Using and on tuple}
- warn: {lhs: "or (x,b)", rhs: b, name: Using or on tuple}
- warn: {lhs: "any f (x,b)", rhs: f b, name: Using any on tuple}
- warn: {lhs: "all f (x,b)", rhs: f b, name: Using all on tuple}
- warn: {lhs: "foldr f z (x,y,b)", rhs: f b z, name: Using foldr on tuple}
- warn: {lhs: "foldr' f z (x,y,b)", rhs: f b z, name: Using foldr' on tuple}
- warn: {lhs: "foldl f z (x,y,b)", rhs: f z b, name: Using foldl on tuple}
- warn: {lhs: "foldl' f z (x,y,b)", rhs: f z b, name: Using foldl' on tuple}
- warn: {lhs: "foldMap f (x,y,b)", rhs: f b, name: Using foldMap on tuple}
- warn: {lhs: "foldr1 f (x,y,b)", rhs: b, name: Using foldr1 on tuple}
- warn: {lhs: "foldl1 f (x,y,b)", rhs: b, name: Using foldl1 on tuple}
- warn: {lhs: "elem e (x,y,b)", rhs: e == b, name: Using elem on tuple}
- warn: {lhs: "fold (x,y,b)", rhs: b, name: Using fold on tuple}
- warn: {lhs: "toList (x,y,b)", rhs: b, name: Using toList on tuple}
- warn: {lhs: "maximum (x,y,b)", rhs: b, name: Using maximum on tuple}
- warn: {lhs: "minimum (x,y,b)", rhs: b, name: Using minimum on tuple}
- warn: {lhs: "sum (x,y,b)", rhs: b, name: Using sum on tuple}
- warn: {lhs: "product (x,y,b)", rhs: b, name: Using product on tuple}
- warn: {lhs: "concat (x,y,b)", rhs: b, name: Using concat on tuple}
- warn: {lhs: "and (x,y,b)", rhs: b, name: Using and on tuple}
- warn: {lhs: "or (x,y,b)", rhs: b, name: Using or on tuple}
- warn: {lhs: "any f (x,y,b)", rhs: f b, name: Using any on tuple}
- warn: {lhs: "all f (x,y,b)", rhs: f b, name: Using all on tuple}
- warn: {lhs: null x , rhs: "False", side: isTuple x, name: Using null on tuple}
- warn: {lhs: length x, rhs: "1" , side: isTuple x, name: Using length on tuple}
- warn: {lhs: "Data.Map.fromList []", rhs: Data.Map.empty}
- warn: {lhs: "Data.Map.Lazy.fromList []", rhs: Data.Map.Lazy.empty}
- warn: {lhs: "Data.Map.Strict.fromList []", rhs: Data.Map.Strict.empty}
- group:
name: lens
enabled: true
imports:
- package base
- package lens
rules:
- warn: {lhs: "(a ^. b) ^. c", rhs: "a ^. (b . c)"}
- warn: {lhs: "fromJust (a ^? b)", rhs: "a ^?! b"}
- warn: {lhs: "a .~ Just b", rhs: "a ?~ b"}
- warn: {lhs: "(mapped %~ b) a", rhs: "a <&> b"}
- warn: {lhs: "((mapped . b) %~ c) a", rhs: "a <&> b %~ c"}
- warn: {lhs: "(mapped .~ b) a", rhs: "b <$ a"}
- warn: {lhs: "ask <&> (^. a)", rhs: "view a"}
- warn: {lhs: "view a <&> (^. b)", rhs: "view (a . b)"}
- warn: {lhs: "Control.Lens.at a . Control.Lens._Just", rhs: "Control.Lens.ix a"}
- error: {lhs: "Control.Lens.has (Control.Lens.at a)", rhs: "True"}
- error: {lhs: "Control.Lens.has (a . Control.Lens.at b)", rhs: "Control.Lens.has a"}
- error: {lhs: "Control.Lens.nullOf (Control.Lens.at a)", rhs: "False"}
- error: {lhs: "Control.Lens.nullOf (a . Control.Lens.at b)", rhs: "Control.Lens.nullOf a"}
- group:
name: use-th-quotes
enabled: true
imports:
- package base
rules:
- hint: {lhs: "TH.varE 'a", rhs: "[|a|]", name: Use TH quotation brackets}
- group:
name: attoparsec
enabled: true
imports:
- package base
- package attoparsec
rules:
- warn: {lhs: Data.Attoparsec.Text.option Nothing (Just <$> p), rhs: optional p}
- warn: {lhs: Data.Attoparsec.ByteString.option Nothing (Just <$> p), rhs: optional p}
- group:
name: quickcheck
enabled: true
imports:
- package base
- package quickcheck
rules:
- warn: {lhs: "Test.QuickCheck.choose (x,x)", rhs: return x}
- warn: {lhs: "Test.QuickCheck.chooseInt (x,x)", rhs: return x}
- warn: {lhs: "Test.QuickCheck.chooseInteger (x,x)", rhs: return x}
- warn: {lhs: "Test.QuickCheck.chooseBoundedIntegral (x,x)", rhs: return x}
- warn: {lhs: "Test.QuickCheck.chooseEnum (x,x)", rhs: return x}
- warn: {lhs: Control.Monad.join (Test.QuickCheck.elements l), rhs: Test.QuickCheck.oneof l}
- warn: {lhs: "Test.QuickCheck.elements [x]", rhs: "return x"}
- warn: {lhs: "Test.QuickCheck.growingElements [x]", rhs: "return x"}
- warn: {lhs: "Test.QuickCheck.oneof [x]", rhs: "x", name: Evaluate}
- warn: {lhs: "Test.QuickCheck.frequency [(a,x)]", rhs: "x", name: Evaluate}
- group:
name: generalise
enabled: true
imports:
- package base
rules:
- warn: {lhs: map, rhs: fmap}
- warn: {lhs: a ++ b, rhs: a <> b}
- warn: {lhs: "sequence [a]", rhs: "pure <$> a"}
- warn: {lhs: "x /= []", rhs: not (null x), name: Use null}
- warn: {lhs: "x /= \"\"", rhs: not (null x), name: Use null}
- warn: {lhs: "[] /= x", rhs: not (null x), name: Use null}
- warn: {lhs: "\"\" /= x", rhs: not (null x), name: Use null}
- warn: {lhs: "maybe []", rhs: foldMap}
- group:
name: generalise-for-conciseness
enabled: true
imports:
- package base
rules:
- warn: {lhs: maybe mempty, rhs: foldMap}
- warn: {lhs: maybe False, rhs: any}
- warn: {lhs: maybe True, rhs: all}
- warn: {lhs: either (const mempty), rhs: foldMap}
- warn: {lhs: either mempty, rhs: foldMap}
- warn: {lhs: either (const False), rhs: any}
- warn: {lhs: either (const True), rhs: all}
- warn: {lhs: Data.Maybe.fromMaybe mempty, rhs: Data.Foldable.fold}
- warn: {lhs: Data.Maybe.fromMaybe 0, rhs: sum}
- warn: {lhs: Data.Maybe.fromMaybe 1, rhs: product}
- warn: {lhs: Data.Maybe.fromMaybe empty, rhs: Data.Foldable.asum}
- warn: {lhs: Data.Maybe.fromMaybe mzero, rhs: Data.Foldable.msum}
- warn: {lhs: Data.Either.fromRight mempty, rhs: Data.Foldable.fold}
- warn: {lhs: Data.Either.fromRight False, rhs: or}
- warn: {lhs: Data.Either.fromRight True, rhs: and}
- warn: {lhs: Data.Either.fromRight 0, rhs: sum}
- warn: {lhs: Data.Either.fromRight 1, rhs: product}
- warn: {lhs: Data.Either.fromRight empty, rhs: Data.Foldable.asum}
- warn: {lhs: Data.Either.fromRight mzero, rhs: Data.Foldable.msum}
- warn: {lhs: if f x then Just x else Nothing, rhs: mfilter f (Just x)}
- hint: {lhs: maybe (pure ()), rhs: traverse_, note: IncreasesLaziness}
- hint: {lhs: fromMaybe (pure ()), rhs: sequenceA_, note: IncreasesLaziness}
- hint: {lhs: fromRight (pure ()), rhs: sequenceA_, note: IncreasesLaziness}
- hint: {lhs: "[fst x, snd x]", rhs: Data.Bifoldable.biList x}
- hint: {lhs: "\\(x, y) -> [x, y]", rhs: Data.Bifoldable.biList, note: IncreasesLaziness}
- hint: {lhs: const mempty, rhs: mempty}
- hint: {lhs: \x -> mempty, rhs: mempty, name: Redundant lambda}
- group:
name: extra
enabled: true
rules:
- warn: {lhs: fmap concat (forM a b), rhs: concatForM a b}
- warn: {lhs: concat <$> forM a b, rhs: concatForM a b}
- warn: {lhs: fmap concat (forM_ a b), rhs: concatForM_ a b}
- warn: {lhs: concat <$> forM_ a b, rhs: concatForM_ a b}
- warn: {lhs: "maybe (pure ()) b a", rhs: "whenJust a b"}
- warn: {lhs: "maybe (return ()) b a", rhs: "whenJust a b"}
- warn: {lhs: "maybeM (pure ()) b a", rhs: "whenJustM a b"}
- warn: {lhs: "maybeM (return ()) b a", rhs: "whenJustM a b"}
- warn: {lhs: "if a then Just <$> b else pure Nothing", rhs: "whenMaybe a b"}
- warn: {lhs: "maybe a b =<< c", rhs: "maybeM a b c"}
- warn: {lhs: "maybeM a pure x", rhs: "fromMaybeM a b"}
- warn: {lhs: "maybeM a return x", rhs: "fromMaybeM a b"}
- warn: {lhs: "either a b =<< c", rhs: "eitherM a b c"}
- warn: {lhs: "fold1M a b >> pure ()", rhs: "fold1M_ a b"}
- warn: {lhs: "fold1M a b >> return ()", rhs: "fold1M_ a b"}
- warn: {lhs: "flip concatMapM", rhs: "concatForM"}
- warn: {lhs: "liftM mconcat (mapM a b)", rhs: "mconcatMapM a b"}
- warn: {lhs: "ifM a b (pure ())", rhs: "whenM a b"}
- warn: {lhs: "ifM a b (return ())", rhs: "whenM a b"}
- warn: {lhs: "ifM a (pure ()) b", rhs: "unlessM a b"}
- warn: {lhs: "ifM a (return ()) b", rhs: "unlessM a b"}
- warn: {lhs: "ifM a (pure True) b", rhs: "(||^) a b"}
- warn: {lhs: "ifM a (return True) b", rhs: "(||^) a b"}
- warn: {lhs: "ifM a b (pure False)", rhs: "(&&^) a b"}
- warn: {lhs: "ifM a b (return False)", rhs: "(&&^) a b"}
- warn: {lhs: "anyM id", rhs: "orM"}
- warn: {lhs: "allM id", rhs: "andM"}
- warn: {lhs: "allM f [a]", rhs: f a, name: Evaluate}
- warn: {lhs: "allM f []", rhs: pure True, name: Evaluate}
- warn: {lhs: "anyM f [a]", rhs: f a, name: Evaluate}
- warn: {lhs: "anyM f []", rhs: pure False, name: Evaluate}
- warn: {lhs: "either id id", rhs: "fromEither"}
- warn: {lhs: "either (const Nothing) Just", rhs: "eitherToMaybe"}
- warn: {lhs: "either (Left . a) Right", rhs: "mapLeft a"}
- warn: {lhs: "atomicModifyIORef a (\\ v -> (b v, ()))", rhs: "atomicModifyIORef_ a b"}
- warn: {lhs: "atomicModifyIORef' a (\\ v -> (b v, ()))", rhs: "atomicModifyIORef'_ a b"}
- warn: {lhs: "null (intersect a b)", rhs: "disjoint a b"}
- warn: {lhs: "[minBound .. maxBound]", rhs: "enumerate"}
- warn: {lhs: "zipWithFrom (,)", rhs: "zipFrom"}
- warn: {lhs: "zip [i..]", rhs: "zipFrom i"}
- warn: {lhs: "zipWith f [i..]", rhs: "zipWithFrom f i"}
- warn: {lhs: "dropWhile isSpace", rhs: "trimStart"}
- warn: {lhs: "dropWhileEnd isSpace", rhs: "trimEnd"}
- warn: {lhs: "trimEnd (trimStart a)", rhs: "trim a"}
- warn: {lhs: "map toLower", rhs: "lower"}
- warn: {lhs: "map toUpper", rhs: "upper"}
- warn: {lhs: "mergeBy compare", rhs: "merge"}
- warn: {lhs: "breakEnd (not . a)", rhs: "spanEnd a"}
- warn: {lhs: "spanEnd (not . a)", rhs: "breakEnd a"}
- warn: {lhs: "mconcat (map a b)", rhs: "mconcatMap a b"}
- warn: {lhs: "fromMaybe b (stripPrefix a b)", rhs: "dropPrefix a b"}