hlint 3.0.2 → 3.0.3
raw patch · 4 files changed
+8/−5 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +2/−0
- hlint.cabal +1/−1
- src/GHC/Util/HsExpr.hs +3/−3
- src/Hint/Lambda.hs +2/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for HLint (* = breaking change) +3.0.3, released 2020-05-03+ #965, fix incorrect avoid lambda suggestion 3.0.2, released 2020-05-03 #963, don't generate use-section hints for tuples #745, fix up free variables for A{x}, fixes list comp hints
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: hlint-version: 3.0.2+version: 3.0.3 license: BSD3 license-file: LICENSE category: Development
src/GHC/Util/HsExpr.hs view
@@ -176,10 +176,10 @@ = (noLoc $ HsPar noExtField $ noLoc $ SectionL noExtField e f, \s -> [Replace Expr s [] (unsafePrettyPrint e)]) -- @\vs v -> f x v@ ==> @\vs -> f x@-niceLambdaR' (unsnoc -> Just (vs, v)) (L _ (HsApp _ (L _ (HsApp _ f e)) (view' -> Var_' v')))+niceLambdaR' (unsnoc -> Just (vs, v)) (L _ (HsApp _ f (view' -> Var_' v'))) | v == v'- , vars' e `disjoint` [v]- = niceLambdaR' vs $ apps' [f, e]+ , vars' f `disjoint` [v]+ = niceLambdaR' vs f -- @\vs v -> (v `f`)@ ==> @\vs -> f@ niceLambdaR' (unsnoc -> Just (vs, v)) (L _ (SectionL _ (view' -> Var_' v') f))
src/Hint/Lambda.hs view
@@ -8,7 +8,7 @@ Rules: fun a = \x -> y -- promote lambdas, provided no where's outside the lambda fun x = y x -- eta reduce, x /= mr and foo /= symbol- \x -> y x -- eta reduce+ \x -> y x ==> y -- eta reduce ((#) x) ==> (x #) -- rotate operators (flip op x) ==> (`op` x) -- rotate operators \x y -> x + y ==> (+) -- insert operator@@ -90,6 +90,7 @@ {-# LANGUAGE QuasiQuotes #-}; authOAuth2 = foo (\name -> authOAuth2Widget [whamlet|Login via #{name}|] name) f = {- generates a hint using hlint.yaml only -} map (flip (,) "a") "123" f = {- generates a hint using hlint.yaml only -} map ((,) "a") "123"+f = map (\s -> MkFoo s 0 s) ["a","b","c"] </TEST> -}