Skip to content

Latest commit

 

History

History
12227 lines (12181 loc) · 106 KB

hints.md

File metadata and controls

12227 lines (12181 loc) · 106 KB

Summary of Hints

This page is auto-generated from hlint --generate-summary.

Builtin List

Hint Name Hint Severity
Move guards forward Example: foo = [x + 1 | x <- [1..10], feature]
Found: [x + 1 | x <- [1 .. 10], feature]
Suggestion: [x + 1 | feature, x <- [1 .. 10]]
Suggestion
Move map inside list comprehension Example: foo = map f [x + 1 | x <- [1..10]]
Found: map f [x + 1 | x <- [1 .. 10]]
Suggestion: [f (x + 1) | x <- [1 .. 10]]
Suggestion
Redundant True guards Example: foo = [myexpr | True, a]
Found: [myexpr | True, a]
Suggestion: [myexpr | a]
Suggestion
Short-circuited list comprehension Example: foo = [myexpr | False]
Found: [myexpr | False]
Suggestion: []
Suggestion
Use : Example: yes = [x] ++ xs
Found: [x] ++ xs
Suggestion: x : xs
Suggestion
Use String Example: data Yes = Yes (Maybe [Char])
Found: Maybe [Char]
Suggestion: Maybe String
Ignore
Use list literal Example: yes = 1:2:[]
Found: 1 : 2 : []
Suggestion: [1, 2]
Suggestion
Use list literal pattern Example: yes (1:2:[]) = 1
Found: (1 : 2 : [])
Suggestion: [1, 2]
Suggestion

Builtin ListRec

Hint Name Hint Severity
Use foldM Example: f [] a = return a ; f (x:xs) a = a + x >>= \fax -> f xs fax
Found:
f [] a = return a
f (x : xs) a = a + x >>= \ fax -> f xs fax
Suggestion: f xs a = foldM (+) a xs
Suggestion
Use foldl Example: f z (x:xs) = f (z*x) xs ; f z [] = z
Found:
f z (x : xs) = f (z * x) xs
f z [] = z
Suggestion: f z xs = foldl (*) z xs
Suggestion
Use foldr Example: f (x:xs) = negate x + f xs ; f [] = 0
Found:
f (x : xs) = negate x + f xs
f [] = 0
Suggestion: f xs = foldr ((+) . negate) 0 xs
Suggestion
Use map Example: f (x:xs) = x + 1 : f xs ; f [] = []
Found:
f (x : xs) = x + 1 : f xs
f [] = []
Suggestion: f xs = map (+ 1) xs
Warning

Builtin Monad

Hint Name Hint Severity
Redundant do Example: yes = do (bar+foo)
Found: do
Suggestion: Perhaps you should remove it.
Ignore
Redundant return Example: yes = do bar; a <- foo; return a
Found:
do bar
   a <- foo
   return a
Suggestion:
do bar
   foo
Warning
Redundant variable capture Example: main = do _ <- forM_ f xs; bar
Found: _ <- forM_ f xs
Suggestion: forM_ f xs
Warning
Redundant void Example: main = void $ forM_ f xs
Found: void $ forM_ f xs
Suggestion: forM_ f xs
Warning
Use <$> Example: yes = do x <- bar; return (f x)
Found:
do x <- bar
   return (f x)
Suggestion: do f <$> bar
Warning
Use foldM_ Example: folder f a xs = foldM f a xs >> return ()
Found: foldM f a xs
Suggestion: foldM_ f a xs
Warning
Use forM_ Example: yes = do forM files $ \x -> return (); return ()
Found: forM files $ \ x -> return ()
Suggestion: forM_ files $ \ x -> return ()
Warning
Use join Example: yes = do x <- bar; x
Found:
do x <- bar
   x
Suggestion: do join bar
Warning
Use let Example: yes = do x <- return y; foo x
Found: x <- return y
Suggestion: let x = y
Suggestion
Use mapM_ Example: yes = do mapM print a; return b
Found: mapM print a
Suggestion: mapM_ print a
Warning

Builtin Lambda

Hint Name Hint Severity
Avoid lambda Example: f = foo (\y -> g x . h $ y)
Found: \ y -> g x . h $ y
Suggestion: g x . h
Suggestion
Avoid lambda Example: f = foo (\x y -> fun x y)
Found: (\ x y -> fun x y)
Suggestion: fun
Warning
Avoid lambda using `infix` Example: foo x = bar (\ d -> search d table)
Found: (\ d -> search d table)
Suggestion: (`search` table)
Suggestion
Collapse lambdas Example: f = foo (\x -> \y -> x x y y)
Found: \ x -> \ y -> x x y y
Suggestion: \ x y -> x x y y
Suggestion
Eta reduce Example: fun x y z = f x y z
Found: fun x y z = f x y z
Suggestion: fun = f
Warning
Redundant lambda Example: f a = \x -> x + x
Found: f a = \ x -> x + x
Suggestion: f a x = x + x
Warning
Use lambda Example: foo = bar (\x -> case x of Y z -> z)
Found: \ x -> case x of Y z -> z
Suggestion: \ (Y z) -> z
Suggestion
Use lambda-case Example: yes = blah (\ x -> case x of A -> a; B -> b)
Found:
\ x
  -> case x of
       A -> a
       B -> b
Suggestion:
\case
  A -> a
  B -> b
Does not support refactoring.
Suggestion
Use section Example: f = foo ((*) x)
Found: ((*) x)
Suggestion: (x *)
Suggestion
Use tuple-section Example: yes = blah (\ x -> (y, x))
Found: \ x -> (y, x)
Suggestion: (y,)
Does not support refactoring.
Suggestion

Builtin Fixities

Hint Name Hint Severity
Redundant bracket due to operator fixities Example: yes = 1 + (2 * 3)
Found: 1 + (2 * 3)
Suggestion: 1 + 2 * 3
Ignore

Builtin Bracket

Hint Name Hint Severity
Move brackets to avoid $ Example: yes = (b $ c d) ++ e
Found: (b $ c d) ++ e
Suggestion: b (c d) ++ e
Suggestion
Redundant $ Example: yes = split "to" $ names
Found: split "to" $ names
Suggestion: split "to" names
Suggestion
Redundant bracket Example: yes = (f x) x
Found: (f x) x
Suggestion: f x x
Suggestion
Redundant bracket Example: yes = (foo)
Found: (foo)
Suggestion: foo
Warning
Redundant section Example: issue970 = (f x +) (g x)
Found: (f x +) (g x)
Suggestion: f x + (g x)
Suggestion

Builtin Naming

Hint Name Hint Severity
Use camelCase Example: data Yes = Bar | Test_Bar
Found: data Yes = Bar | Test_Bar
Suggestion: data Yes = Bar | TestBar
Does not support refactoring.
Suggestion

Builtin Pattern

Hint Name Hint Severity
Redundant as-pattern Example: foo x@_ = x
Found: x@_
Suggestion: x
Warning
Redundant bang pattern Example: foo = case v of !True -> x
Found: !True
Suggestion: True
Warning
Redundant case Example: foo = case f v of _ -> x
Found: case f v of _ -> x
Suggestion: x
Suggestion
Redundant guard Example: foo x | otherwise = y
Found: foo x | otherwise = y
Suggestion: foo x = y
Suggestion
Redundant irrefutable pattern Example: foo = let ~x = 1 in y
Found: ~x
Suggestion: x
Warning
Redundant where Example: foo x = x + x where
Found: where
Suggestion: Perhaps you should remove it.
Does not support refactoring.
Suggestion
Use guards Example: yes x y = if a then b else if c then d else e
Found: yes x y = if a then b else if c then d else e
Suggestion:
yes x y
  | a = b
  | c = d
  | otherwise = e
Suggestion
Use otherwise Example: foo x | a = b | True = d
Found:
foo x
  | a = b
  | True = d
Suggestion:
foo x
  | a = b
  | otherwise = d
Suggestion
Use record patterns Example: foo (Bar _ _ _ _) = x
Found: Bar _ _ _ _
Suggestion: Bar {}
Suggestion
Used otherwise as a pattern Example: foo otherwise = 1
Found: otherwise
Suggestion: _
Does not support refactoring.
Warning

Builtin Import

Hint Name Hint Severity
Redundant as Example: import A as A
Found: import A as A
Suggestion: import A
Suggestion
Use fewer imports Example: import A; import A
Found:
import A
import A
Suggestion:
import A
Warning

Builtin Export

