From 84a5a4a11ecba522c7bd5062fcdf4a0e1fd7cfed Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Mon, 13 Nov 2023 22:04:25 +0000 Subject: [PATCH] Reformatting, for consistency --- src/Stack/Types/PackageFile.hs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/Stack/Types/PackageFile.hs b/src/Stack/Types/PackageFile.hs index 5e847fc4c2..64b6a1c3ea 100644 --- a/src/Stack/Types/PackageFile.hs +++ b/src/Stack/Types/PackageFile.hs @@ -102,24 +102,26 @@ data PackageWarning -- ^ Modules not found in file system, which are listed in Cabal file -} --- | This is the information from cabal we need at the package level --- to track files. -data StackPackageFile = StackPackageFile { - -- specVersion :: CabalSpecVersion, --already in package info - extraSrcFiles :: [FilePath], - dataDir :: FilePath, - dataFiles :: [FilePath] -} deriving (Show, Typeable) +-- | This is the information from Cabal we need at the package level to track +-- files. +data StackPackageFile = StackPackageFile + { extraSrcFiles :: [FilePath] + , dataDir :: FilePath + , dataFiles :: [FilePath] + } + deriving (Show, Typeable) -- | Files that the package depends on, relative to package directory. -data PackageComponentFile = PackageComponentFile { - modulePathMap :: Map NamedComponent (Map ModuleName (Path Abs File)), - cabalFileMap :: !(Map NamedComponent [DotCabalPath]), - packageExtraFile :: Set (Path Abs File), - warnings :: [PackageWarning] -} +data PackageComponentFile = PackageComponentFile + { modulePathMap :: Map NamedComponent (Map ModuleName (Path Abs File)) + , cabalFileMap :: !(Map NamedComponent [DotCabalPath]) + , packageExtraFile :: Set (Path Abs File) + , warnings :: [PackageWarning] + } + instance Semigroup PackageComponentFile where PackageComponentFile x1 x2 x3 x4 <> PackageComponentFile y1 y2 y3 y4 = PackageComponentFile (x1 <> y1) (x2 <> y2) (x3 <> y3) (x4 <> y4) + instance Monoid PackageComponentFile where mempty = PackageComponentFile mempty mempty mempty mempty