{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Distribution.Types.PackageDescription (
PackageDescription(..),
specVersion,
specVersion',
license,
license',
buildType,
emptyPackageDescription,
hasPublicLib,
hasLibs,
allLibraries,
withLib,
hasExes,
withExe,
hasTests,
withTest,
hasBenchmarks,
withBenchmark,
hasForeignLibs,
withForeignLib,
allBuildInfo,
enabledBuildInfos,
allBuildDepends,
enabledBuildDepends,
updatePackageDescription,
pkgComponents,
pkgBuildableComponents,
enabledComponents,
lookupComponent,
getComponent,
) where
import Prelude ()
import Distribution.Compat.Prelude
import Control.Monad ((<=<))
import qualified Distribution.Types.BuildInfo.Lens as L
import Distribution.Types.Library
import Distribution.Types.TestSuite
import Distribution.Types.Executable
import Distribution.Types.Benchmark
import Distribution.Types.ForeignLib
import Distribution.Types.Component
import Distribution.Types.ComponentRequestedSpec
import Distribution.Types.Dependency
import Distribution.Types.PackageId
import Distribution.Types.ComponentName
import Distribution.Types.PackageName
import Distribution.Types.UnqualComponentName
import Distribution.Types.SetupBuildInfo
import Distribution.Types.BuildInfo
import Distribution.Types.BuildType
import Distribution.Types.SourceRepo
import Distribution.Types.HookedBuildInfo
import Distribution.Compiler
import Distribution.License
import Distribution.Package
import Distribution.Version
import Distribution.Utils.ShortText
import qualified Distribution.SPDX as SPDX
data PackageDescription
= PackageDescription {
PackageDescription -> Either Version VersionRange
specVersionRaw :: Either Version VersionRange,
PackageDescription -> PackageIdentifier
package :: PackageIdentifier,
PackageDescription -> Either License License
licenseRaw :: Either SPDX.License License,
PackageDescription -> [FilePath]
licenseFiles :: [FilePath],
PackageDescription -> ShortText
copyright :: !ShortText,
PackageDescription -> ShortText
maintainer :: !ShortText,
PackageDescription -> ShortText
author :: !ShortText,
PackageDescription -> ShortText
stability :: !ShortText,
PackageDescription -> [(CompilerFlavor, VersionRange)]
testedWith :: [(CompilerFlavor,VersionRange)],
PackageDescription -> ShortText
homepage :: !ShortText,
PackageDescription -> ShortText
pkgUrl :: !ShortText,
PackageDescription -> ShortText
bugReports :: !ShortText,
PackageDescription -> [SourceRepo]
sourceRepos :: [SourceRepo],
PackageDescription -> ShortText
synopsis :: !ShortText,
PackageDescription -> ShortText
description :: !ShortText,
PackageDescription -> ShortText
category :: !ShortText,
PackageDescription -> [(FilePath, FilePath)]
customFieldsPD :: [(String,String)],
PackageDescription -> Maybe BuildType
buildTypeRaw :: Maybe BuildType,
PackageDescription -> Maybe SetupBuildInfo
setupBuildInfo :: Maybe SetupBuildInfo,
PackageDescription -> Maybe Library
library :: Maybe Library,
PackageDescription -> [Library]
subLibraries :: [Library],
PackageDescription -> [Executable]
executables :: [Executable],
PackageDescription -> [ForeignLib]
foreignLibs :: [ForeignLib],
PackageDescription -> [TestSuite]
testSuites :: [TestSuite],
PackageDescription -> [Benchmark]
benchmarks :: [Benchmark],
PackageDescription -> [FilePath]
dataFiles :: [FilePath],
PackageDescription -> FilePath
dataDir :: FilePath,
:: [FilePath],
:: [FilePath],
:: [FilePath]
}
deriving ((forall x. PackageDescription -> Rep PackageDescription x)
-> (forall x. Rep PackageDescription x -> PackageDescription)
-> Generic PackageDescription
forall x. Rep PackageDescription x -> PackageDescription
forall x. PackageDescription -> Rep PackageDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageDescription x -> PackageDescription
$cfrom :: forall x. PackageDescription -> Rep PackageDescription x
Generic, Int -> PackageDescription -> ShowS
[PackageDescription] -> ShowS
PackageDescription -> FilePath
(Int -> PackageDescription -> ShowS)
-> (PackageDescription -> FilePath)
-> ([PackageDescription] -> ShowS)
-> Show PackageDescription
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [PackageDescription] -> ShowS
$cshowList :: [PackageDescription] -> ShowS
show :: PackageDescription -> FilePath
$cshow :: PackageDescription -> FilePath
showsPrec :: Int -> PackageDescription -> ShowS
$cshowsPrec :: Int -> PackageDescription -> ShowS
Show, ReadPrec [PackageDescription]
ReadPrec PackageDescription
Int -> ReadS PackageDescription
ReadS [PackageDescription]
(Int -> ReadS PackageDescription)
-> ReadS [PackageDescription]
-> ReadPrec PackageDescription
-> ReadPrec [PackageDescription]
-> Read PackageDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageDescription]
$creadListPrec :: ReadPrec [PackageDescription]
readPrec :: ReadPrec PackageDescription
$creadPrec :: ReadPrec PackageDescription
readList :: ReadS [PackageDescription]
$creadList :: ReadS [PackageDescription]
readsPrec :: Int -> ReadS PackageDescription
$creadsPrec :: Int -> ReadS PackageDescription
Read, PackageDescription -> PackageDescription -> Bool
(PackageDescription -> PackageDescription -> Bool)
-> (PackageDescription -> PackageDescription -> Bool)
-> Eq PackageDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageDescription -> PackageDescription -> Bool
$c/= :: PackageDescription -> PackageDescription -> Bool
== :: PackageDescription -> PackageDescription -> Bool
$c== :: PackageDescription -> PackageDescription -> Bool
Eq, Typeable, Typeable PackageDescription
DataType
Constr
Typeable PackageDescription
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PackageDescription
-> c PackageDescription)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PackageDescription)
-> (PackageDescription -> Constr)
-> (PackageDescription -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PackageDescription))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PackageDescription))
-> ((forall b. Data b => b -> b)
-> PackageDescription -> PackageDescription)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r)
-> (forall u.
(forall d. Data d => d -> u) -> PackageDescription -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> PackageDescription -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription)
-> Data PackageDescription
PackageDescription -> DataType
PackageDescription -> Constr
(forall b. Data b => b -> b)
-> PackageDescription -> PackageDescription
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PackageDescription
-> c PackageDescription
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PackageDescription
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> PackageDescription -> u
forall u. (forall d. Data d => d -> u) -> PackageDescription -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PackageDescription
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PackageDescription
-> c PackageDescription
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PackageDescription)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PackageDescription)
$cPackageDescription :: Constr
$tPackageDescription :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
gmapMp :: (forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
gmapM :: (forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PackageDescription -> m PackageDescription
gmapQi :: Int -> (forall d. Data d => d -> u) -> PackageDescription -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> PackageDescription -> u
gmapQ :: (forall d. Data d => d -> u) -> PackageDescription -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PackageDescription -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PackageDescription -> r
gmapT :: (forall b. Data b => b -> b)
-> PackageDescription -> PackageDescription
$cgmapT :: (forall b. Data b => b -> b)
-> PackageDescription -> PackageDescription
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PackageDescription)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PackageDescription)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c PackageDescription)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PackageDescription)
dataTypeOf :: PackageDescription -> DataType
$cdataTypeOf :: PackageDescription -> DataType
toConstr :: PackageDescription -> Constr
$ctoConstr :: PackageDescription -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PackageDescription
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PackageDescription
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PackageDescription
-> c PackageDescription
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PackageDescription
-> c PackageDescription
$cp1Data :: Typeable PackageDescription
Data)
instance Binary PackageDescription
instance Structured PackageDescription
instance NFData PackageDescription where rnf :: PackageDescription -> ()
rnf = PackageDescription -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf
instance Package PackageDescription where
packageId :: PackageDescription -> PackageIdentifier
packageId = PackageDescription -> PackageIdentifier
package
specVersion :: PackageDescription -> Version
specVersion :: PackageDescription -> Version
specVersion = Either Version VersionRange -> Version
specVersion' (Either Version VersionRange -> Version)
-> (PackageDescription -> Either Version VersionRange)
-> PackageDescription
-> Version
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PackageDescription -> Either Version VersionRange
specVersionRaw
specVersion' :: Either Version VersionRange -> Version
specVersion' :: Either Version VersionRange -> Version
specVersion' (Left Version
version) = Version
version
specVersion' (Right VersionRange
versionRange) = case VersionRange -> [VersionInterval]
asVersionIntervals VersionRange
versionRange of
[] -> [Int] -> Version
mkVersion [Int
0]
((LowerBound Version
version Bound
_, UpperBound
_):[VersionInterval]
_) -> Version
version
license :: PackageDescription -> SPDX.License
license :: PackageDescription -> License
license = Either License License -> License
license' (Either License License -> License)
-> (PackageDescription -> Either License License)
-> PackageDescription
-> License
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PackageDescription -> Either License License
licenseRaw
license' :: Either SPDX.License License -> SPDX.License
license' :: Either License License -> License
license' = (License -> License)
-> (License -> License) -> Either License License -> License
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either License -> License
forall a. a -> a
id License -> License
licenseToSPDX
buildType :: PackageDescription -> BuildType
buildType :: PackageDescription -> BuildType
buildType PackageDescription
pkg
| PackageDescription -> Version
specVersion PackageDescription
pkg Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
>= [Int] -> Version
mkVersion [Int
2,Int
1]
= BuildType -> Maybe BuildType -> BuildType
forall a. a -> Maybe a -> a
fromMaybe BuildType
newDefault (PackageDescription -> Maybe BuildType
buildTypeRaw PackageDescription
pkg)
| Bool
otherwise
= BuildType -> Maybe BuildType -> BuildType
forall a. a -> Maybe a -> a
fromMaybe BuildType
Custom (PackageDescription -> Maybe BuildType
buildTypeRaw PackageDescription
pkg)
where
newDefault :: BuildType
newDefault | Maybe SetupBuildInfo -> Bool
forall a. Maybe a -> Bool
isNothing (PackageDescription -> Maybe SetupBuildInfo
setupBuildInfo PackageDescription
pkg) = BuildType
Simple
| Bool
otherwise = BuildType
Custom
emptyPackageDescription :: PackageDescription
emptyPackageDescription :: PackageDescription
emptyPackageDescription
= PackageDescription :: Either Version VersionRange
-> PackageIdentifier
-> Either License License
-> [FilePath]
-> ShortText
-> ShortText
-> ShortText
-> ShortText
-> [(CompilerFlavor, VersionRange)]
-> ShortText
-> ShortText
-> ShortText
-> [SourceRepo]
-> ShortText
-> ShortText
-> ShortText
-> [(FilePath, FilePath)]
-> Maybe BuildType
-> Maybe SetupBuildInfo
-> Maybe Library
-> [Library]
-> [Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription
PackageDescription {
package :: PackageIdentifier
package = PackageName -> Version -> PackageIdentifier
PackageIdentifier (FilePath -> PackageName
mkPackageName FilePath
"")
Version
nullVersion,
licenseRaw :: Either License License
licenseRaw = License -> Either License License
forall a b. b -> Either a b
Right License
UnspecifiedLicense,
licenseFiles :: [FilePath]
licenseFiles = [],
specVersionRaw :: Either Version VersionRange
specVersionRaw = VersionRange -> Either Version VersionRange
forall a b. b -> Either a b
Right VersionRange
anyVersion,
buildTypeRaw :: Maybe BuildType
buildTypeRaw = Maybe BuildType
forall a. Maybe a
Nothing,
copyright :: ShortText
copyright = ShortText
forall a. Monoid a => a
mempty,
maintainer :: ShortText
maintainer = ShortText
forall a. Monoid a => a
mempty,
author :: ShortText
author = ShortText
forall a. Monoid a => a
mempty,
stability :: ShortText
stability = ShortText
forall a. Monoid a => a
mempty,
testedWith :: [(CompilerFlavor, VersionRange)]
testedWith = [],
homepage :: ShortText
homepage = ShortText
forall a. Monoid a => a
mempty,
pkgUrl :: ShortText
pkgUrl = ShortText
forall a. Monoid a => a
mempty,
bugReports :: ShortText
bugReports = ShortText
forall a. Monoid a => a
mempty,
sourceRepos :: [SourceRepo]
sourceRepos = [],
synopsis :: ShortText
synopsis = ShortText
forall a. Monoid a => a
mempty,
description :: ShortText
description = ShortText
forall a. Monoid a => a
mempty,
category :: ShortText
category = ShortText
forall a. Monoid a => a
mempty,
customFieldsPD :: [(FilePath, FilePath)]
customFieldsPD = [],
setupBuildInfo :: Maybe SetupBuildInfo
setupBuildInfo = Maybe SetupBuildInfo
forall a. Maybe a
Nothing,
library :: Maybe Library
library = Maybe Library
forall a. Maybe a
Nothing,
subLibraries :: [Library]
subLibraries = [],
foreignLibs :: [ForeignLib]
foreignLibs = [],
executables :: [Executable]
executables = [],
testSuites :: [TestSuite]
testSuites = [],
benchmarks :: [Benchmark]
benchmarks = [],
dataFiles :: [FilePath]
dataFiles = [],
dataDir :: FilePath
dataDir = FilePath
"",
extraSrcFiles :: [FilePath]
extraSrcFiles = [],
extraTmpFiles :: [FilePath]
extraTmpFiles = [],
extraDocFiles :: [FilePath]
extraDocFiles = []
}
hasPublicLib :: PackageDescription -> Bool
hasPublicLib :: PackageDescription -> Bool
hasPublicLib PackageDescription
p =
case PackageDescription -> Maybe Library
library PackageDescription
p of
Just Library
lib -> BuildInfo -> Bool
buildable (Library -> BuildInfo
libBuildInfo Library
lib)
Maybe Library
Nothing -> Bool
False
hasLibs :: PackageDescription -> Bool
hasLibs :: PackageDescription -> Bool
hasLibs PackageDescription
p = (Library -> Bool) -> [Library] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (BuildInfo -> Bool
buildable (BuildInfo -> Bool) -> (Library -> BuildInfo) -> Library -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Library -> BuildInfo
libBuildInfo) (PackageDescription -> [Library]
allLibraries PackageDescription
p)
allLibraries :: PackageDescription -> [Library]
allLibraries :: PackageDescription -> [Library]
allLibraries PackageDescription
p = Maybe Library -> [Library]
forall a. Maybe a -> [a]
maybeToList (PackageDescription -> Maybe Library
library PackageDescription
p) [Library] -> [Library] -> [Library]
forall a. [a] -> [a] -> [a]
++ PackageDescription -> [Library]
subLibraries PackageDescription
p
withLib :: PackageDescription -> (Library -> IO ()) -> IO ()
withLib :: PackageDescription -> (Library -> IO ()) -> IO ()
withLib PackageDescription
pkg_descr Library -> IO ()
f =
[IO ()] -> IO ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [Library -> IO ()
f Library
lib | Library
lib <- PackageDescription -> [Library]
allLibraries PackageDescription
pkg_descr, BuildInfo -> Bool
buildable (Library -> BuildInfo
libBuildInfo Library
lib)]
hasExes :: PackageDescription -> Bool
hasExes :: PackageDescription -> Bool
hasExes PackageDescription
p = (Executable -> Bool) -> [Executable] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (BuildInfo -> Bool
buildable (BuildInfo -> Bool)
-> (Executable -> BuildInfo) -> Executable -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Executable -> BuildInfo
buildInfo) (PackageDescription -> [Executable]
executables PackageDescription
p)
withExe :: PackageDescription -> (Executable -> IO ()) -> IO ()
withExe :: PackageDescription -> (Executable -> IO ()) -> IO ()
withExe PackageDescription
pkg_descr Executable -> IO ()
f =
[IO ()] -> IO ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [Executable -> IO ()
f Executable
exe | Executable
exe <- PackageDescription -> [Executable]
executables PackageDescription
pkg_descr, BuildInfo -> Bool
buildable (Executable -> BuildInfo
buildInfo Executable
exe)]
hasTests :: PackageDescription -> Bool
hasTests :: PackageDescription -> Bool
hasTests = (TestSuite -> Bool) -> [TestSuite] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (BuildInfo -> Bool
buildable (BuildInfo -> Bool)
-> (TestSuite -> BuildInfo) -> TestSuite -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TestSuite -> BuildInfo
testBuildInfo) ([TestSuite] -> Bool)
-> (PackageDescription -> [TestSuite])
-> PackageDescription
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PackageDescription -> [TestSuite]
testSuites
withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()
withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()
withTest PackageDescription
pkg_descr TestSuite -> IO ()
f =
[IO ()] -> IO ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [ TestSuite -> IO ()
f TestSuite
test | TestSuite
test <- PackageDescription -> [TestSuite]
testSuites PackageDescription
pkg_descr, BuildInfo -> Bool
buildable (TestSuite -> BuildInfo
testBuildInfo TestSuite
test) ]
hasBenchmarks :: PackageDescription -> Bool
hasBenchmarks :: PackageDescription -> Bool
hasBenchmarks = (Benchmark -> Bool) -> [Benchmark] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (BuildInfo -> Bool
buildable (BuildInfo -> Bool)
-> (Benchmark -> BuildInfo) -> Benchmark -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Benchmark -> BuildInfo
benchmarkBuildInfo) ([Benchmark] -> Bool)
-> (PackageDescription -> [Benchmark])
-> PackageDescription
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PackageDescription -> [Benchmark]
benchmarks
withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO ()
withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO ()
withBenchmark PackageDescription
pkg_descr Benchmark -> IO ()
f =
[IO ()] -> IO ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [Benchmark -> IO ()
f Benchmark
bench | Benchmark
bench <- PackageDescription -> [Benchmark]
benchmarks PackageDescription
pkg_descr, BuildInfo -> Bool
buildable (Benchmark -> BuildInfo
benchmarkBuildInfo Benchmark
bench)]
hasForeignLibs :: PackageDescription -> Bool
hasForeignLibs :: PackageDescription -> Bool
hasForeignLibs PackageDescription
p = (ForeignLib -> Bool) -> [ForeignLib] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any (BuildInfo -> Bool
buildable (BuildInfo -> Bool)
-> (ForeignLib -> BuildInfo) -> ForeignLib -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ForeignLib -> BuildInfo
foreignLibBuildInfo) (PackageDescription -> [ForeignLib]
foreignLibs PackageDescription
p)
withForeignLib :: PackageDescription -> (ForeignLib -> IO ()) -> IO ()
withForeignLib :: PackageDescription -> (ForeignLib -> IO ()) -> IO ()
withForeignLib PackageDescription
pkg_descr ForeignLib -> IO ()
f =
[IO ()] -> IO ()
forall (t :: * -> *) (m :: * -> *) a.
(Foldable t, Monad m) =>
t (m a) -> m ()
sequence_ [ ForeignLib -> IO ()
f ForeignLib
flib
| ForeignLib
flib <- PackageDescription -> [ForeignLib]
foreignLibs PackageDescription
pkg_descr
, BuildInfo -> Bool
buildable (ForeignLib -> BuildInfo
foreignLibBuildInfo ForeignLib
flib)
]
allBuildInfo :: PackageDescription -> [BuildInfo]
allBuildInfo :: PackageDescription -> [BuildInfo]
allBuildInfo PackageDescription
pkg_descr = [ BuildInfo
bi | Library
lib <- PackageDescription -> [Library]
allLibraries PackageDescription
pkg_descr
, let bi :: BuildInfo
bi = Library -> BuildInfo
libBuildInfo Library
lib ]
[BuildInfo] -> [BuildInfo] -> [BuildInfo]
forall a. [a] -> [a] -> [a]
++ [ BuildInfo
bi | ForeignLib
flib <- PackageDescription -> [ForeignLib]
foreignLibs PackageDescription
pkg_descr
, let bi :: BuildInfo
bi = ForeignLib -> BuildInfo
foreignLibBuildInfo ForeignLib
flib ]
[BuildInfo] -> [BuildInfo] -> [BuildInfo]
forall a. [a] -> [a] -> [a]
++ [ BuildInfo
bi | Executable
exe <- PackageDescription -> [Executable]
executables PackageDescription
pkg_descr
, let bi :: BuildInfo
bi = Executable -> BuildInfo
buildInfo Executable
exe ]
[BuildInfo] -> [BuildInfo] -> [BuildInfo]
forall a. [a] -> [a] -> [a]
++ [ BuildInfo
bi | TestSuite
tst <- PackageDescription -> [TestSuite]
testSuites PackageDescription
pkg_descr
, let bi :: BuildInfo
bi = TestSuite -> BuildInfo
testBuildInfo TestSuite
tst ]
[BuildInfo] -> [BuildInfo] -> [BuildInfo]
forall a. [a] -> [a] -> [a]
++ [ BuildInfo
bi | Benchmark
tst <- PackageDescription -> [Benchmark]
benchmarks PackageDescription
pkg_descr
, let bi :: BuildInfo
bi = Benchmark -> BuildInfo
benchmarkBuildInfo Benchmark
tst ]
enabledBuildInfos :: PackageDescription -> ComponentRequestedSpec -> [BuildInfo]
enabledBuildInfos :: PackageDescription -> ComponentRequestedSpec -> [BuildInfo]
enabledBuildInfos PackageDescription
pkg ComponentRequestedSpec
enabled =
[ Component -> BuildInfo
componentBuildInfo Component
comp
| Component
comp <- PackageDescription -> ComponentRequestedSpec -> [Component]
enabledComponents PackageDescription
pkg ComponentRequestedSpec
enabled ]
allBuildDepends :: PackageDescription -> [Dependency]
allBuildDepends :: PackageDescription -> [Dependency]
allBuildDepends = BuildInfo -> [Dependency]
targetBuildDepends (BuildInfo -> [Dependency])
-> (PackageDescription -> [BuildInfo])
-> PackageDescription
-> [Dependency]
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< PackageDescription -> [BuildInfo]
allBuildInfo
enabledBuildDepends :: PackageDescription -> ComponentRequestedSpec -> [Dependency]
enabledBuildDepends :: PackageDescription -> ComponentRequestedSpec -> [Dependency]
enabledBuildDepends PackageDescription
spec ComponentRequestedSpec
pd = BuildInfo -> [Dependency]
targetBuildDepends (BuildInfo -> [Dependency]) -> [BuildInfo] -> [Dependency]
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< PackageDescription -> ComponentRequestedSpec -> [BuildInfo]
enabledBuildInfos PackageDescription
spec ComponentRequestedSpec
pd
updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription
updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription
updatePackageDescription (Maybe BuildInfo
mb_lib_bi, [(UnqualComponentName, BuildInfo)]
exe_bi) PackageDescription
p
= PackageDescription
p{ executables :: [Executable]
executables = [(UnqualComponentName, BuildInfo)] -> [Executable] -> [Executable]
updateExecutables [(UnqualComponentName, BuildInfo)]
exe_bi (PackageDescription -> [Executable]
executables PackageDescription
p)
, library :: Maybe Library
library = Maybe BuildInfo -> Maybe Library -> Maybe Library
updateLibrary Maybe BuildInfo
mb_lib_bi (PackageDescription -> Maybe Library
library PackageDescription
p) }
where
updateLibrary :: Maybe BuildInfo -> Maybe Library -> Maybe Library
updateLibrary :: Maybe BuildInfo -> Maybe Library -> Maybe Library
updateLibrary (Just BuildInfo
bi) (Just Library
lib) = Library -> Maybe Library
forall a. a -> Maybe a
Just (Library
lib{libBuildInfo :: BuildInfo
libBuildInfo = BuildInfo
bi BuildInfo -> BuildInfo -> BuildInfo
forall a. Monoid a => a -> a -> a
`mappend` Library -> BuildInfo
libBuildInfo Library
lib})
updateLibrary Maybe BuildInfo
Nothing Maybe Library
mb_lib = Maybe Library
mb_lib
updateLibrary (Just BuildInfo
_) Maybe Library
Nothing = Maybe Library
forall a. Maybe a
Nothing
updateExecutables :: [(UnqualComponentName, BuildInfo)]
-> [Executable]
-> [Executable]
updateExecutables :: [(UnqualComponentName, BuildInfo)] -> [Executable] -> [Executable]
updateExecutables [(UnqualComponentName, BuildInfo)]
exe_bi' [Executable]
executables' = ((UnqualComponentName, BuildInfo) -> [Executable] -> [Executable])
-> [Executable]
-> [(UnqualComponentName, BuildInfo)]
-> [Executable]
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (UnqualComponentName, BuildInfo) -> [Executable] -> [Executable]
updateExecutable [Executable]
executables' [(UnqualComponentName, BuildInfo)]
exe_bi'
updateExecutable :: (UnqualComponentName, BuildInfo)
-> [Executable]
-> [Executable]
updateExecutable :: (UnqualComponentName, BuildInfo) -> [Executable] -> [Executable]
updateExecutable (UnqualComponentName, BuildInfo)
_ [] = []
updateExecutable exe_bi' :: (UnqualComponentName, BuildInfo)
exe_bi'@(UnqualComponentName
name,BuildInfo
bi) (Executable
exe:[Executable]
exes)
| Executable -> UnqualComponentName
exeName Executable
exe UnqualComponentName -> UnqualComponentName -> Bool
forall a. Eq a => a -> a -> Bool
== UnqualComponentName
name = Executable
exe{buildInfo :: BuildInfo
buildInfo = BuildInfo
bi BuildInfo -> BuildInfo -> BuildInfo
forall a. Monoid a => a -> a -> a
`mappend` Executable -> BuildInfo
buildInfo Executable
exe} Executable -> [Executable] -> [Executable]
forall a. a -> [a] -> [a]
: [Executable]
exes
| Bool
otherwise = Executable
exe Executable -> [Executable] -> [Executable]
forall a. a -> [a] -> [a]
: (UnqualComponentName, BuildInfo) -> [Executable] -> [Executable]
updateExecutable (UnqualComponentName, BuildInfo)
exe_bi' [Executable]
exes
pkgComponents :: PackageDescription -> [Component]
pkgComponents :: PackageDescription -> [Component]
pkgComponents PackageDescription
pkg =
[ Library -> Component
CLib Library
lib | Library
lib <- PackageDescription -> [Library]
allLibraries PackageDescription
pkg ]
[Component] -> [Component] -> [Component]
forall a. [a] -> [a] -> [a]
++ [ ForeignLib -> Component
CFLib ForeignLib
flib | ForeignLib
flib <- PackageDescription -> [ForeignLib]
foreignLibs PackageDescription
pkg ]
[Component] -> [Component] -> [Component]
forall a. [a] -> [a] -> [a]
++ [ Executable -> Component
CExe Executable
exe | Executable
exe <- PackageDescription -> [Executable]
executables PackageDescription
pkg ]
[Component] -> [Component] -> [Component]
forall a. [a] -> [a] -> [a]
++ [ TestSuite -> Component
CTest TestSuite
tst | TestSuite
tst <- PackageDescription -> [TestSuite]
testSuites PackageDescription
pkg ]
[Component] -> [Component] -> [Component]
forall a. [a] -> [a] -> [a]
++ [ Benchmark -> Component
CBench Benchmark
bm | Benchmark
bm <- PackageDescription -> [Benchmark]
benchmarks PackageDescription
pkg ]
pkgBuildableComponents :: PackageDescription -> [Component]
pkgBuildableComponents :: PackageDescription -> [Component]
pkgBuildableComponents = (Component -> Bool) -> [Component] -> [Component]
forall a. (a -> Bool) -> [a] -> [a]
filter Component -> Bool
componentBuildable ([Component] -> [Component])
-> (PackageDescription -> [Component])
-> PackageDescription
-> [Component]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PackageDescription -> [Component]
pkgComponents
enabledComponents :: PackageDescription -> ComponentRequestedSpec -> [Component]
enabledComponents :: PackageDescription -> ComponentRequestedSpec -> [Component]
enabledComponents PackageDescription
pkg ComponentRequestedSpec
enabled = (Component -> Bool) -> [Component] -> [Component]
forall a. (a -> Bool) -> [a] -> [a]
filter (ComponentRequestedSpec -> Component -> Bool
componentEnabled ComponentRequestedSpec
enabled) ([Component] -> [Component]) -> [Component] -> [Component]
forall a b. (a -> b) -> a -> b
$ PackageDescription -> [Component]
pkgBuildableComponents PackageDescription
pkg
lookupComponent :: PackageDescription -> ComponentName -> Maybe Component
lookupComponent :: PackageDescription -> ComponentName -> Maybe Component
lookupComponent PackageDescription
pkg (CLibName LibraryName
name) =
(Library -> Component) -> Maybe Library -> Maybe Component
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Library -> Component
CLib (Maybe Library -> Maybe Component)
-> Maybe Library -> Maybe Component
forall a b. (a -> b) -> a -> b
$ (Library -> Bool) -> [Library] -> Maybe Library
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((LibraryName
name LibraryName -> LibraryName -> Bool
forall a. Eq a => a -> a -> Bool
==) (LibraryName -> Bool)
-> (Library -> LibraryName) -> Library -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Library -> LibraryName
libName) (PackageDescription -> [Library]
allLibraries PackageDescription
pkg)
lookupComponent PackageDescription
pkg (CFLibName UnqualComponentName
name) =
(ForeignLib -> Component) -> Maybe ForeignLib -> Maybe Component
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ForeignLib -> Component
CFLib (Maybe ForeignLib -> Maybe Component)
-> Maybe ForeignLib -> Maybe Component
forall a b. (a -> b) -> a -> b
$ (ForeignLib -> Bool) -> [ForeignLib] -> Maybe ForeignLib
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((UnqualComponentName
name UnqualComponentName -> UnqualComponentName -> Bool
forall a. Eq a => a -> a -> Bool
==) (UnqualComponentName -> Bool)
-> (ForeignLib -> UnqualComponentName) -> ForeignLib -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ForeignLib -> UnqualComponentName
foreignLibName) (PackageDescription -> [ForeignLib]
foreignLibs PackageDescription
pkg)
lookupComponent PackageDescription
pkg (CExeName UnqualComponentName
name) =
(Executable -> Component) -> Maybe Executable -> Maybe Component
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Executable -> Component
CExe (Maybe Executable -> Maybe Component)
-> Maybe Executable -> Maybe Component
forall a b. (a -> b) -> a -> b
$ (Executable -> Bool) -> [Executable] -> Maybe Executable
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((UnqualComponentName
name UnqualComponentName -> UnqualComponentName -> Bool
forall a. Eq a => a -> a -> Bool
==) (UnqualComponentName -> Bool)
-> (Executable -> UnqualComponentName) -> Executable -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Executable -> UnqualComponentName
exeName) (PackageDescription -> [Executable]
executables PackageDescription
pkg)
lookupComponent PackageDescription
pkg (CTestName UnqualComponentName
name) =
(TestSuite -> Component) -> Maybe TestSuite -> Maybe Component
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap TestSuite -> Component
CTest (Maybe TestSuite -> Maybe Component)
-> Maybe TestSuite -> Maybe Component
forall a b. (a -> b) -> a -> b
$ (TestSuite -> Bool) -> [TestSuite] -> Maybe TestSuite
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((UnqualComponentName
name UnqualComponentName -> UnqualComponentName -> Bool
forall a. Eq a => a -> a -> Bool
==) (UnqualComponentName -> Bool)
-> (TestSuite -> UnqualComponentName) -> TestSuite -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TestSuite -> UnqualComponentName
testName) (PackageDescription -> [TestSuite]
testSuites PackageDescription
pkg)
lookupComponent PackageDescription
pkg (CBenchName UnqualComponentName
name) =
(Benchmark -> Component) -> Maybe Benchmark -> Maybe Component
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Benchmark -> Component
CBench (Maybe Benchmark -> Maybe Component)
-> Maybe Benchmark -> Maybe Component
forall a b. (a -> b) -> a -> b
$ (Benchmark -> Bool) -> [Benchmark] -> Maybe Benchmark
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((UnqualComponentName
name UnqualComponentName -> UnqualComponentName -> Bool
forall a. Eq a => a -> a -> Bool
==) (UnqualComponentName -> Bool)
-> (Benchmark -> UnqualComponentName) -> Benchmark -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Benchmark -> UnqualComponentName
benchmarkName) (PackageDescription -> [Benchmark]
benchmarks PackageDescription
pkg)
getComponent :: PackageDescription -> ComponentName -> Component
getComponent :: PackageDescription -> ComponentName -> Component
getComponent PackageDescription
pkg ComponentName
cname =
case PackageDescription -> ComponentName -> Maybe Component
lookupComponent PackageDescription
pkg ComponentName
cname of
Just Component
cpnt -> Component
cpnt
Maybe Component
Nothing -> Component
forall a. a
missingComponent
where
missingComponent :: a
missingComponent =
FilePath -> a
forall a. HasCallStack => FilePath -> a
error (FilePath -> a) -> FilePath -> a
forall a b. (a -> b) -> a -> b
$ FilePath
"internal error: the package description contains no "
FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ FilePath
"component corresponding to " FilePath -> ShowS
forall a. [a] -> [a] -> [a]
++ ComponentName -> FilePath
forall a. Show a => a -> FilePath
show ComponentName
cname
instance L.HasBuildInfos PackageDescription where
traverseBuildInfos :: LensLike
f PackageDescription PackageDescription BuildInfo BuildInfo
traverseBuildInfos BuildInfo -> f BuildInfo
f (PackageDescription Either Version VersionRange
a1 PackageIdentifier
a2 Either License License
a3 [FilePath]
a4 ShortText
a5 ShortText
a6 ShortText
a7 ShortText
a8 [(CompilerFlavor, VersionRange)]
a9 ShortText
a10 ShortText
a11 ShortText
a12 [SourceRepo]
a13 ShortText
a14 ShortText
a15 ShortText
a16 [(FilePath, FilePath)]
a17 Maybe BuildType
a18 Maybe SetupBuildInfo
a19
Maybe Library
x1 [Library]
x2 [Executable]
x3 [ForeignLib]
x4 [TestSuite]
x5 [Benchmark]
x6
[FilePath]
a20 FilePath
a21 [FilePath]
a22 [FilePath]
a23 [FilePath]
a24) =
Either Version VersionRange
-> PackageIdentifier
-> Either License License
-> [FilePath]
-> ShortText
-> ShortText
-> ShortText
-> ShortText
-> [(CompilerFlavor, VersionRange)]
-> ShortText
-> ShortText
-> ShortText
-> [SourceRepo]
-> ShortText
-> ShortText
-> ShortText
-> [(FilePath, FilePath)]
-> Maybe BuildType
-> Maybe SetupBuildInfo
-> Maybe Library
-> [Library]
-> [Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription
PackageDescription Either Version VersionRange
a1 PackageIdentifier
a2 Either License License
a3 [FilePath]
a4 ShortText
a5 ShortText
a6 ShortText
a7 ShortText
a8 [(CompilerFlavor, VersionRange)]
a9 ShortText
a10 ShortText
a11 ShortText
a12 [SourceRepo]
a13 ShortText
a14 ShortText
a15 ShortText
a16 [(FilePath, FilePath)]
a17 Maybe BuildType
a18 Maybe SetupBuildInfo
a19
(Maybe Library
-> [Library]
-> [Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
-> f (Maybe Library)
-> f ([Library]
-> [Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ((Library -> f Library) -> Maybe Library -> f (Maybe Library)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Library -> f Library) -> Maybe Library -> f (Maybe Library))
-> ((BuildInfo -> f BuildInfo) -> Library -> f Library)
-> (BuildInfo -> f BuildInfo)
-> Maybe Library
-> f (Maybe Library)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BuildInfo -> f BuildInfo) -> Library -> f Library
forall a. HasBuildInfo a => Lens' a BuildInfo
L.buildInfo) BuildInfo -> f BuildInfo
f Maybe Library
x1
f ([Library]
-> [Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
-> f [Library]
-> f ([Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((Library -> f Library) -> [Library] -> f [Library]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Library -> f Library) -> [Library] -> f [Library])
-> ((BuildInfo -> f BuildInfo) -> Library -> f Library)
-> (BuildInfo -> f BuildInfo)
-> [Library]
-> f [Library]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BuildInfo -> f BuildInfo) -> Library -> f Library
forall a. HasBuildInfo a => Lens' a BuildInfo
L.buildInfo) BuildInfo -> f BuildInfo
f [Library]
x2
f ([Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
-> f [Executable]
-> f ([ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((Executable -> f Executable) -> [Executable] -> f [Executable]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Executable -> f Executable) -> [Executable] -> f [Executable])
-> ((BuildInfo -> f BuildInfo) -> Executable -> f Executable)
-> (BuildInfo -> f BuildInfo)
-> [Executable]
-> f [Executable]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BuildInfo -> f BuildInfo) -> Executable -> f Executable
forall a. HasBuildInfo a => Lens' a BuildInfo
L.buildInfo) BuildInfo -> f BuildInfo
f [Executable]
x3
f ([ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
-> f [ForeignLib]
-> f ([TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((ForeignLib -> f ForeignLib) -> [ForeignLib] -> f [ForeignLib]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((ForeignLib -> f ForeignLib) -> [ForeignLib] -> f [ForeignLib])
-> ((BuildInfo -> f BuildInfo) -> ForeignLib -> f ForeignLib)
-> (BuildInfo -> f BuildInfo)
-> [ForeignLib]
-> f [ForeignLib]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BuildInfo -> f BuildInfo) -> ForeignLib -> f ForeignLib
forall a. HasBuildInfo a => Lens' a BuildInfo
L.buildInfo) BuildInfo -> f BuildInfo
f [ForeignLib]
x4
f ([TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
-> f [TestSuite]
-> f ([Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((TestSuite -> f TestSuite) -> [TestSuite] -> f [TestSuite]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((TestSuite -> f TestSuite) -> [TestSuite] -> f [TestSuite])
-> ((BuildInfo -> f BuildInfo) -> TestSuite -> f TestSuite)
-> (BuildInfo -> f BuildInfo)
-> [TestSuite]
-> f [TestSuite]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BuildInfo -> f BuildInfo) -> TestSuite -> f TestSuite
forall a. HasBuildInfo a => Lens' a BuildInfo
L.buildInfo) BuildInfo -> f BuildInfo
f [TestSuite]
x5
f ([Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
-> f [Benchmark]
-> f ([FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((Benchmark -> f Benchmark) -> [Benchmark] -> f [Benchmark]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Benchmark -> f Benchmark) -> [Benchmark] -> f [Benchmark])
-> ((BuildInfo -> f BuildInfo) -> Benchmark -> f Benchmark)
-> (BuildInfo -> f BuildInfo)
-> [Benchmark]
-> f [Benchmark]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BuildInfo -> f BuildInfo) -> Benchmark -> f Benchmark
forall a. HasBuildInfo a => Lens' a BuildInfo
L.buildInfo) BuildInfo -> f BuildInfo
f [Benchmark]
x6
f ([FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription)
-> f [FilePath]
-> f (FilePath
-> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [FilePath] -> f [FilePath]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [FilePath]
a20
f (FilePath
-> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
-> f FilePath
-> f ([FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FilePath -> f FilePath
forall (f :: * -> *) a. Applicative f => a -> f a
pure FilePath
a21
f ([FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
-> f [FilePath]
-> f ([FilePath] -> [FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [FilePath] -> f [FilePath]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [FilePath]
a22
f ([FilePath] -> [FilePath] -> PackageDescription)
-> f [FilePath] -> f ([FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [FilePath] -> f [FilePath]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [FilePath]
a23
f ([FilePath] -> PackageDescription)
-> f [FilePath] -> f PackageDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [FilePath] -> f [FilePath]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [FilePath]
a24