packages feed

hlint 1.9.32 → 1.9.33

raw patch · 8 files changed

+16/−17 lines, 8 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGES.txt view
@@ -1,5 +1,9 @@ Changelog for HLint +1.9.33+    #240, remove type-incorrect "on" hint+    #234, warn about join seq+    #232, suggest <|> instead of mplus in a few cases 1.9.32     #53, require cpphs-1.20.1, has important fixes     #224, treat select $ specially, as per esqueleto conventions
data/Default.hs view
@@ -225,7 +225,6 @@ warn "Redundant $" = (f $) ==> f hint = (\x -> y) ==> const y where _ = isAtom y && not (isWildcard y) warn "Redundant flip" = flip f x y ==> f y x where _ = isApp original-hint = (\a b -> g (f a) (f b)) ==> g `Data.Function.on` f warn "Evaluate" = id x ==> x warn "Redundant id" = id . x ==> x warn "Redundant id" = x . id ==> x@@ -374,6 +373,7 @@ -- SEQ  warn "Redundant seq" = x `seq` x ==> x+warn "Redundant seq" = join seq ==> id warn "Redundant $!" = id $! x ==> x warn "Redundant seq" = x `seq` y ==> y where _ = isWHNF x warn "Redundant $!" = f $! x ==> f x where _ = isWHNF x@@ -399,7 +399,7 @@ warn = Nothing /= x  ==>  Data.Maybe.isJust x warn = concatMap (maybeToList . f) ==> Data.Maybe.mapMaybe f warn = concatMap maybeToList ==> catMaybes-warn = maybe n Just x ==> Control.Monad.mplus x n+warn = maybe n Just x ==> x Control.Applicative.<|> n hint = (case x of Just a -> a; Nothing -> y)  ==> fromMaybe y x warn = (if isNothing x then y else fromJust x) ==> fromMaybe y x warn = (if isJust x then fromJust x else y) ==> fromMaybe y x
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version:      >= 1.8 build-type:         Simple name:               hlint-version:            1.9.32+version:            1.9.33 license:            BSD3 license-file:       LICENSE category:           Development
src/HSE/Bracket.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE PatternGuards, TypeSynonymInstances, FlexibleInstances #-}+{-# OPTIONS_GHC -fno-warn-overlapping-patterns -fno-warn-incomplete-patterns #-}  module HSE.Bracket(     Brackets(..),
src/HSE/FreeVars.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-} -module HSE.FreeVars(FreeVars, freeVars, vars, varss, pvars, declBind) where+module HSE.FreeVars(FreeVars, freeVars, vars, varss, pvars) where  import Data.Monoid import HSE.Type as HSE@@ -8,10 +8,6 @@ import Data.Set(Set) import Prelude ---- which names are bound by a declaration-declBind :: Decl_ -> [String]-declBind = pvars  vars x = Set.toList $ freeVars x 
src/HSE/Util.hs view
@@ -263,9 +263,6 @@           f (x:xs) = x : f xs           f [] = [] -toSrcLoc :: SrcSpanInfo -> SrcLoc-toSrcLoc = getPointLoc- toSrcSpan :: SrcSpanInfo -> SrcSpan toSrcSpan (SrcSpanInfo x _) = x 
src/Hint/All.hs view
@@ -1,14 +1,13 @@  module Hint.All(     Hint(..), HintBuiltin(..), DeclHint, ModuHint,-    resolveHints, hintRules, resolveBuiltin, builtinHints+    resolveHints, hintRules, builtinHints     ) where  import Data.Monoid import Settings import Data.Either import Data.List-import Data.Maybe import Hint.Type import Prelude @@ -67,10 +66,6 @@ resolveHints :: [Either HintBuiltin HintRule] -> Hint resolveHints xs = mconcat $ mempty{hintDecl=readMatch rights} : map builtin (nub lefts)     where (lefts,rights) = partitionEithers xs--resolveBuiltin :: [String] -> [Hint]-resolveBuiltin builtin = map f $ nub $ concat [if x == "All" then map fst builtinHints else [x] | x <- builtin]-    where f x = fromMaybe (error $ "Unknown builtin hints: HLint.Builtin." ++ x) $ lookup x builtinHints  hintRules :: [HintRule] -> Hint hintRules = resolveHints . map Right
src/Language/Haskell/HLint2.hs view
@@ -38,6 +38,7 @@ import Paths_hlint  import Control.Applicative+import Data.Maybe import Data.Monoid import Data.Tuple.Extra import Data.List.Extra@@ -48,6 +49,11 @@ -- | Get the Cabal configured data directory of HLint getHLintDataDir :: IO FilePath getHLintDataDir = getDataDir++resolveBuiltin :: [String] -> [Hint]+resolveBuiltin builtin = map f $ nub $ concat [if x == "All" then map fst builtinHints else [x] | x <- builtin]+    where f x = fromMaybe (error $ "Unknown builtin hints: HLint.Builtin." ++ x) $ lookup x builtinHints+  -- | The function produces a tuple containg 'ParseFlags' (for 'parseModuleEx'), and 'Classify' and 'Hint' for 'applyHints'. --   It approximates the normal HLint configuration steps, roughly: