Skip to content

Commit

Permalink
#1058, weaken the self-definition check to match more things
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Jun 24, 2020
1 parent f8cbb55 commit 6282bd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Changelog for HLint (* = breaking change)

#1058, weaken the self-definition check to match more things
#1060, suggest [] ++ x and [] ++ x to x
3.1.5, released 2020-06-19
#1049, suggest or/and from True `elem` xs and False `notElem` xs
Expand Down
1 change: 1 addition & 0 deletions data/hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,7 @@
# issue1055 = map f ((sort . map g) xs)
# issue1049 = True `elem` xs -- or xs
# issue1049 = elem True -- or
# issue1058 n = [] ++ issue1058 (n+1) -- issue1058 (n+1)

# import Prelude \
# yes = flip mapM -- Control.Monad.forM
Expand Down
2 changes: 1 addition & 1 deletion src/Hint/Match.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ matchIdea sb declName HintRule{..} parent x = do
guard $ not (any isLambda $ universe lhs) || not (any isQuasiQuote $ universe x)

guard $ checkSide (unextendInstances <$> hintRuleSide) $ ("original", x) : ("result", res) : fromSubst u
guard $ checkDefine declName parent res
guard $ checkDefine declName parent rhs

(u, tpl) <- pure $ if any ((== noSrcSpan) . getLoc . snd) (fromSubst u) then (mempty, res) else (u, tpl)
tpl <- pure $ unqualify sa sb (performSpecial tpl)
Expand Down

0 comments on commit 6282bd1

Please sign in to comment.