Skip to content

Instantly share code, notes, and snippets.

@bergmark
Created March 19, 2017 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bergmark/5dd63c24fe6bdcf67eae0e88495a24e7 to your computer and use it in GitHub Desktop.
Save bergmark/5dd63c24fe6bdcf67eae0e88495a24e7 to your computer and use it in GitHub Desktop.
./Data/Aeson/TH.hs:549:1: Warning: Eta reduce
Found:
(<^>) a b = infixApp a [| (E.><) |] b
Why not:
(<^>) a = infixApp a [| (E.><) |]
./Data/Aeson/TH.hs:1632:40: Suggestion: Use infix
Found:
union droppedKindVarNames kvNames'
Why not:
droppedKindVarNames `union` kvNames'
./Data/Aeson/TH.hs:2121:10: Warning: Redundant bang pattern
Found:
!0
Why not:
0
./Data/Aeson/TH.hs:2248:38: Suggestion: Use section
Found:
(flip substNameWithKind starK)
Why not:
(`substNameWithKind` starK)
./Data/Aeson/TH.hs:2399:17: Suggestion: Redundant case
Found:
case t of
_ -> NotKindStar
Why not:
NotKindStar
./Data/Aeson/Encoding/Builder.hs:286:5: Suggestion: Avoid lambda
Found:
\ txt -> B.builder (mkBuildstep txt)
Why not:
B.builder . mkBuildstep
./Data/Aeson/Encoding/Builder.hs:295:23: Warning: Redundant bang pattern
Found:
!br@(B.BufferRange op0 ope)
Why not:
br@(B.BufferRange op0 ope)
./Data/Aeson/Encoding/Internal.hs:126:1: Warning: Eta reduce
Found:
pair name val = pair' (text name) val
Why not:
pair name = pair' (text name)
./Data/Aeson/Types/FromJSON.hs:468:36: Warning: Functor law
Found:
fmap id
Why not:
id
./Data/Aeson/Types/FromJSON.hs:556:5: Warning: Eta reduce
Found:
liftParseJSONList f g v = listParser (liftParseJSON f g) v
Why not:
liftParseJSONList f g = listParser (liftParseJSON f g)
./Data/Aeson/Types/FromJSON.hs:1261:43: Suggestion: Use >=>
Found:
\ t ->
parseScientificText t >>=
\ s ->
if Scientific.coefficient s < 0 then
fail $
"Expected a Natural number but got the negative number: " <> show s
else pure $ truncate s
Why not:
(parseScientificText Control.Monad.>=>
(\ s ->
if Scientific.coefficient s < 0 then
fail $
"Expected a Natural number but got the negative number: " <> show s
else pure $ truncate s))
./Data/Aeson/Types/Internal.hs:151:5: Warning: Eta reduce
Found:
fail err = IError [] err
Why not:
fail = IError []
./Data/Aeson/Types/Internal.hs:166:5: Warning: Eta reduce
Found:
fail err = Error err
Why not:
fail = Error
./Data/Aeson/Types/ToJSON.hs:2335:9: Suggestion: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2367:9
./Data/Aeson/Types/ToJSON.hs:2367:9: Suggestion: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2401:9
./Data/Aeson/Types/ToJSON.hs:2401:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2437:9
./Data/Aeson/Types/ToJSON.hs:2437:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
VM.unsafeWrite mv 5 (toJSON f)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2475:9
./Data/Aeson/Types/ToJSON.hs:2475:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
VM.unsafeWrite mv 5 (toJSON f)
VM.unsafeWrite mv 6 (toJSON g)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2515:9
./Data/Aeson/Types/ToJSON.hs:2515:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
VM.unsafeWrite mv 5 (toJSON f)
VM.unsafeWrite mv 6 (toJSON g)
VM.unsafeWrite mv 7 (toJSON h)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2557:9
./Data/Aeson/Types/ToJSON.hs:2557:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
VM.unsafeWrite mv 5 (toJSON f)
VM.unsafeWrite mv 6 (toJSON g)
VM.unsafeWrite mv 7 (toJSON h)
VM.unsafeWrite mv 8 (toJSON i)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2601:9
./Data/Aeson/Types/ToJSON.hs:2601:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
VM.unsafeWrite mv 5 (toJSON f)
VM.unsafeWrite mv 6 (toJSON g)
VM.unsafeWrite mv 7 (toJSON h)
VM.unsafeWrite mv 8 (toJSON i)
VM.unsafeWrite mv 9 (toJSON j)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2647:9
./Data/Aeson/Types/ToJSON.hs:2647:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
VM.unsafeWrite mv 5 (toJSON f)
VM.unsafeWrite mv 6 (toJSON g)
VM.unsafeWrite mv 7 (toJSON h)
VM.unsafeWrite mv 8 (toJSON i)
VM.unsafeWrite mv 9 (toJSON j)
VM.unsafeWrite mv 10 (toJSON k)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2695:9
./Data/Aeson/Types/ToJSON.hs:2695:9: Warning: Reduce duplication
Found:
VM.unsafeWrite mv 0 (toJSON a)
VM.unsafeWrite mv 1 (toJSON b)
VM.unsafeWrite mv 2 (toJSON c)
VM.unsafeWrite mv 3 (toJSON d)
VM.unsafeWrite mv 4 (toJSON e)
VM.unsafeWrite mv 5 (toJSON f)
VM.unsafeWrite mv 6 (toJSON g)
VM.unsafeWrite mv 7 (toJSON h)
VM.unsafeWrite mv 8 (toJSON i)
VM.unsafeWrite mv 9 (toJSON j)
VM.unsafeWrite mv 10 (toJSON k)
VM.unsafeWrite mv 11 (toJSON l)
Why not:
Combine with ./Data/Aeson/Types/ToJSON.hs:2745:9
./Data/Aeson/Types/ToJSON.hs:2812:16: Warning: Redundant bang pattern
Found:
!L.Empty
Why not:
L.Empty
./Data/Aeson/Types/ToJSON.hs:2813:16: Warning: Redundant bang pattern
Found:
!(L.Chunk (S.PS fpbuf o l) lbs')
Why not:
(L.Chunk (S.PS fpbuf o l) lbs')
./benchmarks/AesonCompareAutoInstances.hs:46:19: Suggestion: Redundant $
Found:
Product "Hello World!" 'a' $
Record{testOne = 9876.54321, testTwo = False,
testThree = Product "Yeehaa!!!" '\n' Nullary}
Why not:
Product "Hello World!" 'a'
Record{testOne = 9876.54321, testTwo = False,
testThree = Product "Yeehaa!!!" '\n' Nullary}
./benchmarks/AesonCompareAutoInstances.hs:83:20: Suggestion: Redundant $
Found:
Product' "Hello World!" 'a' $
Record'{testOne' = 9876.54321, testTwo' = False,
testThree' = Product' "Yeehaa!!!" '\n' Nullary'}
Why not:
Product' "Hello World!" 'a'
Record'{testOne' = 9876.54321, testTwo' = False,
testThree' = Product' "Yeehaa!!!" '\n' Nullary'}
./benchmarks/AesonEncode.hs:28:24: Suggestion: Use withFile
Found:
bracket (openFile arg ReadMode) hClose
Why not:
withFile arg ReadMode
./benchmarks/AesonEncode.hs:38:46: Warning: Redundant do
Found:
do rnf (encode r) `seq` loop (n + 1) r
Why not:
rnf (encode r) `seq` loop (n + 1) r
./benchmarks/AesonMap.hs:100:18: Suggestion: Redundant $
Found:
B.encode $ value10
Why not:
B.encode value10
./benchmarks/AesonMap.hs:103:19: Suggestion: Redundant $
Found:
B.encode $ value100
Why not:
B.encode value100
./benchmarks/AesonMap.hs:106:20: Suggestion: Redundant $
Found:
B.encode $ value1000
Why not:
B.encode value1000
./benchmarks/AesonMap.hs:109:21: Suggestion: Redundant $
Found:
B.encode $ value10000
Why not:
B.encode value10000
./benchmarks/AesonParse.hs:24:24: Suggestion: Use withFile
Found:
bracket (openFile arg ReadMode) hClose
Why not:
withFile arg ReadMode
./benchmarks/AesonTuples.hs:3:1: Error: Parse error: module
Found:
module Main where
> module Main (main) where
import Prelude ()
./benchmarks/CompareWithJSON.hs:38:13: Suggestion: Use fromMaybe
Found:
case A.decode s of
Just v -> v
Nothing -> error "fail to parse via Aeson"
Why not:
Prelude.fromMaybe (error "fail to parse via Aeson") (A.decode s)
./benchmarks/CompareWithJSON.hs:43:14: Suggestion: Use fromMaybe
Found:
case A.decode' s of
Just v -> v
Nothing -> error "fail to parse via Aeson"
Why not:
Prelude.fromMaybe (error "fail to parse via Aeson") (A.decode' s)
./benchmarks/Dates.hs:25:25: Warning: Redundant irrefutable pattern
Found:
~bs
Why not:
bs
./benchmarks/Dates.hs:26:25: Warning: Redundant irrefutable pattern
Found:
~bs
Why not:
bs
./benchmarks/Dates.hs:29:25: Warning: Redundant irrefutable pattern
Found:
~bs
Why not:
bs
./benchmarks/Dates.hs:30:25: Warning: Redundant irrefutable pattern
Found:
~bs
Why not:
bs
./benchmarks/Dates.hs:35:39: Warning: Redundant irrefutable pattern
Found:
~ts
Why not:
ts
./benchmarks/Dates.hs:36:39: Warning: Redundant irrefutable pattern
Found:
~ts
Why not:
ts
./benchmarks/Dates.hs:39:37: Warning: Redundant irrefutable pattern
Found:
~ts
Why not:
ts
./benchmarks/Dates.hs:40:37: Warning: Redundant irrefutable pattern
Found:
~ts
Why not:
ts
./benchmarks/ReadFile.hs:23:24: Suggestion: Use withFile
Found:
bracket (openFile arg ReadMode) hClose
Why not:
withFile arg ReadMode
./benchmarks/Compare/JsonBench.hs:6:1: Warning: Unused LANGUAGE pragma
Found:
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
Why not remove it.
./benchmarks/Compare/JsonBench.hs:68:23: Suggestion: Redundant bracket
Found:
(rnf fId) `seq` (rnf fName) `seq` ()
Why not:
rnf fId `seq` (rnf fName) `seq` ()
./benchmarks/Compare/JsonBench.hs:68:39: Suggestion: Redundant bracket
Found:
(rnf fName) `seq` ()
Why not:
rnf fName `seq` ()
./benchmarks/Compare/JsonBench.hs:71:21: Suggestion: Redundant bracket
Found:
(rnf uId) `seq`
(rnf uIndex) `seq`
(rnf uGuid) `seq`
(rnf uIsActive) `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uId `seq`
(rnf uIndex) `seq`
(rnf uGuid) `seq`
(rnf uIsActive) `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:37: Suggestion: Redundant bracket
Found:
(rnf uIndex) `seq`
(rnf uGuid) `seq`
(rnf uIsActive) `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uIndex `seq`
(rnf uGuid) `seq`
(rnf uIsActive) `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:56: Suggestion: Redundant bracket
Found:
(rnf uGuid) `seq`
(rnf uIsActive) `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uGuid `seq`
(rnf uIsActive) `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:74: Suggestion: Redundant bracket
Found:
(rnf uIsActive) `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uIsActive `seq`
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:96: Suggestion: Redundant bracket
Found:
(rnf uBalance) `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uBalance `seq`
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:117: Suggestion: Redundant bracket
Found:
(rnf uPicture) `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uPicture `seq`
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:138: Suggestion: Redundant bracket
Found:
(rnf uAge) `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uAge `seq`
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:155: Suggestion: Redundant bracket
Found:
(rnf uEyeColor) `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uEyeColor `seq`
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:177: Suggestion: Redundant bracket
Found:
(rnf uName) `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uName `seq`
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:195: Suggestion: Redundant bracket
Found:
(rnf uGender) `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uGender `seq`
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:215: Suggestion: Redundant bracket
Found:
(rnf uCompany) `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uCompany `seq`
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:236: Suggestion: Redundant bracket
Found:
(rnf uEmail) `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uEmail `seq`
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:255: Suggestion: Redundant bracket
Found:
(rnf uPhone) `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uPhone `seq`
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:274: Suggestion: Redundant bracket
Found:
(rnf uAddress) `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uAddress `seq`
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:295: Suggestion: Redundant bracket
Found:
(rnf uAbout) `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uAbout `seq`
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:314: Suggestion: Redundant bracket
Found:
(rnf uRegistered) `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uRegistered `seq`
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:338: Suggestion: Redundant bracket
Found:
(rnf uLatitude) `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uLatitude `seq`
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:360: Suggestion: Redundant bracket
Found:
(rnf uLongitude) `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uLongitude `seq`
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:383: Suggestion: Redundant bracket
Found:
(rnf uTags) `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uTags `seq`
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:401: Suggestion: Redundant bracket
Found:
(rnf uFriends) `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uFriends `seq`
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:422: Suggestion: Redundant bracket
Found:
(rnf uGreeting) `seq` (rnf uFavouriteFruit) `seq` ()
Why not:
rnf uGreeting `seq` (rnf uFavouriteFruit) `seq` ()
./benchmarks/Compare/JsonBench.hs:71:444: Suggestion: Redundant bracket
Found:
(rnf uFavouriteFruit) `seq` ()
Why not:
rnf uFavouriteFruit `seq` ()
./benchmarks/Typed/Common.hs:2:1: Warning: Unused LANGUAGE pragma
Found:
{-# LANGUAGE PackageImports #-}
Why not remove it.
./examples/Twitter.hs:32:1: Suggestion: Use camelCase
Found:
data Metadata = Metadata{result_type :: Text}
deriving (Eq, Show, Typeable, Data, Generic)
Why not:
data Metadata = Metadata{resultType :: Text}
deriving (Eq, Show, Typeable, Data, Generic)
./examples/Twitter.hs:32:1: Suggestion: Use newtype instead of data
Found:
data Metadata = Metadata{result_type :: Text}
deriving (Eq, Show, Typeable, Data, Generic)
Why not:
newtype Metadata = Metadata{result_type :: Text}
deriving (Eq, Show, Typeable, Data, Generic)
Note: decreases laziness
./examples/Twitter.hs:45:1: Suggestion: Use camelCase
Found:
data Story = Story{from_user_id_str :: Text,
profile_image_url :: Text, created_at :: Text, from_user :: Text,
id_str :: Text, metadata :: Metadata, to_user_id :: Maybe Int64,
text :: Text, id_ :: Int64, from_user_id :: Int64,
geo :: Maybe Geo, iso_language_code :: Text,
to_user_id_str :: Maybe Text, source :: Text}
deriving (Show, Typeable, Data, Generic)
Why not:
data Story = Story{fromUserIdStr :: Text, profileImageUrl :: Text,
createdAt :: Text, fromUser :: Text, idStr :: Text,
metadata :: Metadata, toUserId :: Maybe Int64, text :: Text,
id_ :: Int64, fromUserId :: Int64, geo :: Maybe Geo,
isoLanguageCode :: Text, toUserIdStr :: Maybe Text, source :: Text}
deriving (Show, Typeable, Data, Generic)
./examples/Twitter.hs:64:1: Suggestion: Use camelCase
Found:
data Result = Result{results :: [Story], max_id :: Int64,
since_id :: Int64, refresh_url :: Text, next_page :: Text,
results_per_page :: Int, page :: Int, completed_in :: Double,
since_id_str :: Text, max_id_str :: Text, query :: Text}
deriving (Show, Typeable, Data, Generic)
Why not:
data Result = Result{results :: [Story], maxId :: Int64,
sinceId :: Int64, refreshUrl :: Text, nextPage :: Text,
resultsPerPage :: Int, page :: Int, completedIn :: Double,
sinceIdStr :: Text, maxIdStr :: Text, query :: Text}
deriving (Show, Typeable, Data, Generic)
./examples/Twitter/Generic.hs:3:1: Warning: Unused LANGUAGE pragma
Found:
{-# LANGUAGE PackageImports #-}
Why not remove it.
./examples/Twitter/Manual.hs:4:1: Warning: Unused LANGUAGE pragma
Found:
{-# LANGUAGE PackageImports #-}
Why not remove it.
./pure/Data/Aeson/Parser/UnescapePure.hs:55:34: Suggestion: Move brackets to avoid $
Found:
(fromIntegral $ word .&. 63) `shiftL` 6
Why not:
fromIntegral (word .&. 63) `shiftL` 6
./pure/Data/Aeson/Parser/UnescapePure.hs:59:37: Suggestion: Move brackets to avoid $
Found:
(fromIntegral $ word .&. 31) `shiftL` 6
Why not:
fromIntegral (word .&. 31) `shiftL` 6
./pure/Data/Aeson/Parser/UnescapePure.hs:63:34: Suggestion: Move brackets to avoid $
Found:
(fromIntegral $ word .&. 63) `shiftL` 12
Why not:
fromIntegral (word .&. 63) `shiftL` 12
./pure/Data/Aeson/Parser/UnescapePure.hs:67:37: Suggestion: Move brackets to avoid $
Found:
(fromIntegral $ word .&. 15) `shiftL` 12
Why not:
fromIntegral (word .&. 15) `shiftL` 12
./pure/Data/Aeson/Parser/UnescapePure.hs:71:34: Suggestion: Move brackets to avoid $
Found:
(fromIntegral $ word .&. 7) `shiftL` 18
Why not:
fromIntegral (word .&. 7) `shiftL` 18
./pure/Data/Aeson/Parser/UnescapePure.hs:210:13: Suggestion: Use guards
Found:
st
= if u >= 55296 && u <= 56319 then StateS0 else
if u >= 56320 && u <= 57343 then throwDecodeError else StateNone
Why not:
st
| u >= 55296 && u <= 56319 = StateS0
| u >= 56320 && u <= 57343 = throwDecodeError
| otherwise = StateNone
./pure/Data/Aeson/Parser/UnescapePure.hs:254:1: Warning: Eta reduce
Found:
write dest pos char = A.unsafeWrite dest pos char
Why not:
write = A.unsafeWrite
./tests/Instances.hs:6:1: Warning: Unused LANGUAGE pragma
Found:
{-# LANGUAGE StandaloneDeriving #-}
Why not remove it.
./tests/Instances.hs:14:1: Warning: Use fewer imports
Found:
import Control.Applicative (empty)
import Control.Applicative (Const(..))
Why not:
import Control.Applicative (empty, Const(..))
./tests/Instances.hs:24:1: Warning: Use fewer imports
Found:
import Test.QuickCheck (Arbitrary(..), elements, oneof)
import Test.QuickCheck (getNonNegative, listOf1, resize)
Why not:
import Test.QuickCheck
(Arbitrary(..), elements, oneof, getNonNegative, listOf1, resize)
./tests/Properties.hs:238:68: Suggestion: Use String
Found:
I [Char]
Why not:
I String
./tests/SerializationFormatSpec.hs:89:98: Suggestion: Use String
Found:
M.Map [Char] Int
Why not:
M.Map String Int
./tests/SerializationFormatSpec.hs:200:41: Suggestion: Redundant $
Found:
Just $ Nothing
Why not:
Just Nothing
./tests/SerializationFormatSpec.hs:202:41: Suggestion: Redundant $
Found:
Just $ Nothing
Why not:
Just Nothing
./tests/UnitTests.hs:77:7: Suggestion: Redundant $
Found:
testCase "goodProducer" $ goodProducer
Why not:
testCase "goodProducer" goodProducer
./tests/UnitTests.hs:80:7: Suggestion: Redundant $
Found:
testCase "good" $ utcTimeGood
Why not:
testCase "good" utcTimeGood
./tests/UnitTests.hs:81:7: Suggestion: Redundant $
Found:
testCase "bad" $ utcTimeBad
Why not:
testCase "bad" utcTimeBad
./tests/UnitTests.hs:84:7: Suggestion: Redundant $
Found:
testCase "example 1" $ formatErrorExample
Why not:
testCase "example 1" formatErrorExample
./tests/UnitTests.hs:190:7: Suggestion: Use fromMaybe
Found:
case parseTime defaultTimeLocale f . LT.unpack $ s of
Nothing -> error "parseTime input malformed"
Just t -> t
Why not:
fromMaybe (error "parseTime input malformed")
(parseTime defaultTimeLocale f . LT.unpack $ s)
./tests/UnitTests.hs:194:24: Suggestion: Redundant bracket
Found:
decode . LT.encodeUtf8 $ (LT.concat ["\"", s, "\""])
Why not:
decode . LT.encodeUtf8 $ LT.concat ["\"", s, "\""]
./tests/UnitTests.hs:210:36: Suggestion: Redundant bracket
Found:
decode . LT.encodeUtf8 $ (LT.concat ["\"", s, "\""])
Why not:
decode . LT.encodeUtf8 $ LT.concat ["\"", s, "\""]
./tests/UnitTests.hs:238:45: Warning: Redundant bracket
Found:
(Nothing)
Why not:
Nothing
./tests/UnitTests.hs:242:45: Warning: Redundant bracket
Found:
(Nothing)
Why not:
Nothing
./tests/UnitTests/NullaryConstructors.hs:63:5: Warning: Eta reduce
Found:
parse parsejson v = iparse parsejson v
Why not:
parse = iparse
102 hints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment