packages feed

hlint 1.9.13 → 1.9.14

raw patch · 5 files changed

+13/−8 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for HLint +1.9.14+    #649, don't suggest const for values using RecordWildCards 1.9.13     #97, remove the encoding bits of the API     #98, add an HLint3 prototype API
README.md view
@@ -57,7 +57,7 @@  ### Reports -HLint can generate a lot of information, making it difficult to search for particular types of errors. The `--report` flag will cause HLint to generate a report file in HTML, which can be viewed interactively. Reports are recommended when there are more than a handlful of hints.+HLint can generate a lot of information, making it difficult to search for particular types of errors. The `--report` flag will cause HLint to generate a report file in HTML, which can be viewed interactively. Reports are recommended when there are more than a handful of hints.  ### Language Extensions @@ -91,7 +91,7 @@  ### Unicode support -By default, HLint uses the current locale encoding. The encoding can be overriden with either `--utf8` or `--encoding=value`. For descriptions of some valid [encodings see the mkTextEncoding documentation](http://haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#v%3AmkTextEncoding).+By default, HLint uses the current locale encoding. The encoding can be overridden with either `--utf8` or `--encoding=value`. For descriptions of some valid [encodings see the mkTextEncoding documentation](http://haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#v%3AmkTextEncoding).  ## FAQ @@ -168,7 +168,7 @@  ### Ignoring hints -Some of the hints are subjective, and some users believe they should be ignored. Some hints are applicable usually, but occasionally don't always make sense. The ignoring mechanism provides features for supressing certain hints. Ignore directives can either be written as pragmas in the file being analysed, or in the hint files. Examples of pragmas are:+Some of the hints are subjective, and some users believe they should be ignored. Some hints are applicable usually, but occasionally don't always make sense. The ignoring mechanism provides features for suppressing certain hints. Ignore directives can either be written as pragmas in the file being analysed, or in the hint files. Examples of pragmas are:  * `{-# ANN module "HLint: ignore Eta reduce" #-}` - ignore all eta reduction suggestions in this module (use `module` literally, not the name of the module). * `{-# ANN myFunction "HLint: ignore" #-}` - don't give any hints in the function `myFunction`.@@ -178,8 +178,8 @@  Ignore directives can also be written in the hint files: -* `ignore "Eta reduce"` - supress all eta reduction suggestions.-* `ignore "Eta reduce" = MyModule1 MyModule2` - supress eta reduction hints in the `MyModule1` and `MyModule2` modules.+* `ignore "Eta reduce"` - suppress all eta reduction suggestions.+* `ignore "Eta reduce" = MyModule1 MyModule2` - suppress eta reduction hints in the `MyModule1` and `MyModule2` modules. * `ignore = MyModule.myFunction` - don't give any hints in the function `MyModule.myFunction`. * `error = MyModule.myFunction` - any hint in the function `MyModule.myFunction` is an error. * `error "Use concatMap"` - the hint to use `concatMap` is an error.
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+warn  = (\x -> y) ==> const y where _ = isAtom y && not (isWildcard 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@@ -631,6 +631,8 @@ foo = bar $ \x -> [x,y] foo = bar $ \x -> [z,y] -- const [z,y] f condition tChar tBool = if condition then _monoField tChar else _monoField tBool+foo = maybe Bar{..} id -- Data.Maybe.fromMaybe Bar{..}+foo = (\a -> Foo {..}) 1  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.13+version:            1.9.14 license:            BSD3 license-file:       LICENSE category:           Development
src/Hint/Match.hs view
@@ -171,7 +171,7 @@ -- check the unification is valid check :: [(String,Exp_)] -> Maybe [(String,Exp_)] check = mapM f . groupSort-    where f (x,ys) = if length (nub ys) == 1 then Just (x,head ys) else Nothing+    where f (x,ys) = if allSame ys then Just (x,head ys) else Nothing   -- perform a substitution@@ -210,6 +210,7 @@         isType "Compare" x = True -- just a hint for proof stuff         isType "Atom" x = isAtom x         isType "WHNF" x = isWHNF x+        isType "Wildcard" x = any isFieldWildcard $ universeS x         isType "Nat" (asInt -> Just x) | x >= 0 = True         isType "Pos" (asInt -> Just x) | x >  0 = True         isType "Neg" (asInt -> Just x) | x <  0 = True