hlint 1.9.27 → 1.9.28
raw patch · 3 files changed
+18/−9 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +2/−0
- hlint.cabal +1/−1
- src/Hint/Extensions.hs +15/−8
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for HLint +1.9.28+ #215, spot newtype deriving inside classes 1.9.27 #203, avoid recompiling everything twice #213, don't suggest removing bang patterns on let
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.8 build-type: Simple name: hlint-version: 1.9.27+version: 1.9.28 license: BSD3 license-file: LICENSE category: Development
src/Hint/Extensions.hs view
@@ -59,6 +59,8 @@ deriving instance Show Bar -- {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving #-} \ newtype Micro = Micro Int deriving Generic -- {-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-} \+instance Class Int where {newtype MyIO a = MyIO a deriving NewClass} {-# LANGUAGE UnboxedTuples #-} \ f :: Int -> (# Int, Int #) {-# LANGUAGE UnboxedTuples #-} \@@ -172,16 +174,21 @@ -- | What is derived on newtype, and on data type -- 'deriving' declarations may be on either, so we approximate as both newtype and data derives :: Module_ -> ([String],[String])-derives = concatUnzip . map f . childrenBi+derives m = concatUnzip $ map decl (childrenBi m) ++ map idecl (childrenBi m) where- f :: Decl_ -> ([String], [String])- f (DataDecl _ dn _ _ _ ds) = g dn ds- f (GDataDecl _ dn _ _ _ _ ds) = g dn ds- f (DataInsDecl _ dn _ _ ds) = g dn ds- f (GDataInsDecl _ dn _ _ _ ds) = g dn ds- f (DerivDecl _ _ hd) = (xs, xs) -- don't know whether this was on newtype or not+ idecl :: InstDecl S -> ([String], [String])+ idecl (InsData _ dn _ _ ds) = g dn ds+ idecl (InsGData _ dn _ _ _ ds) = g dn ds+ idecl _ = ([], [])++ decl :: Decl_ -> ([String], [String])+ decl (DataDecl _ dn _ _ _ ds) = g dn ds+ decl (GDataDecl _ dn _ _ _ _ ds) = g dn ds+ decl (DataInsDecl _ dn _ _ ds) = g dn ds+ decl (GDataInsDecl _ dn _ _ _ ds) = g dn ds+ decl (DerivDecl _ _ hd) = (xs, xs) -- don't know whether this was on newtype or not where xs = [ir hd]- f _ = ([], [])+ decl _ = ([], []) g dn ds = if isNewType dn then (xs,[]) else ([],xs) where xs = maybe [] (map ir . fromDeriving) ds