Hint Name Hint Severity
Use explicit module export list Example: module Foo(module Foo) where foo = 1
Found:
module Foo (
        module Foo
    ) where
Suggestion:
module Foo (
         ... 
    ) where
Does not support refactoring.
Ignore
Use module export list Example: module Foo where foo = 1
Found: module Foo where
Suggestion:
module Foo (
        module Foo
    ) where
Does not support refactoring.
Ignore

Builtin Pragma

Hint Name Hint Severity
Use LANGUAGE pragmas Example: {-# OPTIONS_GHC -cpp #-}
Found:
{-# OPTIONS_GHC -cpp #-}
Suggestion:
{-# LANGUAGE CPP #-}
Warning
Use fewer LANGUAGE pragmas Example: {-# LANGUAGE RebindableSyntax, EmptyCase, RebindableSyntax #-}
Found: {-# LANGUAGE RebindableSyntax, EmptyCase, RebindableSyntax #-}
Suggestion: {-# LANGUAGE RebindableSyntax, EmptyCase #-}
Warning

Builtin Extensions

Hint Name Hint Severity
Unused LANGUAGE pragma Example:
{-# LANGUAGE Arrows #-} 
f = id
Found: {-# LANGUAGE Arrows #-}
Suggestion: Perhaps you should remove it.
Warning

Builtin Unsafe

Hint Name Hint Severity
Missing NOINLINE pragma Example: entries = unsafePerformIO Multimap.newIO
Found: entries = unsafePerformIO Multimap.newIO
Suggestion:
{-# NOINLINE entries #-}
entries = unsafePerformIO Multimap.newIO
Warning

Builtin Duplicate

Hint Name Hint Severity

Builtin Restrict

Hint Name Hint Severity

Builtin Comment

Hint Name Hint Severity
Fix pragma markup Example: {- MISSING HASH #-}
Found: {- MISSING HASH #-}
Suggestion: {-# MISSING HASH #-}
Suggestion
Use pragma syntax Example: {- INLINE Y -}
Found: {- INLINE Y -}
Suggestion: {-# INLINE Y #-}
Suggestion

Builtin NewType

Hint Name Hint Severity
Use DerivingStrategies Example: newtype Foo = Foo Int deriving (Show, Eq)
Found:
newtype Foo
  = Foo Int
  deriving (Show, Eq)
Suggestion:
Does not support refactoring.
Ignore
Use newtype instead of data Example: data Foo = Foo Int
Found: data Foo = Foo Int
Suggestion: newtype Foo = Foo Int
Does not support refactoring.
Suggestion

Builtin Smell

Hint Name Hint Severity

Builtin NumLiteral

Hint Name Hint Severity
Use underscore Example:
{-# LANGUAGE NumericUnderscores #-} 
12345
Found: 12345
Suggestion: 12_345
Suggestion

Configured hints

Hint Name Hint Severity
Use print LHS: putStrLn (show x)
RHS: print x
Warning
Use putStrLn LHS: putStr (x ++ "\n")
RHS: putStrLn x
Warning
Use putStrLn LHS: putStr (x ++ y ++ "\n")
RHS: putStrLn (x ++ y)
Warning
Use putStr LHS: mapM_ putChar
RHS: putStr
Warning
Use getChar LHS: hGetChar stdin
RHS: getChar
Warning
Use getLine LHS: hGetLine stdin
RHS: getLine
Warning
Use getContents LHS: hGetContents stdin
RHS: getContents
Warning
Use putChar LHS: hPutChar stdout
RHS: putChar
Warning
Use putStr LHS: hPutStr stdout
RHS: putStr
Warning
Use putStrLn LHS: hPutStrLn stdout
RHS: putStrLn
Warning
Use print LHS: hPrint stdout
RHS: print
Warning
Use hReady LHS: hWaitForInput a 0
RHS: hReady a
Warning
Use hPrint LHS: hPutStrLn a (show b)
RHS: hPrint a b
Warning
Use isEOF LHS: hIsEOF stdin
RHS: isEOF
Warning
Use writeFile LHS: withFile f WriteMode (\ h -> hPutStr h x)
RHS: writeFile f x
Warning
Use writeFile LHS: withFile f WriteMode (\ h -> hPutStrLn h x)
RHS: writeFile f (x ++ "\n")
Warning
Use appendFile LHS: withFile f AppendMode (\ h -> hPutStr h x)
RHS: appendFile f x
Warning
Use appendFile LHS: withFile f AppendMode (\ h -> hPutStrLn h x)
RHS: appendFile f (x ++ "\n")
Warning
Use exitSuccess LHS: exitWith ExitSuccess
RHS: exitSuccess
Warning
Use /= LHS: not (a == b)
RHS: a /= b
Warning
Use == LHS: not (a /= b)
RHS: a == b
Warning
Use <= LHS: not (a > b)
RHS: a <= b
Warning
Use < LHS: not (a >= b)
RHS: a < b
Warning
Use >= LHS: not (a < b)
RHS: a >= b
Warning
Use > LHS: not (a <= b)
RHS: a > b
Warning
Use <= LHS: compare x y /= GT
RHS: x <= y
Warning
Use < LHS: compare x y == LT
RHS: x < y
Warning
Use >= LHS: compare x y /= LT
RHS: x >= y
Warning
Use > LHS: compare x y == GT
RHS: x > y
Warning
Redundant compare LHS: compare x y == EQ
RHS: x == y
Warning
Redundant compare LHS: compare x y /= EQ
RHS: x /= y
Warning
Use minimum LHS: head (sort x)
RHS: minimum x
Warning
Use maximum LHS: last (sort x)
RHS: maximum x
Warning
Use minimumBy LHS: head (sortBy f x)
RHS: minimumBy f x
Warning
Use maximumBy LHS: last (sortBy f x)
RHS: maximumBy f x
Warning
Avoid reverse LHS: reverse (sortBy f x)
RHS: sortBy (flip f) x
Warning
Use sortOn LHS: sortBy (flip (comparing f))
RHS: sortOn (Down . f)
Warning
Use sortOn LHS: sortBy (comparing f)
RHS: sortOn f
Warning
Avoid reverse LHS: reverse (sortOn f x)
RHS: sortOn (Data.Ord.Down . f) x
Warning
Move flip LHS: flip (g `on` h)
RHS: flip g `on` h
Suggestion
Fuse on/on LHS: (f `on` g) `on` h
RHS: f `on` (g . h)
Suggestion
Use show LHS: showsPrec 0 x ""
RHS: show x
Warning
Use reads LHS: readsPrec 0
RHS: reads
Warning
Use shows LHS: showsPrec 0
RHS: shows
Warning
Use showHex LHS: showIntAtBase 16 intToDigit
RHS: showHex
Suggestion
Use showOct LHS: showIntAtBase 8 intToDigit
RHS: showOct
Suggestion
Use concatMap LHS: concat (map f x)
RHS: concatMap f x
Warning
Use concatMap LHS: concat (fmap f x)
RHS: concatMap f x
Warning
Use ++ LHS: concat [a, b]
RHS: a ++ b
Suggestion
Use map once LHS: map f (map g x)
RHS: map (f . g) x
Suggestion
Fuse concatMap/map LHS: concatMap f (map g x)
RHS: concatMap (f . g) x
Suggestion
Use head LHS: x !! 0
RHS: head x
Suggestion
Use replicate LHS: take n (repeat x)
RHS: replicate n x
Warning
Redundant map LHS: map f (replicate n x)
RHS: replicate n (f x)
Warning
Redundant map LHS: map f (repeat x)
RHS: repeat (f x)
Warning
Use repeat LHS: cycle [x]
RHS: repeat x
Warning
Use last LHS: head (reverse x)
RHS: last x
Warning
Use !! LHS: head (drop n x)
RHS: x !! n
Warning
Use !! LHS: head (drop n x)
RHS: x !! max 0 n
Warning
Use tail LHS: reverse (init x)
RHS: tail (reverse x)
Warning
Use init LHS: reverse (tail (reverse x))
RHS: init x
Warning
Avoid reverse LHS: reverse (reverse x)
RHS: x
Warning
Use isSuffixOf LHS: isPrefixOf (reverse x) (reverse y)
RHS: isSuffixOf x y
Warning
Use concat LHS: foldr (++) []
RHS: concat
Warning
Use concat LHS: foldr (++) ""
RHS: concat
Warning
Use concatMap LHS: foldr ((++) . f) []
RHS: concatMap f
Warning
Use concatMap LHS: foldr ((++) . f) ""
RHS: concatMap f
Warning
Use concat LHS: foldl (++) []
RHS: concat
Warning
Use concat LHS: foldl (++) ""
RHS: concat
Warning
Use foldl1 LHS: foldl f (head x) (tail x)
RHS: foldl1 f x
Warning
Use foldr1 LHS: foldr f (last x) (init x)
RHS: foldr1 f x
Warning
Use map LHS: foldr (\ c a -> x : a) []
RHS: map (\ c -> x)
Warning
Use $ LHS: foldr (.) id l z
RHS: foldr ($) z l
Warning
Use break LHS: span (not . p)
RHS: break p
Warning
Use span LHS: break (not . p)
RHS: span p
Warning
Use span LHS: (takeWhile p x, dropWhile p x)
RHS: span p x
Warning
Use takeWhile LHS: fst (span p x)
RHS: takeWhile p x
Warning
Use dropWhile LHS: snd (span p x)
RHS: dropWhile p x
Warning
Use takeWhile LHS: fst (break p x)
RHS: takeWhile (not . p) x
Warning
Use dropWhile LHS: snd (break p x)
RHS: dropWhile (not . p) x
Warning
Use splitAt LHS: (take n x, drop n x)
RHS: splitAt n x
Warning
Use take LHS: fst (splitAt p x)
RHS: take p x
Warning
Use drop LHS: snd (splitAt p x)
RHS: drop p x
Warning
Use unlines LHS: concatMap (++ "\n")
RHS: unlines
Warning
Redundant map LHS: map id
RHS: id
Warning
Use concat LHS: concatMap id
RHS: concat
Warning
Use any LHS: or (map p x)
RHS: any p x
Warning
Use all LHS: and (map p x)
RHS: all p x
Warning
Redundant map LHS: any f (map g x)
RHS: any (f . g) x
Warning
Redundant map LHS: all f (map g x)
RHS: all (f . g) x
Warning
Use zip LHS: zipWith (,)
RHS: zip
Warning
Use zip3 LHS: zipWith3 (,,)
RHS: zip3
Warning
Use unzip LHS: map fst &&& map snd
RHS: unzip
Suggestion
Use null LHS: length x == 0
RHS: null x
Suggestion
Use null LHS: 0 == length x
RHS: null x
Suggestion
Use null LHS: length x < 1
RHS: null x
Suggestion
Use null LHS: 1 > length x
RHS: null x
Suggestion
Use null LHS: length x <= 0
RHS: null x
Suggestion
Use null LHS: 0 >= length x
RHS: null x
Suggestion
Use null LHS: x == []
RHS: null x
Suggestion
Use null LHS: [] == x
RHS: null x
Suggestion
Use null LHS: all (const False)
RHS: null
Suggestion
Use null LHS: any (const True) x
RHS: not (null x)
Suggestion
Use null LHS: length x /= 0
RHS: not (null x)
Suggestion
Use null LHS: 0 /= length x
RHS: not (null x)
Suggestion
Use : LHS: \ x -> [x]
RHS: (: [])
Suggestion
Use zipWith LHS: map f (zip x y)
RHS: zipWith (curry f) x y
Suggestion
Use maybe LHS: map f (fromMaybe [] x)
RHS: maybe [] (map f) x
Suggestion
Use notElem LHS: not (elem x y)
RHS: notElem x y
Warning
Fuse foldr/map LHS: foldr f z (map g x)
RHS: foldr (f . g) z x
Suggestion
Use unwords LHS: x ++ concatMap (' ' :) y
RHS: unwords (x : y)
Warning
Use unwords LHS: intercalate " "
RHS: unwords
Warning
Use intercalate LHS: concat (intersperse x y)
RHS: intercalate x y
Suggestion
Use unwords LHS: concat (intersperse " " x)
RHS: unwords x
Suggestion
Use all LHS: null (concat x)
RHS: all null x
Warning
Use any LHS: null (filter f x)
RHS: not (any f x)
Warning
Use any LHS: filter f x == []
RHS: not (any f x)
Warning
Use any LHS: filter f x /= []
RHS: any f x
Warning
Use or LHS: any id
RHS: or
Warning
Use and LHS: all id
RHS: and
Warning
Hoist not LHS: any (not . f) x
RHS: not (all f x)
Warning
Hoist not LHS: all (not . f) x
RHS: not (any f x)
Warning
Use elem LHS: any ((==) a)
RHS: elem a
Warning
Use elem LHS: any (== a)
RHS: elem a
Warning
Use elem LHS: any (a ==)
RHS: elem a
Warning
Use notElem LHS: all ((/=) a)
RHS: notElem a
Warning
Use notElem LHS: all (/= a)
RHS: notElem a
Warning
Use notElem LHS: all (a /=)
RHS: notElem a
Warning
Use or LHS: elem True
RHS: or
Warning
Use and LHS: notElem False
RHS: and
Warning
Use or LHS: True `elem` l
RHS: or l
Warning
Use and LHS: False `notElem` l
RHS: and l
Warning
Use elemIndex LHS: findIndex ((==) a)
RHS: elemIndex a
Warning
Use elemIndex LHS: findIndex (a ==)
RHS: elemIndex a
Warning
Use elemIndex LHS: findIndex (== a)
RHS: elemIndex a
Warning
Use elemIndices LHS: findIndices ((==) a)
RHS: elemIndices a
Warning
Use elemIndices LHS: findIndices (a ==)
RHS: elemIndices a
Warning
Use elemIndices LHS: findIndices (== a)
RHS: elemIndices a
Warning
Use elemIndex LHS: lookup b (zip l [0 .. ])
RHS: elemIndex b l
Warning
Use == LHS: elem x [y]
RHS: x == y
Suggestion
Use /= LHS: notElem x [y]
RHS: x /= y
Suggestion
Use max LHS: length [1 .. n]
RHS: max 0 n
Suggestion
Length always non-negative LHS: length x >= 0
RHS: True
Suggestion
Length always non-negative LHS: 0 <= length x
RHS: True
Suggestion
Use null LHS: length x > 0
RHS: not (null x)
Suggestion
Use null LHS: 0 < length x
RHS: not (null x)
Suggestion
Use null LHS: length x >= 1
RHS: not (null x)
Suggestion
Use null LHS: 1 <= length x
RHS: not (null x)
Suggestion
Take on a non-positive LHS: take i x
RHS: []
Warning
Drop on a non-positive LHS: drop i x
RHS: x
Warning
Use foldl LHS: last (scanl f z x)
RHS: foldl f z x
Warning
Use foldr LHS: head (scanr f z x)
RHS: foldr f z x
Warning
Use repeat LHS: iterate id
RHS: repeat
Warning
Use map LHS: zipWith f (repeat x)
RHS: map (f x)
Warning
Use map LHS: zipWith f y (repeat z)
RHS: map (`f` z) y
Warning
Use find LHS: listToMaybe (filter p x)
RHS: find p x
Warning
Redundant take LHS: zip (take n x) (take n y)
RHS: take n (zip x y)
Warning
Redundant take LHS: zip (take n x) (take m y)
RHS: take (min n m) (zip x y)
Warning
Monoid law, left identity LHS: mempty <> x
RHS: x
Warning
Monoid law, left identity LHS: mempty `mappend` x
RHS: x
Warning
Monoid law, right identity LHS: x <> mempty
RHS: x
Warning
Monoid law, right identity LHS: x `mappend` mempty
RHS: x
Warning
Use fold LHS: foldr (<>) mempty
RHS: Data.Foldable.fold
Warning
Use fold LHS: foldr mappend mempty
RHS: Data.Foldable.fold
Warning
Evaluate LHS: mempty x
RHS: mempty
Warning
Evaluate LHS: x `mempty` y
RHS: mempty
Warning
Traversable law LHS: traverse pure
RHS: pure
Warning
Traversable law LHS: traverse (pure . f) x
RHS: pure (fmap f x)
Warning
Use traverse LHS: sequenceA (map f x)
RHS: traverse f x
Warning
Use traverse LHS: sequenceA (fmap f x)
RHS: traverse f x
Warning
Use traverse_ LHS: sequenceA_ (map f x)
RHS: traverse_ f x
Warning
Use traverse_ LHS: sequenceA_ (fmap f x)
RHS: traverse_ f x
Warning
Use fold LHS: foldMap id
RHS: fold
Warning
Use foldMap LHS: fold (fmap f x)
RHS: foldMap f x
Warning
Use foldMap LHS: fold (map f x)
RHS: foldMap f x
Warning
Fuse foldMap/fmap LHS: foldMap f (fmap g x)
RHS: foldMap (f . g) x
Warning
Fuse foldMap/map LHS: foldMap f (map g x)
RHS: foldMap (f . g) x
Warning
Use delete LHS: deleteBy (==)
RHS: delete
Warning
Use group LHS: groupBy (==)
RHS: group
Warning
Use insert LHS: insertBy compare
RHS: insert
Warning
Use intersect LHS: intersectBy (==)
RHS: intersect
Warning
Use maximum LHS: maximumBy compare
RHS: maximum
Warning
Use minimum LHS: minimumBy compare
RHS: minimum
Warning
Use nub LHS: nubBy (==)
RHS: nub
Warning
Use sort LHS: sortBy compare
RHS: sort
Warning
Use union LHS: unionBy (==)
RHS: union
Warning
Use sequence_ LHS: foldr (>>) (return ())
RHS: sequence_
Warning
Use and LHS: foldr (&&) True
RHS: and
Warning
Use and LHS: foldl (&&) True
RHS: and
Warning
Use and LHS: foldr1 (&&)
RHS: and
Warning
Use and LHS: foldl1 (&&)
RHS: and
Warning
Use or LHS: foldr (||) False
RHS: or
Warning
Use or LHS: foldl (||) False
RHS: or
Warning
Use or LHS: foldr1 (||)
RHS: or
Warning
Use or LHS: foldl1 (||)
RHS: or
Warning
Use sum LHS: foldl (+) 0
RHS: sum
Warning
Use sum LHS: foldr (+) 0
RHS: sum
Warning
Use sum LHS: foldl1 (+)
RHS: sum
Warning
Use sum LHS: foldr1 (+)
RHS: sum
Warning
Use product LHS: foldl (*) 1
RHS: product
Warning
Use product LHS: foldr (*) 1
RHS: product
Warning
Use product LHS: foldl1 (*)
RHS: product
Warning
Use product LHS: foldr1 (*)
RHS: product
Warning
Use maximum LHS: foldl1 max
RHS: maximum
Warning
Use maximum LHS: foldr1 max
RHS: maximum
Warning
Use minimum LHS: foldl1 min
RHS: minimum
Warning
Use minimum LHS: foldr1 min
RHS: minimum
Warning
Use msum LHS: foldr mplus mzero
RHS: msum
Warning
Use id LHS: \ x -> x
RHS: id
Warning
Use const LHS: \ x y -> x
RHS: const
Warning
Use const LHS: curry fst
RHS: const
Warning
Redundant curry LHS: curry snd
RHS: \ _ x -> x
Warning
Redundant flip LHS: flip const
RHS: \ _ x -> x
Warning
Use snd LHS: \ (x, y) -> y
RHS: snd
Warning
Use fst LHS: \ (x, y) -> x
RHS: fst
Warning
Use curry LHS: \ x y -> f (x, y)
RHS: curry f
Suggestion
Use uncurry LHS: \ (x, y) -> f x y
RHS: uncurry f
Suggestion
Use uncurry LHS: f (fst p) (snd p)
RHS: uncurry f p
Warning
Redundant uncurry LHS: uncurry (\ x y -> z)
RHS: \ (x, y) -> z
Warning
Redundant curry LHS: curry (\ (x, y) -> z)
RHS: \ x y -> z
Warning
Redundant uncurry LHS: uncurry (curry f)
RHS: f
Warning
Redundant curry LHS: curry (uncurry f)
RHS: f
Warning
Redundant uncurry LHS: uncurry f (a, b)
RHS: f a b
Warning
Redundant $ LHS: ($) (f x)
RHS: f x
Warning
Redundant $ LHS: (f $)
RHS: f
Warning
Redundant & LHS: (& f)
RHS: f
Warning
Use const LHS: \ x -> y
RHS: const y
Suggestion
Redundant flip LHS: flip f x y
RHS: f y x
Warning
Redundant id LHS: id x
RHS: x
Warning
Redundant id LHS: id . x
RHS: x
Warning
Redundant id LHS: x . id
RHS: x
Warning
Use tuple-section LHS: ((,) x)
RHS: (_noParen_ x,)
Warning
Use tuple-section LHS: flip (,) x
RHS: (, _noParen_ x)
Warning
Redundant flip LHS: flip (flip f)
RHS: f
Warning
Redundant flip LHS: flip f <*> g
RHS: f =<< g
Warning
Redundant flip LHS: g <**> flip f
RHS: g >>= f
Warning
Redundant flip LHS: flip f =<< g
RHS: f <*> g
Warning
Redundant flip LHS: g >>= flip f
RHS: g Control.Applicative.<**> f
Warning
Use isAsciiLower LHS: a >= 'a' && a <= 'z'
RHS: isAsciiLower a
Warning
Use isAsciiUpper LHS: a >= 'A' && a <= 'Z'
RHS: isAsciiUpper a
Warning
Use isDigit LHS: a >= '0' && a <= '9'
RHS: isDigit a
Warning
Use isOctDigit LHS: a >= '0' && a <= '7'
RHS: isOctDigit a
Warning
Use isAlpha LHS: isLower a || isUpper a
RHS: isAlpha a
Warning
Use isAlpha LHS: isUpper a || isLower a
RHS: isAlpha a
Warning
Redundant == LHS: x == True
RHS: x
Warning
Redundant == LHS: x == False
RHS: not x
Suggestion
Redundant == LHS: True == a
RHS: a
Warning
Redundant == LHS: False == a
RHS: not a
Suggestion
Redundant /= LHS: a /= True
RHS: not a
Warning
Redundant /= LHS: a /= False
RHS: a
Suggestion
Redundant /= LHS: True /= a
RHS: not a
Warning
Redundant /= LHS: False /= a
RHS: a
Suggestion
Redundant if LHS: if a then x else x
RHS: x
Warning
Redundant if LHS: if a then True else False
RHS: a
Warning
Redundant if LHS: if a then False else True
RHS: not a
Warning
Redundant if LHS: if a then t else (if b then t else f)
RHS: if a || b then t else f
Warning
Redundant if LHS: if a then (if b then t else f) else f
RHS: if a && b then t else f
Warning
Redundant if LHS: if x then True else y
RHS: x || y
Warning
Redundant if LHS: if x then y else False
RHS: x && y
Warning
Redundant multi-way if LHS:
if | b -> t
   | otherwise -> f
RHS: if b then t else f
Warning
Use if LHS:
case a of
  True -> t
  False -> f
RHS: if a then t else f
Suggestion
Use if LHS:
case a of
  False -> f
  True -> t
RHS: if a then t else f
Suggestion
Use if LHS:
case a of
  True -> t
  _ -> f
RHS: if a then t else f
Suggestion
Use if LHS:
case a of
  False -> f
  _ -> t
RHS: if a then t else f
Suggestion
Redundant if LHS: if c then (True, x) else (False, x)
RHS: (c, x)
Suggestion
Redundant if LHS: if c then (False, x) else (True, x)
RHS: (not c, x)
Suggestion
Use || LHS: or [x, y]
RHS: x || y
Suggestion
Use || LHS: or [x, y, z]
RHS: x || y || z
Suggestion
Use && LHS: and [x, y]
RHS: x && y
Suggestion
Use && LHS: and [x, y, z]
RHS: x && y && z
Suggestion
Redundant if LHS: if x then False else y
RHS: not x && y
Warning
Redundant if LHS: if x then y else True
RHS: not x || y
Warning
Redundant not LHS: not (not x)
RHS: x
Warning
Use second LHS: id *** g
RHS: second g
Warning
Use first LHS: f *** id
RHS: first f
Warning
Use &&& LHS: zip (map f x) (map g x)
RHS: map (f Control.Arrow.&&& g) x
Ignore
Use &&& LHS: \ x -> (f x, g x)
RHS: f Control.Arrow.&&& g
Ignore
Redundant pair LHS: (fst x, snd x)
RHS: x
Suggestion
Use second LHS: bimap id g
RHS: second g
Warning
Use first LHS: bimap f id
RHS: first f
Warning
Redundant first LHS: first id
RHS: id
Warning
Redundant second LHS: second id
RHS: id
Warning
Redundant bimap LHS: bimap id id
RHS: id
Warning
Use bimap LHS: first f (second g x)
RHS: bimap f g x
Warning
Use bimap LHS: second g (first f x)
RHS: bimap f g x
Warning
Redundant first LHS: first f (first g x)
RHS: first (f . g) x
Warning
Redundant second LHS: second f (second g x)
RHS: second (f . g) x
Warning
Redundant bimap LHS: bimap f h (bimap g i x)
RHS: bimap (f . g) (h . i) x
Warning
Redundant first LHS: first f (bimap g h x)
RHS: bimap (f . g) h x
Warning
Redundant second LHS: second g (bimap f h x)
RHS: bimap f (g . h) x
Warning
Redundant first LHS: bimap f h (first g x)
RHS: bimap (f . g) h x
Warning
Redundant second LHS: bimap f g (second h x)
RHS: bimap f (g . h) x
Warning
Use bimap LHS: \ (x, y) -> (f x, g y)
RHS: Data.Bifunctor.bimap f g
Suggestion
Use first LHS: \ (x, y) -> (f x, y)
RHS: Data.Bifunctor.first f
Suggestion
Use second LHS: \ (x, y) -> (x, f y)
RHS: Data.Bifunctor.second f
Suggestion
Use bimap LHS: (f (fst x), g (snd x))
RHS: Data.Bifunctor.bimap f g x
Suggestion
Use first LHS: (f (fst x), snd x)
RHS: Data.Bifunctor.first f x
Suggestion
Use second LHS: (fst x, g (snd x))
RHS: Data.Bifunctor.second g x
Suggestion
Functor law LHS: fmap f (fmap g x)
RHS: fmap (f . g) x
Warning
Functor law LHS: f <$> g <$> x
RHS: f . g <$> x
Warning
Functor law LHS: fmap id
RHS: id
Warning
Functor law LHS: id <$> x
RHS: x
Warning
Use <$> LHS: fmap f $ x
RHS: f <$> x
Suggestion
Use fmap LHS: \ x -> a <$> b x
RHS: fmap a . b
Suggestion
Use $> LHS: x *> pure y
RHS: x Data.Functor.$> y
Suggestion
Use $> LHS: x *> return y
RHS: x Data.Functor.$> y
Suggestion
Use <$ LHS: pure x <* y
RHS: x Data.Functor.<$ y
Suggestion
Use <$ LHS: return x <* y
RHS: x Data.Functor.<$ y
Suggestion
Use <$ LHS: const x <$> y
RHS: x <$ y
Suggestion
Use <$ LHS: pure x <$> y
RHS: x <$ y
Suggestion
Use <$ LHS: return x <$> y
RHS: x <$ y
Suggestion
Use $> LHS: x <&> const y
RHS: x Data.Functor.$> y
Suggestion
Use $> LHS: x <&> pure y
RHS: x Data.Functor.$> y
Suggestion
Use $> LHS: x <&> return y
RHS: x Data.Functor.$> y
Suggestion
Use <$> LHS: return x <*> y
RHS: x <$> y
Suggestion
Use <$> LHS: pure x <*> y
RHS: x <$> y
Suggestion
Redundant <* LHS: x <* pure y
RHS: x
Warning
Redundant pure LHS: pure x *> y
RHS: y
Warning
Monad law, left identity LHS: return a >>= f
RHS: f a
Warning
Monad law, left identity LHS: f =<< return a
RHS: f a
Warning
Monad law, right identity LHS: m >>= return
RHS: m
Warning
Monad law, right identity LHS: return =<< m
RHS: m
Warning
Use fmap LHS: liftM
RHS: fmap
Warning
Use fmap LHS: liftA
RHS: fmap
Warning
Use <&> LHS: m >>= return . f
RHS: m Data.Functor.<&> f
Suggestion
Use <$> LHS: return . f =<< m
RHS: f <$> m
Suggestion
Redundant fmap LHS: fmap f x >>= g
RHS: x >>= g . f
Warning
Redundant <$> LHS: f <$> x >>= g
RHS: x >>= g . f
Warning
Redundant <&> LHS: x Data.Functor.<&> f >>= g
RHS: x >>= g . f
Warning
Redundant fmap LHS: g =<< fmap f x
RHS: g . f =<< x
Warning
Redundant <$> LHS: g =<< f <$> x
RHS: g . f =<< x
Warning
Redundant <&> LHS: g =<< (x Data.Functor.<&> f)
RHS: g . f =<< x
Warning
Use when LHS: if x then y else return ()
RHS: Control.Monad.when x $ _noParen_ y
Warning
Use when LHS: if x then y else return ()
RHS: Control.Monad.when x y
Warning
Use unless LHS: if x then return () else y
RHS: Control.Monad.unless x $ _noParen_ y
Warning
Use unless LHS: if x then return () else y
RHS: Control.Monad.unless x y
Warning
Use mapM LHS: sequence (map f x)
RHS: mapM f x
Warning
Use mapM_ LHS: sequence_ (map f x)
RHS: mapM_ f x
Warning
Use mapM LHS: sequence (fmap f x)
RHS: mapM f x
Warning
Use mapM_ LHS: sequence_ (fmap f x)
RHS: mapM_ f x
Warning
Use forM LHS: flip mapM
RHS: Control.Monad.forM
Suggestion
Use forM_ LHS: flip mapM_
RHS: Control.Monad.forM_
Suggestion
Use mapM LHS: flip forM
RHS: mapM
Suggestion
Use mapM_ LHS: flip forM_
RHS: mapM_
Suggestion
Use unless LHS: when (not x)
RHS: unless x
Warning
Use when LHS: unless (not x)
RHS: when x
Warning
Use join LHS: x >>= id
RHS: Control.Monad.join x
Warning
Use join LHS: id =<< x
RHS: Control.Monad.join x
Warning
Use join LHS: id =<< x
RHS: Control.Monad.join x
Warning
Use join LHS: id =<< x
RHS: Control.Monad.join x
Warning
Use =<< LHS: join (f <$> x)
RHS: f =<< x
Suggestion
Use =<< LHS: join (fmap f x)
RHS: f =<< x
Suggestion
Use void LHS: a >> return ()
RHS: Control.Monad.void a
Suggestion
Use void LHS: fmap (const ())
RHS: Control.Monad.void
Warning
Use void LHS: const () <$> x
RHS: Control.Monad.void x
Warning
Use void LHS: () <$ x
RHS: Control.Monad.void x
Warning
Use <=< LHS: flip (>=>)
RHS: (<=<)
Warning
Use >=> LHS: flip (<=<)
RHS: (>=>)
Warning
Use =<< LHS: flip (>>=)
RHS: (=<<)
Warning
Use >>= LHS: flip (=<<)
RHS: (>>=)
Warning
Use >=> LHS: \ x -> f x >>= g
RHS: f Control.Monad.>=> g
Suggestion
Use <=< LHS: \ x -> f =<< g x
RHS: f Control.Monad.<=< g
Suggestion
Use <=< LHS: (>>= f) . g
RHS: f Control.Monad.<=< g
Suggestion
Use <=< LHS: (f =<<) . g
RHS: f Control.Monad.<=< g
Suggestion
Redundant >> LHS: a >> forever a
RHS: forever a
Warning
Use ap LHS: liftM2 id
RHS: ap
Suggestion
Use fmap LHS: liftA2 f (return x)
RHS: fmap (f x)
Warning
Use fmap LHS: liftM2 f (pure x)
RHS: fmap (f x)
Warning
Use fmap LHS: liftM2 f (return x)
RHS: fmap (f x)
Warning
Redundant fmap LHS: fmap f (return x)
RHS: return (f x)
Warning
Redundant <$> LHS: f <$> return x
RHS: return (f x)
Warning
Use zipWithM LHS: mapM (uncurry f) (zip l m)
RHS: zipWithM f l m
Warning
Redundant void LHS: mapM_ (void . f)
RHS: mapM_ f
Warning
Redundant void LHS: forM_ x (void . f)
RHS: forM_ x f
Warning
Use >> LHS: a >>= \ _ -> b
RHS: a >> b
Warning
Redundant <* LHS: m <* return x
RHS: m
Warning
Redundant return LHS: return x *> m
RHS: m
Warning
Redundant pure LHS: pure x >> m
RHS: m
Warning
Redundant return LHS: return x >> m
RHS: m
Warning
Use evalState LHS: fst (runState x y)
RHS: evalState x y
Warning
Use execState LHS: snd (runState x y)
RHS: execState x y
Warning
Use mapAndUnzipM LHS: fmap unzip (mapM f x)
RHS: Control.Monad.mapAndUnzipM f x
Warning
Use zipWithM LHS: sequence (zipWith f x y)
RHS: Control.Monad.zipWithM f x y
Warning
Use zipWithM_ LHS: sequence_ (zipWith f x y)
RHS: Control.Monad.zipWithM_ f x y
Warning
Use replicateM LHS: sequence (replicate n x)
RHS: Control.Monad.replicateM n x
Warning
Use replicateM_ LHS: sequence_ (replicate n x)
RHS: Control.Monad.replicateM_ n x
Warning
Use zipWithM LHS: sequenceA (zipWith f x y)
RHS: Control.Monad.zipWithM f x y
Warning
Use zipWithM_ LHS: sequenceA_ (zipWith f x y)
RHS: Control.Monad.zipWithM_ f x y
Warning
Use replicateM LHS: sequenceA (replicate n x)
RHS: Control.Monad.replicateM n x
Warning
Use replicateM_ LHS: sequenceA_ (replicate n x)
RHS: Control.Monad.replicateM_ n x
Warning
Use replicateM LHS: mapM f (replicate n x)
RHS: Control.Monad.replicateM n (f x)
Warning
Use replicateM_ LHS: mapM_ f (replicate n x)
RHS: Control.Monad.replicateM_ n (f x)
Warning
Fuse mapM/map LHS: mapM f (map g x)
RHS: mapM (f . g) x
Warning
Fuse mapM_/map LHS: mapM_ f (map g x)
RHS: mapM_ (f . g) x
Warning
Fuse traverse/map LHS: traverse f (map g x)
RHS: traverse (f . g) x
Warning
Fuse traverse_/map LHS: traverse_ f (map g x)
RHS: traverse_ (f . g) x
Warning
Use sequence LHS: mapM id
RHS: sequence
Warning
Use sequence_ LHS: mapM_ id
RHS: sequence_
Warning
Use for LHS: flip traverse
RHS: for
Warning
Use traverse LHS: flip for
RHS: traverse
Warning
Use for_ LHS: flip traverse_
RHS: for_
Warning
Use traverse_ LHS: flip for_
RHS: traverse_
Warning
Use sequenceA_ LHS: foldr (*>) (pure ())
RHS: sequenceA_
Warning
Use asum LHS: foldr (<|>) empty
RHS: asum
Warning
Use <**> LHS: liftA2 (flip ($))
RHS: (<**>)
Warning
Use fmap LHS: liftA2 f (pure x)
RHS: fmap (f x)
Warning
Redundant fmap LHS: fmap f (pure x)
RHS: pure (f x)
Warning
Redundant <$> LHS: f <$> pure x
RHS: pure (f x)
Warning
Use optional LHS: Just <$> a <|> pure Nothing
RHS: optional a
Warning
Use <&> LHS: m >>= pure . f
RHS: m Data.Functor.<&> f
Suggestion
Use <$> LHS: pure . f =<< m
RHS: f <$> m
Suggestion
Alternative law, left identity LHS: empty <|> x
RHS: x
Warning
Alternative law, right identity LHS: x <|> empty
RHS: x
Warning
Use sequenceA LHS: traverse id
RHS: sequenceA
Warning
Use sequenceA_ LHS: traverse_ id
RHS: sequenceA_
Warning
Use list comprehension LHS: if b then [x] else []
RHS: [x | b]
Suggestion
Use list comprehension LHS: if b then [] else [x]
RHS: [x | not b]
Suggestion
Redundant list comprehension LHS: [x | x <- y]
RHS: y
Suggestion
Redundant seq LHS: seq x x
RHS: x
Warning
Redundant seq LHS: join seq
RHS: id
Warning
Redundant $! LHS: id $! x
RHS: x
Warning
Redundant seq LHS: seq x y
RHS: y
Warning
Redundant $! LHS: f $! x
RHS: f x
Warning
Redundant evaluate LHS: evaluate x
RHS: return x
Warning
Redundant seq LHS: seq (rnf x) ()
RHS: rnf x
Warning
Use map LHS: fst (unzip x)
RHS: map fst x
Warning
Use map LHS: snd (unzip x)
RHS: map snd x
Warning
Use (,) LHS: \ x y -> (x, y)
RHS: (,)
Suggestion
Use (,,) LHS: \ x y z -> (x, y, z)
RHS: (,,)
Suggestion
Evaluate LHS: (, b) a
RHS: (a, b)
Suggestion
Evaluate LHS: (a,) b
RHS: (a, b)
Suggestion
Use fromMaybe LHS: maybe x id
RHS: Data.Maybe.fromMaybe x
Warning
Redundant maybe LHS: maybe Nothing Just
RHS: id
Warning
Use isJust LHS: maybe False (const True)
RHS: Data.Maybe.isJust
Warning
Use isNothing LHS: maybe True (const False)
RHS: Data.Maybe.isNothing
Warning
Use Just LHS: maybe False (x ==)
RHS: (Just x ==)
Warning
Use Just LHS: maybe True (x /=)
RHS: (Just x /=)
Warning
Use Just LHS: maybe False (== x)
RHS: (Just x ==)
Warning
Use Just LHS: maybe True (/= x)
RHS: (Just x /=)
Warning
Use Just LHS: fromMaybe False x
RHS: Just True == x
Ignore
Use Just LHS: fromMaybe True x
RHS: Just False /= x
Ignore
Use isJust LHS: not (isNothing x)
RHS: isJust x
Warning
Use isNothing LHS: not (isJust x)
RHS: isNothing x
Warning
Use maybeToList LHS: maybe [] (: [])
RHS: maybeToList
Warning
Use mapMaybe LHS: catMaybes (map f x)
RHS: mapMaybe f x
Warning
Use mapMaybe LHS: catMaybes (fmap f x)
RHS: mapMaybe f x
Warning
Replace case with fromMaybe LHS:
case x of
  Nothing -> y
  Just a -> a
RHS: Data.Maybe.fromMaybe y x
Suggestion
Replace case with fromMaybe LHS:
case x of
  Just a -> a
  Nothing -> y
RHS: Data.Maybe.fromMaybe y x
Suggestion
Replace case with maybe LHS:
case x of
  Nothing -> y
  Just a -> f a
RHS: maybe y f x
Suggestion
Replace case with maybe LHS:
case x of
  Just a -> f a
  Nothing -> y
RHS: maybe y f x
Suggestion
Use maybe LHS: if isNothing x then y else f (fromJust x)
RHS: maybe y f x
Warning
Use maybe LHS: if isJust x then f (fromJust x) else y
RHS: maybe y f x
Warning
Use fmap LHS: maybe Nothing (Just . f)
RHS: fmap f
Warning
Use catMaybes LHS: map fromJust (filter isJust x)
RHS: Data.Maybe.catMaybes x
Suggestion
Use isNothing LHS: x == Nothing
RHS: isNothing x
Warning
Use isNothing LHS: Nothing == x
RHS: isNothing x
Warning
Use isJust LHS: x /= Nothing
RHS: Data.Maybe.isJust x
Warning
Use isJust LHS: Nothing /= x
RHS: Data.Maybe.isJust x
Warning
Use mapMaybe LHS: concatMap (maybeToList . f)
RHS: Data.Maybe.mapMaybe f
Warning
Use catMaybes LHS: concatMap maybeToList
RHS: catMaybes
Warning
Use <|> LHS: maybe n Just x
RHS: x Control.Applicative.<|> n
Warning
Use fromMaybe LHS: if isNothing x then y else fromJust x
RHS: fromMaybe y x
Warning
Use fromMaybe LHS: if isJust x then fromJust x else y
RHS: fromMaybe y x
Warning
Use Just LHS: isJust x && (fromJust x == y)
RHS: x == Just y
Warning
Fuse mapMaybe/map LHS: mapMaybe f (map g x)
RHS: mapMaybe (f . g) x
Warning
Use maybe LHS: fromMaybe a (fmap f x)
RHS: maybe a f x
Warning
Use maybe LHS: fromMaybe a (f <$> x)
RHS: maybe a f x
Warning
Use catMaybes LHS: mapMaybe id
RHS: catMaybes
Warning
Use catMaybes LHS: [x | Just x <- a]
RHS: Data.Maybe.catMaybes a
Suggestion
Use join LHS:
case m of
  Nothing -> Nothing
  Just x -> x
RHS: Control.Monad.join m
Suggestion
Use join LHS: maybe Nothing id
RHS: join
Suggestion
Use =<< LHS: maybe Nothing f x
RHS: f =<< x
Suggestion
Redundant fmap LHS: maybe x f (fmap g y)
RHS: maybe x (f . g) y
Warning
Redundant fmap LHS: isJust (fmap f x)
RHS: isJust x
Warning
Redundant fmap LHS: isNothing (fmap f x)
RHS: isNothing x
Warning
Redundant fmap LHS: fromJust (fmap f x)
RHS: f (fromJust x)
Warning
Redundant fmap LHS: mapMaybe f (fmap g x)
RHS: mapMaybe (f . g) x
Warning
Move nub out LHS: catMaybes (nub x)
RHS: nub (catMaybes x)
Warning
Move nub out LHS: lefts (nub x)
RHS: nub (lefts x)
Warning
Move nub out LHS: rights (nub x)
RHS: nub (rights x)
Warning
Move reverse out LHS: catMaybes (reverse x)
RHS: reverse (catMaybes x)
Warning
Move reverse out LHS: lefts (reverse x)
RHS: reverse (lefts x)
Warning
Move reverse out LHS: rights (reverse x)
RHS: reverse (rights x)
Warning
Move sort out LHS: catMaybes (sort x)
RHS: sort (catMaybes x)
Warning
Move sort out LHS: lefts (sort x)
RHS: sort (lefts x)
Warning
Move sort out LHS: rights (sort x)
RHS: sort (rights x)
Warning
Move nubOrd out LHS: catMaybes (nubOrd x)
RHS: nubOrd (catMaybes x)
Warning
Move nubOrd out LHS: lefts (nubOrd x)
RHS: nubOrd (lefts x)
Warning
Move nubOrd out LHS: rights (nubOrd x)
RHS: nubOrd (rights x)
Warning
Move reverse out LHS: filter f (reverse x)
RHS: reverse (filter f x)
Warning
Use lefts LHS: [a | Left a <- a]
RHS: lefts a
Warning
Use rights LHS: [a | Right a <- a]
RHS: rights a
Warning
Use fmap LHS: either Left (Right . f)
RHS: fmap f
Warning
Redundant fmap LHS: either f g (fmap h x)
RHS: either f (g . h) x
Warning
Redundant fmap LHS: isLeft (fmap f x)
RHS: isLeft x
Warning
Redundant fmap LHS: isRight (fmap f x)
RHS: isRight x
Warning
Redundant fmap LHS: fromLeft x (fmap f y)
RHS: fromLeft x y
Warning
Use either LHS: fromRight x (fmap f y)
RHS: either (const x) f y
Warning
Use fromRight LHS: either (const x) id
RHS: fromRight x
Warning
Use fromLeft LHS: either id (const x)
RHS: fromLeft x
Warning
Use =<< LHS: either Left f x
RHS: f =<< x
Warning
Use infix LHS: elem x y
RHS: x `elem` y
Suggestion
Use infix LHS: notElem x y
RHS: x `notElem` y
Suggestion
Use infix LHS: isInfixOf x y
RHS: x `isInfixOf` y
Suggestion
Use infix LHS: isSuffixOf x y
RHS: x `isSuffixOf` y
Suggestion
Use infix LHS: isPrefixOf x y
RHS: x `isPrefixOf` y
Suggestion
Use infix LHS: union x y
RHS: x `union` y
Suggestion
Use infix LHS: intersect x y
RHS: x `intersect` y
Suggestion
Redundant fromIntegral LHS: fromIntegral x
RHS: x
Warning
Redundant fromInteger LHS: fromInteger x
RHS: x
Warning
Use - LHS: x + negate y
RHS: x - y
Suggestion
Use negate LHS: 0 - x
RHS: negate x
Suggestion
Redundant negate LHS: negate (negate x)
RHS: x
Warning
Use logBase LHS: log y / log x
RHS: logBase x y
Suggestion
Use tan LHS: sin x / cos x
RHS: tan x
Suggestion
Use even LHS: rem n 2 == 0
RHS: even n
Suggestion
Use even LHS: 0 == rem n 2
RHS: even n
Suggestion
Use odd LHS: rem n 2 /= 0
RHS: odd n
Suggestion
Use odd LHS: 0 /= rem n 2
RHS: odd n
Suggestion
Use even LHS: mod n 2 == 0
RHS: even n
Suggestion
Use even LHS: 0 == mod n 2
RHS: even n
Suggestion
Use odd LHS: mod n 2 /= 0
RHS: odd n
Suggestion
Use odd LHS: 0 /= mod n 2
RHS: odd n
Suggestion
Use odd LHS: not (even x)
RHS: odd x
Suggestion
Use even LHS: not (odd x)
RHS: even x
Suggestion
Use sqrt LHS: x ** 0.5
RHS: sqrt x
Suggestion
Use 1 LHS: x ^ 0
RHS: 1
Suggestion
Use floor LHS: round (x - 0.5)
RHS: floor x
Suggestion
Use writeList2Chan LHS: mapM_ (writeChan a)
RHS: writeList2Chan a
Suggestion
Use readTVarIO LHS: atomically (readTVar x)
RHS: readTVarIO x
Error
Use newTVarIO LHS: atomically (newTVar x)
RHS: newTVarIO x
Error
Use newTMVarIO LHS: atomically (newTMVar x)
RHS: newTMVarIO x
Error
Use newEmptyTMVarIO LHS: atomically newEmptyTMVar
RHS: newEmptyTMVarIO
Error
Use typeRep LHS: typeOf (a :: b)
RHS: typeRep (Proxy :: Proxy b)
Suggestion
Use handle LHS: flip Control.Exception.catch
RHS: handle
Suggestion
Use catch LHS: flip handle
RHS: Control.Exception.catch
Suggestion
Use handleJust LHS: flip (catchJust p)
RHS: handleJust p
Suggestion
Use catchJust LHS: flip (handleJust p)
RHS: catchJust p
Suggestion
Use bracket_ LHS: Control.Exception.bracket b (const a) (const t)
RHS: Control.Exception.bracket_ b a t
Suggestion
Use withFile LHS: Control.Exception.bracket (openFile x y) hClose
RHS: withFile x y
Suggestion
Use withBinaryFile LHS: Control.Exception.bracket (openBinaryFile x y) hClose
RHS: withBinaryFile x y
Suggestion
Use error LHS: throw (ErrorCall a)
RHS: error a
Suggestion
Use nonTermination LHS: toException NonTermination
RHS: nonTermination
Warning
Use nestedAtomically LHS: toException NestedAtomically
RHS: nestedAtomically
Warning
Use writeIORef LHS: modifyIORef r (const x)
RHS: writeIORef r x
Suggestion
Use writeIORef LHS: modifyIORef r (\ v -> x)
RHS: writeIORef r x
Suggestion
Redundant castPtr LHS: castPtr nullPtr
RHS: nullPtr
Suggestion
Redundant castPtr LHS: castPtr (castPtr x)
RHS: castPtr x
Suggestion
Redundant castPtr LHS: plusPtr (castPtr x)
RHS: plusPtr x
Suggestion
Redundant castPtr LHS: minusPtr (castPtr x)
RHS: minusPtr x
Suggestion
Redundant castPtr LHS: minusPtr x (castPtr y)
RHS: minusPtr x y
Suggestion
Redundant castPtr LHS: peekByteOff (castPtr x)
RHS: peekByteOff x
Suggestion
Redundant castPtr LHS: pokeByteOff (castPtr x)
RHS: pokeByteOff x
Suggestion
Use mkWeakPtr LHS: mkWeak a a b
RHS: mkWeakPtr a b
Warning
Use mkWeakPair LHS: mkWeak a (a, b) c
RHS: mkWeakPair a b c
Warning
Use forM_ LHS:
case m of
  Nothing -> return ()
  Just x -> f x
RHS: Data.Foldable.forM_ m f
Warning
Use forM_ LHS:
case m of
  Just x -> f x
  Nothing -> return ()
RHS: Data.Foldable.forM_ m f
Warning
Use forM_ LHS:
case m of
  Just x -> f x
  _ -> return ()
RHS: Data.Foldable.forM_ m f
Warning
Use forM_ LHS: when (isJust m) (f (fromJust m))
RHS: Data.Foldable.forM_ m f
Warning
Use gets LHS: f <$> Control.Monad.State.get
RHS: gets f
Warning
Use gets LHS: fmap f Control.Monad.State.get
RHS: gets f
Warning
Redundant <$> LHS: f <$> Control.Monad.State.gets g
RHS: gets (f . g)
Warning
Redundant fmap LHS: fmap f (Control.Monad.State.gets g)
RHS: gets (f . g)
Warning
Use asks LHS: f <$> Control.Monad.Reader.ask
RHS: asks f
Warning
Use asks LHS: fmap f Control.Monad.Reader.ask
RHS: asks f
Warning
Redundant <$> LHS: f <$> Control.Monad.Reader.asks g
RHS: asks (f . g)
Warning
Redundant fmap LHS: fmap f (Control.Monad.Reader.asks g)
RHS: asks (f . g)
Warning
Use evalState LHS: fst (runState m s)
RHS: evalState m s
Warning
Use execState LHS: snd (runState m s)
RHS: execState m s
Warning
Evaluate LHS: True && x
RHS: x
Warning
Evaluate LHS: False && x
RHS: False
Warning
Evaluate LHS: True || x
RHS: True
Warning
Evaluate LHS: False || x
RHS: x
Warning
Evaluate LHS: not True
RHS: False
Warning
Evaluate LHS: not False
RHS: True
Warning
Evaluate LHS: Nothing >>= k
RHS: Nothing
Warning
Evaluate LHS: k =<< Nothing
RHS: Nothing
Warning
Evaluate LHS: either f g (Left x)
RHS: f x
Warning
Evaluate LHS: either f g (Right y)
RHS: g y
Warning
Evaluate LHS: fst (x, y)
RHS: x
Warning
Evaluate LHS: snd (x, y)
RHS: y
Warning
Evaluate LHS: init [x]
RHS: []
Warning
Evaluate LHS: null [x]
RHS: False
Warning
Evaluate LHS: null []
RHS: True
Warning
Evaluate LHS: length []
RHS: 0
Warning
Evaluate LHS: foldl f z []
RHS: z
Warning
Evaluate LHS: foldr f z []
RHS: z
Warning
Evaluate LHS: foldr1 f [x]
RHS: x
Warning
Evaluate LHS: scanr f z []
RHS: [z]
Warning
Evaluate LHS: scanr1 f []
RHS: []
Warning
Evaluate LHS: scanr1 f [x]
RHS: [x]
Warning
Evaluate LHS: take n []
RHS: []
Warning
Evaluate LHS: drop n []
RHS: []
Warning
Evaluate LHS: takeWhile p []
RHS: []
Warning
Evaluate LHS: dropWhile p []
RHS: []
Warning
Evaluate LHS: span p []
RHS: ([], [])
Warning
Evaluate LHS: lines ""
RHS: []
Warning
Evaluate LHS: unwords []
RHS: ""
Warning
Evaluate LHS: x - 0
RHS: x
Warning
Evaluate LHS: x * 1
RHS: x
Warning
Evaluate LHS: x / 1
RHS: x
Warning
Evaluate LHS: concat [a]
RHS: a
Warning
Evaluate LHS: concat []
RHS: []
Warning
Evaluate LHS: zip [] []
RHS: []
Warning
Evaluate LHS: const x y
RHS: x
Warning
Evaluate LHS: any (const False)
RHS: const False
Warning
Evaluate LHS: all (const True)
RHS: const True
Warning
Evaluate LHS: [] ++ x
RHS: x
Warning
Evaluate LHS: x ++ []
RHS: x
Warning
Using foldr on tuple LHS: foldr f z (x, b)
RHS: f b z
Warning
Using foldr' on tuple LHS: foldr' f z (x, b)
RHS: f b z
Warning
Using foldl on tuple LHS: foldl f z (x, b)
RHS: f z b
Warning
Using foldl' on tuple LHS: foldl' f z (x, b)
RHS: f z b
Warning
Using foldMap on tuple LHS: foldMap f (x, b)
RHS: f b
Warning
Using foldr1 on tuple LHS: foldr1 f (x, b)
RHS: b
Warning
Using foldl1 on tuple LHS: foldl1 f (x, b)
RHS: b
Warning
Using elem on tuple LHS: elem e (x, b)
RHS: e == b
Warning
Using fold on tuple LHS: fold (x, b)
RHS: b
Warning
Using toList on tuple LHS: toList (x, b)
RHS: b
Warning
Using maximum on tuple LHS: maximum (x, b)
RHS: b
Warning
Using minimum on tuple LHS: minimum (x, b)
RHS: b
Warning
Using sum on tuple LHS: sum (x, b)
RHS: b
Warning
Using product on tuple LHS: product (x, b)
RHS: b
Warning
Using concat on tuple LHS: concat (x, b)
RHS: b
Warning
Using and on tuple LHS: and (x, b)
RHS: b
Warning
Using or on tuple LHS: or (x, b)
RHS: b
Warning
Using any on tuple LHS: any f (x, b)
RHS: f b
Warning
Using all on tuple LHS: all f (x, b)
RHS: f b
Warning
Using foldr on tuple LHS: foldr f z (x, y, b)
RHS: f b z
Warning
Using foldr' on tuple LHS: foldr' f z (x, y, b)
RHS: f b z
Warning
Using foldl on tuple LHS: foldl f z (x, y, b)
RHS: f z b
Warning
Using foldl' on tuple LHS: foldl' f z (x, y, b)
RHS: f z b
Warning
Using foldMap on tuple LHS: foldMap f (x, y, b)
RHS: f b
Warning
Using foldr1 on tuple LHS: foldr1 f (x, y, b)
RHS: b
Warning
Using foldl1 on tuple LHS: foldl1 f (x, y, b)
RHS: b
Warning
Using elem on tuple LHS: elem e (x, y, b)
RHS: e == b
Warning
Using fold on tuple LHS: fold (x, y, b)
RHS: b
Warning
Using toList on tuple LHS: toList (x, y, b)
RHS: b
Warning
Using maximum on tuple LHS: maximum (x, y, b)
RHS: b
Warning
Using minimum on tuple LHS: minimum (x, y, b)
RHS: b
Warning
Using sum on tuple LHS: sum (x, y, b)
RHS: b
Warning
Using product on tuple LHS: product (x, y, b)
RHS: b
Warning
Using concat on tuple LHS: concat (x, y, b)
RHS: b
Warning
Using and on tuple LHS: and (x, y, b)
RHS: b
Warning
Using or on tuple LHS: or (x, y, b)
RHS: b
Warning
Using any on tuple LHS: any f (x, y, b)
RHS: f b
Warning
Using all on tuple LHS: all f (x, y, b)
RHS: f b
Warning
Using null on tuple LHS: null x
RHS: False
Warning
Using length on tuple LHS: length x
RHS: 1
Warning
Use empty LHS: Data.Map.fromList []
RHS: Data.Map.empty
Warning
Use empty LHS: Data.Map.Lazy.fromList []
RHS: Data.Map.Lazy.empty
Warning
Use empty LHS: Data.Map.Strict.fromList []
RHS: Data.Map.Strict.empty
Warning
Use TH quotation brackets LHS: TH.varE 'a
RHS: [| a |]
Suggestion
Redundant ^. LHS: (a ^. b) ^. c
RHS: a ^. (b . c)
Warning
Use ^?! LHS: fromJust (a ^? b)
RHS: a ^?! b
Warning
Use ?~ LHS: a .~ Just b
RHS: a ?~ b
Warning
Use <&> LHS: (mapped %~ b) a
RHS: a <&> b
Warning
Use <&> LHS: ((mapped . b) %~ c) a
RHS: a <&> b %~ c
Warning
Use <$ LHS: (mapped .~ b) a
RHS: b <$ a
Warning
Use view LHS: ask <&> (^. a)
RHS: view a
Warning
Redundant <&> LHS: view a <&> (^. b)
RHS: view (a . b)
Warning
Use ix LHS: Control.Lens.at a . Control.Lens._Just
RHS: Control.Lens.ix a
Warning
Use True LHS: Control.Lens.has (Control.Lens.at a)
RHS: True
Error
Redundant at LHS: Control.Lens.has (a . Control.Lens.at b)
RHS: Control.Lens.has a
Error
Use False LHS: Control.Lens.nullOf (Control.Lens.at a)
RHS: False
Error
Redundant at LHS: Control.Lens.nullOf (a . Control.Lens.at b)
RHS: Control.Lens.nullOf a
Error
Use optional LHS: Data.Attoparsec.Text.option Nothing (Just <$> p)
RHS: optional p
Warning
Use optional LHS: Data.Attoparsec.ByteString.option Nothing (Just <$> p)
RHS: optional p
Warning