hlint 1.9.38 → 1.9.39
raw patch · 3 files changed
+6/−3 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/NewType.hs +3/−2
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for HLint +1.9.39+ #287, don't incorrectly suggest newtype 1.9.38 #279, suggest newtype instead of data #262, add rules to detect redundant castPtr calls
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: hlint-version: 1.9.38+version: 1.9.39 license: BSD3 license-file: LICENSE category: Development
src/Hint/NewType.hs view
@@ -8,6 +8,7 @@ data Foo = Foo Int deriving (Show, Eq) -- newtype Foo = Foo Int deriving (Show, Eq) data Foo = Foo { field :: Int } deriving Show -- newtype Foo = Foo { field :: Int } deriving Show data Foo a b = Foo a -- newtype Foo a b = Foo a+data Foo = Foo { field1, field2 :: Int} data S a = forall b . Show b => S b data Color a = Red a | Green a | Blue a data Pair a b = Pair a b@@ -27,8 +28,8 @@ case tvb of Just _ -> [] Nothing -> case cd of- (ConDecl _ _ [_]) -> wrn- (RecDecl _ _ [_]) -> wrn+ ConDecl _ _ [_] -> wrn+ RecDecl _ _ [FieldDecl _ [_] _] -> wrn _ -> [] where suggestion = DataDecl sp (NewType dtA) ctx dclH [qcD] der wrn = [(suggestN "Use newtype instead of data" d suggestion){ideaNote = [DecreasesLaziness]}]