-
Notifications
You must be signed in to change notification settings - Fork 195
/
hlint.yaml
1718 lines (1588 loc) · 89.6 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
# hlint configuration file
# ==================================
# The hlint tool is mainly automatic, but some hints/restrictions can be specified here.
- package:
name: base
modules:
- import Control.Applicative
- import Control.Arrow
- import Control.Concurrent.Chan
- import Control.Exception
- import Control.Exception.Base
- import Control.Monad
- import Control.Monad.Trans.State
- import Data.Bifunctor
- import Data.Char
- import Data.Either
- import Data.Fixed
- import Data.Foldable(asum, sequenceA_, traverse_, for_)
- import Data.Function
- import Data.Int
- import Data.List as Data.List
- import Data.List as X
- import Data.List.NonEmpty
- import Data.Maybe
- import Data.Monoid
- import Data.Ratio
- import Data.Traversable(traverse, for)
- import Numeric
- import Prelude
- import System.Exit
- import System.IO
- import System.Mem.Weak
- import Text.Read
- import qualified Data.Foldable
- 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:
# I/O
- 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")}
# EXIT
- warn: {lhs: exitWith ExitSuccess, rhs: exitSuccess}
# ORD
- 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: Use on once}
- 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}
# READ/SHOW
- 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}
# LIST
- warn: {lhs: concat (map f x), rhs: concatMap f x}
- warn: {lhs: concat (f <$> x), rhs: concatMap f x}
- warn: {lhs: concat (x <&> f), rhs: concatMap f x}
- warn: {lhs: concat (fmap f x), rhs: concatMap f x}
- hint: {lhs: "concat [a, b]", rhs: a ++ b}
- hint: {lhs: "sum [a, b]", rhs: a + b, name: "Use + directly"}
- 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: concatMap f (repeat x), rhs: cycle (f x)}
- warn: {lhs: concat (repeat x), rhs: cycle 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: Redundant 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: span (notElem x), rhs: break (elem x), name: Use break}
- warn: {lhs: break (notElem x), rhs: span (elem x), name: Use span}
- 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"}
- hint: {lhs: "concatMap f (fromMaybe [] x)", rhs: "maybe [] (concatMap f) x"}
- hint: {lhs: "concat (fromMaybe [] x)", rhs: "maybe [] concat x"}
- warn: {lhs: not (elem x y), rhs: notElem x y}
- warn: {lhs: not (notElem x y), rhs: elem 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: elem False, rhs: any not, name: Use any}
- warn: {lhs: notElem True, rhs: all not, name: Use all}
- warn: {lhs: False `elem` l, rhs: any not l, name: Use any}
- warn: {lhs: True `notElem` l, rhs: all not l, name: Use all}
- 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}
# MONOIDS
- 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"}
# TRAVERSABLES
- 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 (x <&> f), 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_ (x <&> f), 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 (x <&> f), 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/<$>}
- warn: {lhs: foldMap f (x <&> g), rhs: foldMap (f . g) x, name: Fuse foldMap/<&>}
- 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: traverse f (fmap g x), rhs: traverse (f . g) x, name: Fuse traverse/fmap}
- warn: {lhs: traverse f (g <$> x), rhs: traverse (f . g) x, name: Fuse traverse/<$>}
- warn: {lhs: traverse f (x <&> g), rhs: traverse (f . g) x, name: Fuse traverse/<&>}
- warn: {lhs: traverse_ f (fmap g x), rhs: traverse_ (f . g) x, name: Fuse traverse_/fmap}
- warn: {lhs: traverse_ f (g <$> x), rhs: traverse_ (f . g) x, name: Fuse traverse_/<$>}
- warn: {lhs: traverse_ f (x <&> g), rhs: traverse_ (f . g) x, name: Fuse traverse_/<&>}
# BY
- 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}
# FOLDS
- 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}
# FUNCTION
- 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, name: Redundant curry/uncurry}
- warn: {lhs: curry (uncurry f), rhs: f, name: Redundant curry/uncurry}
- 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)}
# If any isWildcard recursively then x may be used but not mentioned explicitly
- 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}
# CHAR
- 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}
# BOOL
- 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}
# ARROW
- 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}
# BIFUNCTOR
- 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}
# FUNCTOR
- 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: x <&> g <&> f, rhs: x <&> f . g, name: Functor law}
- warn: {lhs: fmap id, rhs: id, name: Functor law}
- warn: {lhs: id <$> x, rhs: x, name: Functor law}
- warn: {lhs: x <&> id, rhs: x, name: Functor law}
- warn: {lhs: f <$> g <$> x, rhs: f . g <$> x}
- 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 -> b x <&> a, 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}
- warn: {lhs: "fmap f (x,b)", rhs: "(x,f b)", name: Using fmap on tuple}
- warn: {lhs: "f <$> (x,b)", rhs: "(x,f b)", name: Using <$> on tuple}
- warn: {lhs: "(x,b) <&> f", rhs: "(x,f b)", name: Using <&> on tuple}
- warn: {lhs: "fmap f (x,y,b)", rhs: "(x,y,f b)", name: Using fmap on tuple}
- warn: {lhs: "f <$> (x,y,b)", rhs: "(x,y,f b)", name: Using <$> on tuple}
- warn: {lhs: "(x,y,b) <&> f", rhs: "(x,y,f b)", name: Using <&> on tuple}
# APPLICATIVE
- 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", name: Redundant *>}
- warn: {lhs: return x *> y, rhs: "y", name: Redundant *>}
# MONAD
- 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 (x <&> f), 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_ (x <&> f), 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: when (notElem x y), rhs: unless (elem x y), name: Use unless}
- warn: {lhs: unless (not x), rhs: when x}
- warn: {lhs: unless (notElem x y), rhs: when (elem x y), name: Use when}
- 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 (x <&> f), 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 <&> const (), 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: pure x <&> f, rhs: pure (f x)}
- warn: {lhs: f <$> return x, rhs: return (f x)}
- warn: {lhs: return x <&> f, 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, name: Redundant *>}
- warn: {lhs: return x *> m, rhs: m, name: Redundant *>}
- warn: {lhs: pure x >> m, rhs: m, name: Redundant >>}
- warn: {lhs: return x >> m, rhs: m, name: Redundant >>}
- warn: {lhs: "forM [1..n] (const f)", rhs: replicateM n f}
- warn: {lhs: "for [1..n] (const f)", rhs: replicateM n f}
- warn: {lhs: "forM [1..n] (\\_ -> x)", rhs: replicateM n x}
- warn: {lhs: "for [1..n] (\\_ -> x)", rhs: replicateM n x}
# STATE MONAD
- warn: {lhs: fst (runState x y), rhs: evalState x y}
- warn: {lhs: snd (runState x y), rhs: execState x y}
# MONAD LIST
- warn: {lhs: unzip <$> mapM f x, rhs: Control.Monad.mapAndUnzipM f x}
- warn: {lhs: mapM f x <&> unzip, 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_}
# APPLICATIVE / TRAVERSABLE
- 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: sequence_}
- 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_}
# LIST COMP
- 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}
# SEQ
- 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}
# TUPLE
- 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: "Data.List.NonEmpty.unzip", rhs: "Data.Functor.unzip", name: "Avoid NonEmpty.unzip", note: "The function is being deprecated"}
# MAYBE
- 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 ==), name: Redundant maybe}
- warn: {lhs: maybe True (x /=), rhs: (Just x /=), name: Redundant maybe}
- warn: {lhs: maybe False (== x), rhs: (Just x ==), note: ValidInstance Eq x, name: Redundant maybe}
- warn: {lhs: maybe True (/= x), rhs: (Just x /=), note: ValidInstance Eq x, name: Redundant maybe}
# The following two hints seem to be somewhat unwelcome, e.g.
# https://github.com/ndmitchell/hlint/issues/1177
- ignore: {lhs: fromMaybe False x, rhs: Just True == x, name: Redundant fromMaybe} # Eta expanded, see https://github.com/ndmitchell/hlint/issues/970#issuecomment-643645053
- ignore: {lhs: fromMaybe True x, rhs: Just False /= x, name: Redundant fromMaybe}
- 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 (x <&> f), 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}
- hint: {lhs: filter isJust (map f x), rhs: map Just (mapMaybe f x), name: Use mapMaybe}
- hint: {lhs: filter isJust (f <*> x), rhs: map Just (mapMaybe f x), name: Use mapMaybe}
- hint: {lhs: filter isJust (x <&> f), rhs: map Just (mapMaybe f x), name: Use mapMaybe}
- hint: {lhs: filter isJust (fmap f x), rhs: map Just (mapMaybe f x), name: Use mapMaybe}
- 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: isJust y && (x == fromJust y), rhs: Just x == 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: fromMaybe a (x <&> f), 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 <$>}
- warn: {lhs: maybe x f (y <&> g), rhs: maybe x (f . g) y, name: Redundant <&>}
- 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 (x <&> f), rhs: isJust x}
- warn: {lhs: isJust (fmap f x), rhs: isJust x}
- warn: {lhs: isNothing (f <$> x), rhs: isNothing x}
- warn: {lhs: isNothing (x <&> f), 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 (x <&> f), 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 <$>}
- warn: {lhs: mapMaybe f (x <&> g), rhs: mapMaybe (f . g) x, name: Redundant <&>}
- 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: mapMaybe f (reverse x), rhs: reverse (mapMaybe f x), name: Move reverse out}
# EITHER
- 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: either f g (h <$> x), rhs: either f (g . h) x, name: Redundant <$>}
- warn: {lhs: either f g (x <&> h), rhs: either f (g . h) x, name: Redundant <&>}
- warn: {lhs: isLeft (fmap f x), rhs: isLeft x}
- warn: {lhs: isLeft (f <$> x), rhs: isLeft x}
- warn: {lhs: isLeft (x <&> f), rhs: isLeft x}
- warn: {lhs: isRight (fmap f x), rhs: isRight x}
- warn: {lhs: isRight (f <$> x), rhs: isRight x}
- warn: {lhs: isRight (x <&> f), rhs: isRight x}
- warn: {lhs: fromLeft x (fmap f y), rhs: fromLeft x y}
- warn: {lhs: fromLeft x (f <$> y), rhs: fromLeft x y}
- warn: {lhs: fromLeft x (y <&> f), rhs: fromLeft x y}
- warn: {lhs: fromRight x (fmap f y), rhs: either (const x) f y}
- warn: {lhs: fromRight x (f <$> y), rhs: either (const x) f y}
- warn: {lhs: fromRight x (y <&> f), 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}
# INFIX
- 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}
# MATHS
- 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}
# CONCURRENT
- hint: {lhs: mapM_ (writeChan a), rhs: writeList2Chan a}
- warn: {lhs: atomically (readTVar x), rhs: readTVarIO x}
- warn: {lhs: atomically (newTVar x), rhs: newTVarIO x}
- warn: {lhs: atomically (newTMVar x), rhs: newTMVarIO x}
- warn: {lhs: atomically newEmptyTMVar, rhs: newEmptyTMVarIO}
# TYPEABLE
- hint: {lhs: "typeOf (a :: b)", rhs: "typeRep (Proxy :: Proxy b)"}
# EXCEPTION
- 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}
# IOREF
- hint: {lhs: modifyIORef r (const x), rhs: writeIORef r x}
- hint: {lhs: modifyIORef r (\v -> x), rhs: writeIORef r x}
# STOREABLE/PTR
- 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}
# WEAK POINTERS
- warn: {lhs: mkWeak a a b, rhs: mkWeakPtr a b}
- warn: {lhs: "mkWeak a (a, b) c", rhs: mkWeakPair a b c}
# FOLDABLE
- warn: {lhs: case m of Nothing -> pure (); Just x -> f x, rhs: Data.Foldable.for_ 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.for_ 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.for_ 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.for_ m f}
- hint: {lhs: concatMap f (fmap g x), rhs: concatMap (f . g) x, name: Fuse concatMap/fmap}
- hint: {lhs: concatMap f (g <$> x), rhs: concatMap (f . g) x, name: Fuse concatMap/<$>}
- hint: {lhs: concatMap f (x <&> g), rhs: concatMap (f . g) x, name: Fuse concatMap/<&>}
- warn: {lhs: null (concatMap f x), rhs: all (null . f) x}
- warn: {lhs: or (concat x), rhs: any or x}
- warn: {lhs: or (concatMap f x), rhs: any (or . f) x}
- warn: {lhs: and (concat x), rhs: all and x}
- warn: {lhs: and (concatMap f x), rhs: all (and . f) x}
- warn: {lhs: any f (concat x), rhs: any (any f) x, name: Use any nested}
- warn: {lhs: any f (concatMap g x), rhs: any (any f . g) x, name: Use any nested}
- warn: {lhs: all f (concat x), rhs: all (all f) x, name: Use all nested}
- warn: {lhs: all f (concatMap g x), rhs: all (all f . g) x, name: Use all nested}
- warn: {lhs: fold (concatMap f x), rhs: foldMap (fold . f) x}
- warn: {lhs: foldMap f (concatMap g x), rhs: foldMap (foldMap f . g) x, name: Use foldMap nested}
- warn: {lhs: catMaybes (concatMap f x), rhs: concatMap (catMaybes . f) x, name: Move catMaybes}
- warn: {lhs: catMaybes (concat x), rhs: concatMap catMaybes x, name: Move catMaybes}
- hint: {lhs: filter f (concatMap g x), rhs: concatMap (filter f . g) x, name: Move filter}
- hint: {lhs: filter f (concat x), rhs: concatMap (filter f) x, name: Move filter}
- warn: {lhs: mapMaybe f (concatMap g x), rhs: concatMap (mapMaybe f . g) x, name: Move mapMaybe}
- warn: {lhs: mapMaybe f (concat x), rhs: concatMap (mapMaybe f) x, name: Move mapMaybe}
- warn: {lhs: or (fmap p x), rhs: any p x}
- warn: {lhs: or (p <$> x), rhs: any p x}
- warn: {lhs: or (x <&> p), rhs: any p x}
- warn: {lhs: and (fmap p x), rhs: all p x}
- warn: {lhs: and (p <$> x), rhs: all p x}
- warn: {lhs: and (x <&> p), rhs: all p x}
- warn: {lhs: any f (fmap g x), rhs: any (f . g) x}
- warn: {lhs: any f (g <$> x), rhs: any (f . g) x}
- warn: {lhs: any f (x <&> g), rhs: any (f . g) x}
- warn: {lhs: all f (fmap g x), rhs: all (f . g) x}
- warn: {lhs: all f (g <$> x), rhs: all (f . g) x}
- warn: {lhs: all f (x <&> g), rhs: all (f . g) x}
- hint: {lhs: foldr f z (fmap g x), rhs: foldr (f . g) z x, name: Fuse foldr/fmap}
- hint: {lhs: foldr f z (g <$> x), rhs: foldr (f . g) z x, name: Fuse foldr/<$>}
- hint: {lhs: foldr f z (x <&> g), rhs: foldr (f . g) z x, name: Fuse foldr/<&>}
- warn: {lhs: fold (Data.Foldable.toList x), rhs: fold x}
- warn: {lhs: foldMap f (Data.Foldable.toList x), rhs: foldMap f x}
- warn: {lhs: foldMap' f (Data.Foldable.toList x), rhs: foldMap' f x}
- warn: {lhs: foldr f z (Data.Foldable.toList x), rhs: foldr f z x}
- warn: {lhs: foldr' f z (Data.Foldable.toList x), rhs: foldr' f z x}
- warn: {lhs: foldl f z (Data.Foldable.toList x), rhs: foldl f z x}
- warn: {lhs: foldl' f z (Data.Foldable.toList x), rhs: foldl' f z x}
- warn: {lhs: foldr1 f (Data.Foldable.toList x), rhs: foldr1 f x}
- warn: {lhs: foldl1 f (Data.Foldable.toList x), rhs: foldl1 f x}
- warn: {lhs: null (Data.Foldable.toList x), rhs: null x}
- warn: {lhs: length (Data.Foldable.toList x), rhs: length x}
- warn: {lhs: elem y (Data.Foldable.toList x), rhs: elem y x}
- warn: {lhs: notElem y (Data.Foldable.toList x), rhs: notElem y x}
- warn: {lhs: maximum (Data.Foldable.toList x), rhs: maximum x}
- warn: {lhs: minimum (Data.Foldable.toList x), rhs: minimum x}
- warn: {lhs: maximumBy f (Data.Foldable.toList x), rhs: maximumBy f x}
- warn: {lhs: minimumBy f (Data.Foldable.toList x), rhs: minimumBy f x}
- warn: {lhs: sum (Data.Foldable.toList x), rhs: sum x}
- warn: {lhs: product (Data.Foldable.toList x), rhs: product x}
- warn: {lhs: and (Data.Foldable.toList x), rhs: and x}
- warn: {lhs: or (Data.Foldable.toList x), rhs: or x}
- warn: {lhs: all f (Data.Foldable.toList x), rhs: all f x}
- warn: {lhs: any f (Data.Foldable.toList x), rhs: any f x}
- warn: {lhs: find f (Data.Foldable.toList x), rhs: find f x}
- warn: {lhs: concat (Data.Foldable.toList x), rhs: concat x}
- warn: {lhs: concatMap f (Data.Foldable.toList x), rhs: concatMap f x}
# STATE MONAD
- warn: {lhs: f <$> Control.Monad.State.get, rhs: gets f}
- warn: {lhs: Control.Monad.State.get <&> f, 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: Control.Monad.State.gets g <&> f, 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: Control.Monad.Reader.ask <&> f, 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: Control.Monad.Reader.asks g <&> f, 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}
# EVALUATE
- 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: fromJust (Just x), rhs: x, name: Evaluate}
- warn: {lhs: fromLeft y (Left x), rhs: x, name: Evaluate}
- warn: {lhs: fromLeft y (Right x), rhs: "y", name: Evaluate}
- warn: {lhs: fromRight y (Right x), rhs: x, name: Evaluate}
- warn: {lhs: fromRight y (Left x), rhs: "y", name: Evaluate}
- warn: {lhs: "head [x]", rhs: "x", name: Evaluate}
- warn: {lhs: "last [x]", rhs: "x", name: Evaluate}
- warn: {lhs: "tail [x]", rhs: "[]", 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}