packages feed

hlint 1.7.1 → 1.7.2

raw patch · 6 files changed

+25/−12 lines, 6 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

data/Default.hs view
@@ -304,6 +304,7 @@ yes = case x z of Nothing -> y z; Just pattern -> pattern -- fromMaybe (y z) (x z) yes = if p then s else return () -- Control.Monad.when p $ s error = a $$$$ b $$$$ c ==> a . b $$$$$ c+yes = when (not . null $ asdf) -- unless (null asdf)   import Prelude \
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version:      >= 1.6 build-type:         Simple name:               hlint-version:            1.7.1+version:            1.7.2 -- license is GPL v2 only license:            GPL license-file:       LICENSE
hlint.htm view
@@ -74,7 +74,7 @@ <h3>Acknowledgements</h3>  <p>-	This program has only been made possible by the presence of the <a href="http://www.cs.chalmers.se/~d00nibro/haskell-src-exts/">haskell-src-exts</a> package, and many improvements have been made by <a href="http://www.cs.chalmers.se/~d00nibro/">Niklas Broberg</a> in response to feature requests. Additionally, many people have provided help and patches, including Lennart Augustsson, Malcolm Wallace, Henk-Jan van Tuyl, Gwern Branwen, Alex Ott and others.+	This program has only been made possible by the presence of the <a href="http://www.cs.chalmers.se/~d00nibro/haskell-src-exts/">haskell-src-exts</a> package, and many improvements have been made by <a href="http://www.cs.chalmers.se/~d00nibro/">Niklas Broberg</a> in response to feature requests. Additionally, many people have provided help and patches, including Lennart Augustsson, Malcolm Wallace, Henk-Jan van Tuyl, Gwern Branwen, Alex Ott, Andy Stewart and others. </p>  <h3 id="limitations">Bugs and limitations</h3>
src/Hint/Lambda.hs view
@@ -48,6 +48,7 @@ f = \z -> foo $ bar x $ baz z -- foo . bar x . baz f = \z -> foo $ z $ baz z f = \x -> bar map (filter x) -- bar map . filter+f = bar &+& \x -> f (g x) foo = [\column -> set column [treeViewColumnTitle := printf "%s (match %d)" name (length candidnates)]] foo = [\x -> x] </TEST>@@ -62,7 +63,7 @@   lambdaHint :: DeclHint-lambdaHint _ _ x = concatMap lambdaExp (universeBi x) ++ concatMap lambdaDecl (universe x)+lambdaHint _ _ x = concatMap (uncurry lambdaExp) (universeParentBi x) ++ concatMap lambdaDecl (universe x)   lambdaDecl :: Decl_ -> [Idea]@@ -80,13 +81,13 @@ etaReduce ps x = (ps,x)  -lambdaExp :: Exp_ -> [Idea]-lambdaExp o@(Paren _ (App _ (Var _ (UnQual _ (Symbol _ x))) y)) | isAtom y, allowLeftSection x =+lambdaExp :: Maybe Exp_ -> Exp_ -> [Idea]+lambdaExp p o@(Paren _ (App _ (Var _ (UnQual _ (Symbol _ x))) y)) | isAtom y, allowLeftSection x =     [warn "Use section" o $ LeftSection an y (toNamed x)]-lambdaExp o@(Paren _ (App _ (App _ (view -> Var_ "flip") (Var _ x)) y)) | allowRightSection $ fromNamed x =+lambdaExp p o@(Paren _ (App _ (App _ (view -> Var_ "flip") (Var _ x)) y)) | allowRightSection $ fromNamed x =     [warn "Use section" o $ RightSection an (QVarOp an x) y]-lambdaExp o@Lambda{} | res <- niceLambda [] o, not $ isLambda res =+lambdaExp p o@Lambda{} | maybe True (not . isInfixApp) p, res <- niceLambda [] o, not $ isLambda res =     [warn "Avoid lambda" o res]-lambdaExp o@(Lambda _ ps1 (fromParen -> Lambda _ ps2 bod)) | pvars ps1 `disjoint` pvars ps2 =+lambdaExp p o@(Lambda _ ps1 (fromParen -> Lambda _ ps2 bod)) | pvars ps1 `disjoint` pvars ps2 =     [warn "Collapse lambdas" o $ Lambda an (ps1++ps2) bod]-lambdaExp _ = []+lambdaExp _ _ = []
src/Hint/Match.hs view
@@ -19,8 +19,8 @@ notTypeSafe - no semantics, a hint for testing only  ($) AND (.)-We see through ($) simply by expanding it if nothing else matches.-We see through (.) by translating rules that have (.) equivalents+We see through ($)/(.) by expanding it if nothing else matches.+We also see through (.) by translating rules that have (.) equivalents to separate rules. For example:  concat (map f x) ==> concatMap f x@@ -111,7 +111,9 @@ unifyExp nm x y | isParen x || isParen y = unifyExp nm (fromParen x) (fromParen y) unifyExp nm (Var _ (fromNamed -> v)) y | isUnifyVar v = Just [(v,y)] unifyExp nm (Var _ x) (Var _ y) | nm x y = Just []-unifyExp nm (App _ x1 x2) (App _ y1 y2) = liftM2 (++) (unifyExp nm x1 y1) (unifyExp nm x2 y2)+unifyExp nm x@(App _ x1 x2) (App _ y1 y2) =+    liftM2 (++) (unifyExp nm x1 y1) (unifyExp nm x2 y2) `mplus`+    (do InfixApp _ y11 dot y12 <- return $ fromParen y1; guard $ isDot dot; unifyExp nm x (App an y11 (App an y12 y2))) unifyExp nm x (InfixApp _ lhs2 op2 rhs2)     | InfixApp _ lhs1 op1 rhs1 <- x = guard (op1 == op2) >> liftM2 (++) (unifyExp nm lhs1 lhs2) (unifyExp nm rhs1 rhs2)     | isDol op2 = unifyExp nm x $ App an lhs2 rhs2
src/Util.hs view
@@ -148,6 +148,15 @@     modify (+1)     return $ f i y +universeParent :: Uniplate a => a -> [(Maybe a, a)]+universeParent x = (Nothing,x) : f x+    where+        f :: Uniplate a => a -> [(Maybe a, a)]+        f x = concat [(Just x, y) : f y | y <- children x]++universeParentBi :: Biplate a b => a -> [(Maybe b, b)]+universeParentBi = concatMap universeParent . childrenBi+  --------------------------------------------------------------------- -- LANGUAGE.HASKELL.EXTS.EXTENSION