hlint 1.9.5 → 1.9.6
raw patch · 8 files changed
+23/−6 lines, 8 filesdep ~hscolourPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hscolour
API changes (from Hackage documentation)
Files
- CHANGES.txt +5/−0
- README.md +1/−0
- data/Default.hs +9/−1
- hlint.cabal +1/−1
- src/CmdLine.hs +1/−0
- src/HLint.hs +2/−2
- src/Hint/Match.hs +3/−1
- src/Idea.hs +1/−1
CHANGES.txt view
@@ -1,5 +1,10 @@ Changelog for HLint +1.9.6+ #85, fix the free variable matching check for lambda+ #84, suggest fmap for Either+ Make --json put each hint on a different line+ Support -X for extensions to the hse mode 1.9.5 Remove support for GHC 7.2 Upgrade to haskell-src-exts-1.16
README.md view
@@ -18,6 +18,7 @@ * The presence of `seq` may cause some hints (i.e. eta-reduction) to change the semantics of a program. * Either the monomorphism restriction, or rank-2 types, may cause transformed programs to require type signatures to be manually inserted. * The `RebindableSyntax` extension can cause HLint to suggest incorrect changes.+* HLint turns on many language extensions so it can parse more documents, occasionally some break otherwise legal syntax - e.g. `{-#INLINE foo#-}` doesn't work with `MagicHash`. These extensions can be disabled with `-XNoMagicHash`. ## Installing and running HLint
data/Default.hs view
@@ -216,7 +216,7 @@ warn "Use uncurry" = (\(x,y) -> f x y) ==> uncurry f where note = IncreasesLaziness error "Redundant $" = (($) . f) ==> f error "Redundant $" = (f $) ==> f-warn = (\x -> y) ==> const y where _ = isAtom y && notIn x y+warn = (\x -> y) ==> const y where _ = isAtom y error "Redundant flip" = flip f x y ==> f y x where _ = isApp original warn = (\a b -> g (f a) (f b)) ==> g `Data.Function.on` f error "Evaluate" = id x ==> x@@ -396,6 +396,7 @@ error = [a | Left a <- a] ==> lefts a error = [a | Right a <- a] ==> rights a+error = either Left (Right . f) ==> fmap f -- INFIX @@ -621,6 +622,13 @@ bar = [x| (x,_) <- pts] return' x = x `seq` return x foo = last (sortBy (compare `on` fst) xs) -- maximumBy (compare `on` fst) xs+g = \ f -> parseFile f >>= (\ cu -> return (f, cu))+foo = bar $ \(x,y) -> x x y+foo = (\x -> f x >>= g) -- f Control.Monad.>=> g+foo = (\f -> h f >>= g) -- h Control.Monad.>=> g+foo = (\f -> h f >>= f)+foo = bar $ \x -> [x,y]+foo = bar $ \x -> [z,y] -- const [z,y] import Prelude \ yes = flip mapM -- Control.Monad.forM
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.6 build-type: Simple name: hlint-version: 1.9.5+version: 1.9.6 license: BSD3 license-file: LICENSE category: Development
src/CmdLine.hs view
@@ -118,6 +118,7 @@ } | CmdHSE {cmdFiles :: [FilePath]+ ,cmdLanguage :: [String] -- ^ the extensions (may be prefixed by "No") } deriving (Data,Typeable,Show)
src/HLint.hs view
@@ -57,11 +57,11 @@ CmdTest{} -> hlintTest cmd >> return [] hlintHSE :: Cmd -> IO ()-hlintHSE CmdHSE{..} = do+hlintHSE c@CmdHSE{..} = do v <- getVerbosity forM_ cmdFiles $ \x -> do putStrLn $ "Parse result of " ++ x ++ ":"- res <- parseFile x+ res <- parseFileWithExts (cmdExtensions c) x case res of x@ParseFailed{} -> print x ParseOk m -> case v of
src/Hint/Match.hs view
@@ -103,7 +103,9 @@ u <- check u let e = subst u hintRuleRHS let res = addBracket parent $ unqualify hintRuleScope s u $ performEval e- guard $ (freeVars e Set.\\ freeVars hintRuleRHS) `Set.isSubsetOf` freeVars x -- check no unexpected new free variables+ guard $ (freeVars e Set.\\ Set.filter (not . isUnifyVar) (freeVars hintRuleRHS))+ `Set.isSubsetOf` freeVars x+ -- check no unexpected new free variables guard $ checkSide hintRuleSide $ ("original",x) : ("result",res) : u guard $ checkDefine decl parent res return (res,hintRuleNotes)
src/Idea.hs view
@@ -43,7 +43,7 @@ wrap x = "{" ++ x ++ "}" showIdeasJson :: [Idea] -> String-showIdeasJson ideas = "[" ++ intercalate "," (map showIdeaJson ideas) ++ "]"+showIdeasJson ideas = "[" ++ intercalate "\n," (map showIdeaJson ideas) ++ "]" instance Show Idea where show = showEx id