hlint 1.8.53 → 1.8.54
raw patch · 5 files changed
+12/−14 lines, 5 files
Files
- LICENSE +1/−1
- data/Default.hs +2/−1
- hlint.cabal +3/−3
- hlint.htm +3/−3
- src/HSE/Util.hs +3/−6
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2006-2012.+Copyright Neil Mitchell 2006-2013. All rights reserved. Redistribution and use in source and binary forms, with or without
data/Default.hs view
@@ -187,7 +187,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 && notIn x 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 @@ -564,6 +564,7 @@ main = take 4 x main = let (first, rest) = (takeWhile p l, dropWhile p l) in rest -- span p l main = map $ \ d -> ([| $d |], [| $d |])+pairs (x:xs) = map (\y -> (x,y)) xs ++ pairs xs 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.8.53+version: 1.8.54 license: BSD3 license-file: LICENSE category: Development@@ -12,7 +12,6 @@ description: HLint gives suggestions on how to improve your source code. homepage: http://community.haskell.org/~ndm/hlint/-stability: Beta data-dir: data data-files: Default.hs@@ -26,10 +25,11 @@ hlint.ghci extra-source-files: hlint.htm+tested-with: GHC==7.6.3, GHC==7.4.2, GHC==7.2.2 source-repository head type: git- location: git://github.com/ndmitchell/hlint.git+ location: https://github.com/ndmitchell/hlint.git flag threaded default: True
hlint.htm view
@@ -290,9 +290,9 @@ 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: </p> <ul>- <li><tt>{-# ANN module "HLint: ignore Eta reduce" #-}</tt> - ignore all eta reduction suggestions in this module.</li>- <li><tt>{-# ANN myFunction "HLint: ignore" #-}</tt> - don't give any hints in the function <tt>myFunction</tt>.</li>- <li><tt>{-# ANN myFunction "HLint: error" #-}</tt> - any hint in the function <tt>myFunction</tt> is an error.</li>+ <li><tt>{-# ANN module "HLint: ignore Eta reduce" #-}</tt> - ignore all eta reduction suggestions in this module (use <tt>module</tt> literally, not the name of the module).</li>+ <li><tt>{-# ANN <i>myFunction</i> "HLint: ignore" #-}</tt> - don't give any hints in the function <tt><i>myFunction</i></tt>.</li>+ <li><tt>{-# ANN <i>myFunction</i> "HLint: error" #-}</tt> - any hint in the function <tt><i>myFunction</i></tt> is an error.</li> <li><tt>{-# ANN module "HLint: error Use concatMap" #-}</tt> - the hint to use concatMap is an error.</li> <li><tt>{-# ANN module "HLint: warn Use concatMap" #-}</tt> - the hint to use concatMap is a warning.</li> </ul>
src/HSE/Util.hs view
@@ -212,20 +212,17 @@ -- Given (f a) b, consider the children to be: children f ++ [a,b] childrenApps :: Exp_ -> [Exp_]-childrenApps (App _ x@App{} y) = childrenApps x ++ [y]-childrenApps (App _ x y) = children x ++ [y]+childrenApps (App s x y) = childrenApps x ++ [y] childrenApps x = children x descendApps :: (Exp_ -> Exp_) -> Exp_ -> Exp_-descendApps f (App s x@App{} y) = App s (descendApps f x) (f y)-descendApps f (App s x y) = App s (descend f x) (f y)+descendApps f (App s x y) = App s (descendApps f x) (f y) descendApps f x = descend f x descendAppsM :: Monad m => (Exp_ -> m Exp_) -> Exp_ -> m Exp_-descendAppsM f (App s x@App{} y) = liftM2 (App s) (descendAppsM f x) (f y)-descendAppsM f (App s x y) = liftM2 (App s) (descendM f x) (f y)+descendAppsM f (App s x y) = liftM2 (App s) (descendAppsM f x) (f y) descendAppsM f x = descendM f x