Skip to content

Commit 7b8cdca

Browse files
committed
Clean up a bunch of hlint suggestions
1 parent 2ef8709 commit 7b8cdca

14 files changed

Lines changed: 37 additions & 56 deletions

File tree

src/Stack/Build.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ checkCabalVersion = do
178178
versionString cabalVer ++
179179
" was found."
180180

181-
data CabalVersionException = CabalVersionException { unCabalVersionException :: String }
181+
newtype CabalVersionException = CabalVersionException { unCabalVersionException :: String }
182182
deriving (Typeable)
183183

184184
instance Show CabalVersionException where show = unCabalVersionException

src/Stack/SDist.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import qualified System.FilePath as FP
6868
-- | Special exception to throw when you want to fail because of bad results
6969
-- of package check.
7070

71-
data CheckException
71+
newtype CheckException
7272
= CheckException (NonEmpty Check.PackageCheck)
7373
deriving (Typeable)
7474

src/Stack/Types/Build.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ newtype PkgDepsOracle =
367367
deriving (Show,Typeable,Eq,Hashable,Store,NFData)
368368

369369
-- | Stored on disk to know whether the files have changed.
370-
data BuildCache = BuildCache
371-
{ buildCacheTimes :: !(Map FilePath FileCacheInfo)
370+
newtype BuildCache = BuildCache
371+
{ buildCacheTimes :: Map FilePath FileCacheInfo
372372
-- ^ Modification times of files.
373373
}
374374
deriving (Generic, Eq, Show, Data, Typeable)

src/Stack/Types/Config.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,8 +1690,8 @@ explicitSetupDeps name = do
16901690
Nothing -> False -- default value
16911691

16921692
-- | Data passed into Docker container for the Docker entrypoint's use
1693-
data DockerEntrypoint = DockerEntrypoint
1694-
{ deUser :: !(Maybe DockerUser)
1693+
newtype DockerEntrypoint = DockerEntrypoint
1694+
{ deUser :: Maybe DockerUser
16951695
-- ^ UID/GID/etc of host user, if we wish to perform UID/GID switch in container
16961696
} deriving (Read,Show)
16971697

src/Stack/Types/Config/Build.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,12 @@ instance Monoid TestOptsMonoid where
319319

320320

321321
-- | Haddock Options
322-
data HaddockOpts =
323-
HaddockOpts { hoAdditionalArgs :: ![String] -- ^ Arguments passed to haddock program
322+
newtype HaddockOpts =
323+
HaddockOpts { hoAdditionalArgs :: [String] -- ^ Arguments passed to haddock program
324324
} deriving (Eq,Show)
325325

326-
data HaddockOptsMonoid =
327-
HaddockOptsMonoid {hoMonoidAdditionalArgs :: ![String]
326+
newtype HaddockOptsMonoid =
327+
HaddockOptsMonoid {hoMonoidAdditionalArgs :: [String]
328328
} deriving (Show, Generic)
329329

330330
defaultHaddockOpts :: HaddockOpts

src/Stack/Types/FlagName.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import Language.Haskell.TH
4040
import Language.Haskell.TH.Syntax
4141

4242
-- | A parse fail.
43-
data FlagNameParseFail
43+
newtype FlagNameParseFail
4444
= FlagNameParseFail Text
4545
deriving (Typeable)
4646
instance Exception FlagNameParseFail

src/Stack/Types/GhcPkgId.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import GHC.Generics
2626
import Prelude -- Fix AMP warning
2727

2828
-- | A parse fail.
29-
data GhcPkgIdParseFail
29+
newtype GhcPkgIdParseFail
3030
= GhcPkgIdParseFail Text
3131
deriving Typeable
3232
instance Show GhcPkgIdParseFail where

src/Stack/Types/Image.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import Path
1818
import Prelude -- Fix redundant import warnings
1919

2020
-- | Image options. Currently only Docker image options.
21-
data ImageOpts = ImageOpts
22-
{ imgDockers :: ![ImageDockerOpts]
21+
newtype ImageOpts = ImageOpts
22+
{ imgDockers :: [ImageDockerOpts]
2323
-- ^ One or more stanzas for docker image settings.
2424
} deriving (Show)
2525

@@ -39,8 +39,8 @@ data ImageDockerOpts = ImageDockerOpts
3939
-- ^ Filenames of executables to add (if Nothing, add them all)
4040
} deriving (Show)
4141

42-
data ImageOptsMonoid = ImageOptsMonoid
43-
{ imgMonoidDockers :: ![ImageDockerOpts]
42+
newtype ImageOptsMonoid = ImageOptsMonoid
43+
{ imgMonoidDockers :: [ImageDockerOpts]
4444
} deriving (Show, Generic)
4545

4646
instance FromJSON (WithJSONWarnings ImageOptsMonoid) where

src/Stack/Types/PackageIdentifier.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Stack.Types.PackageName
3535
import Stack.Types.Version
3636

3737
-- | A parse fail.
38-
data PackageIdentifierParseFail
38+
newtype PackageIdentifierParseFail
3939
= PackageIdentifierParseFail Text
4040
deriving (Typeable)
4141
instance Show PackageIdentifierParseFail where

src/Stack/Types/Version.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import Prelude -- Fix warning: Word in Prelude from base-4.8.
5757
import Text.PrettyPrint (render)
5858

5959
-- | A parse fail.
60-
data VersionParseFail =
60+
newtype VersionParseFail =
6161
VersionParseFail Text
6262
deriving (Typeable)
6363
instance Exception VersionParseFail

0 commit comments

Comments
 (0)