hlint 1.8.18 → 1.8.19
raw patch · 3 files changed
+10/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hlint.cabal +1/−1
- src/Hint/Lambda.hs +8/−3
- src/Hint/Util.hs +1/−1
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.6 build-type: Simple name: hlint-version: 1.8.18+version: 1.8.19 -- license is GPL v2 only license: GPL license-file: LICENSE
src/Hint/Lambda.hs view
@@ -55,6 +55,9 @@ f = bar &+& \x -> f (g x) foo = [\column -> set column [treeViewColumnTitle := printf "%s (match %d)" name (length candidnates)]] foo = [\x -> x]+foo = [\m x -> insert x x m]+foo a b c = bar (flux ++ quux) c where flux = a -- foo a b = bar (flux ++ quux)+foo a b c = bar (flux ++ quux) c where flux = c </TEST> -} @@ -64,6 +67,7 @@ import Hint.Util import Hint.Type import Util+import Data.Maybe lambdaHint :: DeclHint@@ -71,9 +75,10 @@ lambdaDecl :: Decl_ -> [Idea]-lambdaDecl (toFunBind -> o@(FunBind _ [Match _ name pats (UnGuardedRhs _ bod) Nothing]))- | isLambda $ fromParen bod = [err "Redundant lambda" o $ uncurry reform $ fromLambda $ Lambda an pats bod]- | (pats2,bod2) <- etaReduce pats bod, length pats2 < length pats = [err "Eta reduce" o $ reform pats2 bod2]+lambdaDecl (toFunBind -> o@(FunBind _ [Match _ name pats (UnGuardedRhs _ bod) bind]))+ | isNothing bind, isLambda $ fromParen bod = [err "Redundant lambda" o $ uncurry reform $ fromLambda $ Lambda an pats bod]+ | (pats2,bod2) <- etaReduce pats bod, length pats2 < length pats, pvars (drop (length pats2) pats) `disjoint` vars bind+ = [err "Eta reduce" (reform pats bod) (reform pats2 bod2)] where reform p b = FunBind an [Match an name p (UnGuardedRhs an b) Nothing] lambdaDecl _ = []
src/Hint/Util.hs view
@@ -35,7 +35,7 @@ -- \x y -> f y x = flip f niceLambda [x,y] (view -> App2 op (view -> Var_ y1) (view -> Var_ x1))- | x == x1 && y == y1 = App an (toNamed "flip") op+ | x == x1, y == y1, vars op `disjoint` [x,y] = App an (toNamed "flip") op -- \x -> f (b x) ==> f . b -- \x -> f $ b x ==> f . b