{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Distribution.Types.GenericPackageDescription (
GenericPackageDescription(..),
emptyGenericPackageDescription,
Flag(..),
emptyFlag,
FlagName,
mkFlagName,
unFlagName,
FlagAssignment,
mkFlagAssignment,
unFlagAssignment,
lookupFlagAssignment,
insertFlagAssignment,
diffFlagAssignment,
findDuplicateFlagAssignments,
nullFlagAssignment,
showFlagValue,
dispFlagAssignment,
parsecFlagAssignment,
ConfVar(..),
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Utils.ShortText
import Distribution.Utils.Generic (lowercase)
import qualified Text.PrettyPrint as Disp
import qualified Data.Map as Map
import qualified Distribution.Compat.CharParsing as P
import Distribution.Compat.Lens as L
import qualified Distribution.Types.BuildInfo.Lens as L
import Distribution.Types.PackageDescription
import Distribution.Types.Dependency
import Distribution.Types.Library
import Distribution.Types.ForeignLib
import Distribution.Types.Executable
import Distribution.Types.TestSuite
import Distribution.Types.Benchmark
import Distribution.Types.UnqualComponentName
import Distribution.Types.CondTree
import Distribution.Package
import Distribution.Version
import Distribution.Compiler
import Distribution.System
import Distribution.Parsec
import Distribution.Pretty
data GenericPackageDescription =
GenericPackageDescription
{ GenericPackageDescription -> PackageDescription
packageDescription :: PackageDescription
, GenericPackageDescription -> [Flag]
genPackageFlags :: [Flag]
, GenericPackageDescription
-> Maybe (CondTree ConfVar [Dependency] Library)
condLibrary :: Maybe (CondTree ConfVar [Dependency] Library)
, GenericPackageDescription
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
condSubLibraries :: [( UnqualComponentName
, CondTree ConfVar [Dependency] Library )]
, GenericPackageDescription
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
condForeignLibs :: [( UnqualComponentName
, CondTree ConfVar [Dependency] ForeignLib )]
, GenericPackageDescription
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
condExecutables :: [( UnqualComponentName
, CondTree ConfVar [Dependency] Executable )]
, GenericPackageDescription
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
condTestSuites :: [( UnqualComponentName
, CondTree ConfVar [Dependency] TestSuite )]
, GenericPackageDescription
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
condBenchmarks :: [( UnqualComponentName
, CondTree ConfVar [Dependency] Benchmark )]
}
deriving (Int -> GenericPackageDescription -> ShowS
[GenericPackageDescription] -> ShowS
GenericPackageDescription -> String
(Int -> GenericPackageDescription -> ShowS)
-> (GenericPackageDescription -> String)
-> ([GenericPackageDescription] -> ShowS)
-> Show GenericPackageDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenericPackageDescription] -> ShowS
$cshowList :: [GenericPackageDescription] -> ShowS
show :: GenericPackageDescription -> String
$cshow :: GenericPackageDescription -> String
showsPrec :: Int -> GenericPackageDescription -> ShowS
$cshowsPrec :: Int -> GenericPackageDescription -> ShowS
Show, GenericPackageDescription -> GenericPackageDescription -> Bool
(GenericPackageDescription -> GenericPackageDescription -> Bool)
-> (GenericPackageDescription -> GenericPackageDescription -> Bool)
-> Eq GenericPackageDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenericPackageDescription -> GenericPackageDescription -> Bool
$c/= :: GenericPackageDescription -> GenericPackageDescription -> Bool
== :: GenericPackageDescription -> GenericPackageDescription -> Bool
$c== :: GenericPackageDescription -> GenericPackageDescription -> Bool
Eq, Typeable, Typeable GenericPackageDescription
DataType
Constr
Typeable GenericPackageDescription
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GenericPackageDescription
-> c GenericPackageDescription)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GenericPackageDescription)
-> (GenericPackageDescription -> Constr)
-> (GenericPackageDescription -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c GenericPackageDescription))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c GenericPackageDescription))
-> ((forall b. Data b => b -> b)
-> GenericPackageDescription -> GenericPackageDescription)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r)
-> (forall u.
(forall d. Data d => d -> u) -> GenericPackageDescription -> [u])
-> (forall u.
Int
-> (forall d. Data d => d -> u) -> GenericPackageDescription -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription)
-> Data GenericPackageDescription
GenericPackageDescription -> DataType
GenericPackageDescription -> Constr
(forall b. Data b => b -> b)
-> GenericPackageDescription -> GenericPackageDescription
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GenericPackageDescription
-> c GenericPackageDescription
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GenericPackageDescription
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) -> GenericPackageDescription -> u
forall u.
(forall d. Data d => d -> u) -> GenericPackageDescription -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GenericPackageDescription
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GenericPackageDescription
-> c GenericPackageDescription
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c GenericPackageDescription)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c GenericPackageDescription)
$cGenericPackageDescription :: Constr
$tGenericPackageDescription :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
gmapMp :: (forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
gmapM :: (forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> GenericPackageDescription -> m GenericPackageDescription
gmapQi :: Int
-> (forall d. Data d => d -> u) -> GenericPackageDescription -> u
$cgmapQi :: forall u.
Int
-> (forall d. Data d => d -> u) -> GenericPackageDescription -> u
gmapQ :: (forall d. Data d => d -> u) -> GenericPackageDescription -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> GenericPackageDescription -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GenericPackageDescription
-> r
gmapT :: (forall b. Data b => b -> b)
-> GenericPackageDescription -> GenericPackageDescription
$cgmapT :: (forall b. Data b => b -> b)
-> GenericPackageDescription -> GenericPackageDescription
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c GenericPackageDescription)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c GenericPackageDescription)
dataCast1 :: (forall d. Data d => c (t d))
-> Maybe (c GenericPackageDescription)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c GenericPackageDescription)
dataTypeOf :: GenericPackageDescription -> DataType
$cdataTypeOf :: GenericPackageDescription -> DataType
toConstr :: GenericPackageDescription -> Constr
$ctoConstr :: GenericPackageDescription -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GenericPackageDescription
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GenericPackageDescription
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GenericPackageDescription
-> c GenericPackageDescription
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GenericPackageDescription
-> c GenericPackageDescription
$cp1Data :: Typeable GenericPackageDescription
Data, (forall x.
GenericPackageDescription -> Rep GenericPackageDescription x)
-> (forall x.
Rep GenericPackageDescription x -> GenericPackageDescription)
-> Generic GenericPackageDescription
forall x.
Rep GenericPackageDescription x -> GenericPackageDescription
forall x.
GenericPackageDescription -> Rep GenericPackageDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GenericPackageDescription x -> GenericPackageDescription
$cfrom :: forall x.
GenericPackageDescription -> Rep GenericPackageDescription x
Generic)
instance Package GenericPackageDescription where
packageId :: GenericPackageDescription -> PackageIdentifier
packageId = PackageDescription -> PackageIdentifier
forall pkg. Package pkg => pkg -> PackageIdentifier
packageId (PackageDescription -> PackageIdentifier)
-> (GenericPackageDescription -> PackageDescription)
-> GenericPackageDescription
-> PackageIdentifier
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GenericPackageDescription -> PackageDescription
packageDescription
instance Binary GenericPackageDescription
instance NFData GenericPackageDescription where rnf :: GenericPackageDescription -> ()
rnf = GenericPackageDescription -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf
emptyGenericPackageDescription :: GenericPackageDescription
emptyGenericPackageDescription :: GenericPackageDescription
emptyGenericPackageDescription = PackageDescription
-> [Flag]
-> Maybe (CondTree ConfVar [Dependency] Library)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription
GenericPackageDescription PackageDescription
emptyPackageDescription [] Maybe (CondTree ConfVar [Dependency] Library)
forall a. Maybe a
Nothing [] [] [] [] []
instance L.HasBuildInfos GenericPackageDescription where
traverseBuildInfos :: LensLike
f
GenericPackageDescription
GenericPackageDescription
BuildInfo
BuildInfo
traverseBuildInfos BuildInfo -> f BuildInfo
f (GenericPackageDescription PackageDescription
p [Flag]
a1 Maybe (CondTree ConfVar [Dependency] Library)
x1 [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
x2 [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
x3 [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
x4 [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
x5 [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
x6) =
PackageDescription
-> [Flag]
-> Maybe (CondTree ConfVar [Dependency] Library)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription
GenericPackageDescription
(PackageDescription
-> [Flag]
-> Maybe (CondTree ConfVar [Dependency] Library)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f PackageDescription
-> f ([Flag]
-> Maybe (CondTree ConfVar [Dependency] Library)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> LensLike
f PackageDescription PackageDescription BuildInfo BuildInfo
forall a. HasBuildInfos a => Traversal' a BuildInfo
L.traverseBuildInfos BuildInfo -> f BuildInfo
f PackageDescription
p
f ([Flag]
-> Maybe (CondTree ConfVar [Dependency] Library)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f [Flag]
-> f (Maybe (CondTree ConfVar [Dependency] Library)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Flag] -> f [Flag]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [Flag]
a1
f (Maybe (CondTree ConfVar [Dependency] Library)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f (Maybe (CondTree ConfVar [Dependency] Library))
-> f ([(UnqualComponentName,
CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ((CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library))
-> Maybe (CondTree ConfVar [Dependency] Library)
-> f (Maybe (CondTree ConfVar [Dependency] Library))
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library))
-> Maybe (CondTree ConfVar [Dependency] Library)
-> f (Maybe (CondTree ConfVar [Dependency] Library)))
-> ((BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library))
-> (BuildInfo -> f BuildInfo)
-> Maybe (CondTree ConfVar [Dependency] Library)
-> f (Maybe (CondTree ConfVar [Dependency] Library))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Library -> f Library)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Library -> f Library)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library))
-> ((BuildInfo -> f BuildInfo) -> Library -> f Library)
-> (BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] 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 (CondTree ConfVar [Dependency] Library)
x1
f ([(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> f ([(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (((UnqualComponentName, CondTree ConfVar [Dependency] Library)
-> f (UnqualComponentName, CondTree ConfVar [Dependency] Library))
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> f [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (((UnqualComponentName, CondTree ConfVar [Dependency] Library)
-> f (UnqualComponentName, CondTree ConfVar [Dependency] Library))
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Library)])
-> ((BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] Library)
-> f (UnqualComponentName, CondTree ConfVar [Dependency] Library))
-> (BuildInfo -> f BuildInfo)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
-> f [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] Library)
(UnqualComponentName, CondTree ConfVar [Dependency] Library)
(CondTree ConfVar [Dependency] Library)
(CondTree ConfVar [Dependency] Library)
forall c a b. Lens (c, a) (c, b) a b
L._2 LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] Library)
(UnqualComponentName, CondTree ConfVar [Dependency] Library)
(CondTree ConfVar [Dependency] Library)
(CondTree ConfVar [Dependency] Library)
-> ((BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library))
-> (BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] Library)
-> f (UnqualComponentName, CondTree ConfVar [Dependency] Library)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Library -> f Library)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Library -> f Library)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] Library))
-> ((BuildInfo -> f BuildInfo) -> Library -> f Library)
-> (BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Library
-> f (CondTree ConfVar [Dependency] 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 [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
x2
f ([(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> f ([(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (((UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib))
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (((UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib))
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)])
-> ((BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib))
-> (BuildInfo -> f BuildInfo)
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
(CondTree ConfVar [Dependency] ForeignLib)
(CondTree ConfVar [Dependency] ForeignLib)
forall c a b. Lens (c, a) (c, b) a b
L._2 LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
(CondTree ConfVar [Dependency] ForeignLib)
(CondTree ConfVar [Dependency] ForeignLib)
-> ((BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] ForeignLib
-> f (CondTree ConfVar [Dependency] ForeignLib))
-> (BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] ForeignLib)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ForeignLib -> f ForeignLib)
-> CondTree ConfVar [Dependency] ForeignLib
-> f (CondTree ConfVar [Dependency] ForeignLib)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((ForeignLib -> f ForeignLib)
-> CondTree ConfVar [Dependency] ForeignLib
-> f (CondTree ConfVar [Dependency] ForeignLib))
-> ((BuildInfo -> f BuildInfo) -> ForeignLib -> f ForeignLib)
-> (BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] ForeignLib
-> f (CondTree ConfVar [Dependency] 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 [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
x3
f ([(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> f ([(UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (((UnqualComponentName, CondTree ConfVar [Dependency] Executable)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] Executable))
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (((UnqualComponentName, CondTree ConfVar [Dependency] Executable)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] Executable))
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)])
-> ((BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] Executable)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] Executable))
-> (BuildInfo -> f BuildInfo)
-> [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Executable)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] Executable)
(UnqualComponentName, CondTree ConfVar [Dependency] Executable)
(CondTree ConfVar [Dependency] Executable)
(CondTree ConfVar [Dependency] Executable)
forall c a b. Lens (c, a) (c, b) a b
L._2 LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] Executable)
(UnqualComponentName, CondTree ConfVar [Dependency] Executable)
(CondTree ConfVar [Dependency] Executable)
(CondTree ConfVar [Dependency] Executable)
-> ((BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Executable
-> f (CondTree ConfVar [Dependency] Executable))
-> (BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] Executable)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] Executable)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Executable -> f Executable)
-> CondTree ConfVar [Dependency] Executable
-> f (CondTree ConfVar [Dependency] Executable)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Executable -> f Executable)
-> CondTree ConfVar [Dependency] Executable
-> f (CondTree ConfVar [Dependency] Executable))
-> ((BuildInfo -> f BuildInfo) -> Executable -> f Executable)
-> (BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Executable
-> f (CondTree ConfVar [Dependency] 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 [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
x4
f ([(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite)]
-> f ([(UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (((UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite))
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite)]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (((UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite))
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite)])
-> ((BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite))
-> (BuildInfo -> f BuildInfo)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] TestSuite)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
(CondTree ConfVar [Dependency] TestSuite)
(CondTree ConfVar [Dependency] TestSuite)
forall c a b. Lens (c, a) (c, b) a b
L._2 LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
(CondTree ConfVar [Dependency] TestSuite)
(CondTree ConfVar [Dependency] TestSuite)
-> ((BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] TestSuite
-> f (CondTree ConfVar [Dependency] TestSuite))
-> (BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
-> f (UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (TestSuite -> f TestSuite)
-> CondTree ConfVar [Dependency] TestSuite
-> f (CondTree ConfVar [Dependency] TestSuite)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((TestSuite -> f TestSuite)
-> CondTree ConfVar [Dependency] TestSuite
-> f (CondTree ConfVar [Dependency] TestSuite))
-> ((BuildInfo -> f BuildInfo) -> TestSuite -> f TestSuite)
-> (BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] TestSuite
-> f (CondTree ConfVar [Dependency] 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 [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
x5
f ([(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> GenericPackageDescription)
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark)]
-> f GenericPackageDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (((UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark))
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark)]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (((UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark))
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark)])
-> ((BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
-> f (UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark))
-> (BuildInfo -> f BuildInfo)
-> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
-> f [(UnqualComponentName,
CondTree ConfVar [Dependency] Benchmark)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
(CondTree ConfVar [Dependency] Benchmark)
(CondTree ConfVar [Dependency] Benchmark)
forall c a b. Lens (c, a) (c, b) a b
L._2 LensLike
f
(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
(CondTree ConfVar [Dependency] Benchmark)
(CondTree ConfVar [Dependency] Benchmark)
-> ((BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Benchmark
-> f (CondTree ConfVar [Dependency] Benchmark))
-> (BuildInfo -> f BuildInfo)
-> (UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
-> f (UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Benchmark -> f Benchmark)
-> CondTree ConfVar [Dependency] Benchmark
-> f (CondTree ConfVar [Dependency] Benchmark)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse ((Benchmark -> f Benchmark)
-> CondTree ConfVar [Dependency] Benchmark
-> f (CondTree ConfVar [Dependency] Benchmark))
-> ((BuildInfo -> f BuildInfo) -> Benchmark -> f Benchmark)
-> (BuildInfo -> f BuildInfo)
-> CondTree ConfVar [Dependency] Benchmark
-> f (CondTree ConfVar [Dependency] 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 [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
x6
data Flag = MkFlag
{ Flag -> FlagName
flagName :: FlagName
, Flag -> String
flagDescription :: String
, Flag -> Bool
flagDefault :: Bool
, Flag -> Bool
flagManual :: Bool
}
deriving (Int -> Flag -> ShowS
[Flag] -> ShowS
Flag -> String
(Int -> Flag -> ShowS)
-> (Flag -> String) -> ([Flag] -> ShowS) -> Show Flag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Flag] -> ShowS
$cshowList :: [Flag] -> ShowS
show :: Flag -> String
$cshow :: Flag -> String
showsPrec :: Int -> Flag -> ShowS
$cshowsPrec :: Int -> Flag -> ShowS
Show, Flag -> Flag -> Bool
(Flag -> Flag -> Bool) -> (Flag -> Flag -> Bool) -> Eq Flag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Flag -> Flag -> Bool
$c/= :: Flag -> Flag -> Bool
== :: Flag -> Flag -> Bool
$c== :: Flag -> Flag -> Bool
Eq, Typeable, Typeable Flag
DataType
Constr
Typeable Flag
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Flag -> c Flag)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Flag)
-> (Flag -> Constr)
-> (Flag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Flag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Flag))
-> ((forall b. Data b => b -> b) -> Flag -> Flag)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r)
-> (forall u. (forall d. Data d => d -> u) -> Flag -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Flag -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag)
-> Data Flag
Flag -> DataType
Flag -> Constr
(forall b. Data b => b -> b) -> Flag -> Flag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Flag -> c Flag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Flag
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) -> Flag -> u
forall u. (forall d. Data d => d -> u) -> Flag -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Flag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Flag -> c Flag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Flag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Flag)
$cMkFlag :: Constr
$tFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Flag -> m Flag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag
gmapMp :: (forall d. Data d => d -> m d) -> Flag -> m Flag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag
gmapM :: (forall d. Data d => d -> m d) -> Flag -> m Flag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Flag -> m Flag
gmapQi :: Int -> (forall d. Data d => d -> u) -> Flag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Flag -> u
gmapQ :: (forall d. Data d => d -> u) -> Flag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Flag -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Flag -> r
gmapT :: (forall b. Data b => b -> b) -> Flag -> Flag
$cgmapT :: (forall b. Data b => b -> b) -> Flag -> Flag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Flag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Flag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Flag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Flag)
dataTypeOf :: Flag -> DataType
$cdataTypeOf :: Flag -> DataType
toConstr :: Flag -> Constr
$ctoConstr :: Flag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Flag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Flag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Flag -> c Flag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Flag -> c Flag
$cp1Data :: Typeable Flag
Data, (forall x. Flag -> Rep Flag x)
-> (forall x. Rep Flag x -> Flag) -> Generic Flag
forall x. Rep Flag x -> Flag
forall x. Flag -> Rep Flag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Flag x -> Flag
$cfrom :: forall x. Flag -> Rep Flag x
Generic)
instance Binary Flag
instance NFData Flag where rnf :: Flag -> ()
rnf = Flag -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf
emptyFlag :: FlagName -> Flag
emptyFlag :: FlagName -> Flag
emptyFlag FlagName
name = MkFlag :: FlagName -> String -> Bool -> Bool -> Flag
MkFlag
{ flagName :: FlagName
flagName = FlagName
name
, flagDescription :: String
flagDescription = String
""
, flagDefault :: Bool
flagDefault = Bool
True
, flagManual :: Bool
flagManual = Bool
False
}
newtype FlagName = FlagName ShortText
deriving (FlagName -> FlagName -> Bool
(FlagName -> FlagName -> Bool)
-> (FlagName -> FlagName -> Bool) -> Eq FlagName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FlagName -> FlagName -> Bool
$c/= :: FlagName -> FlagName -> Bool
== :: FlagName -> FlagName -> Bool
$c== :: FlagName -> FlagName -> Bool
Eq, (forall x. FlagName -> Rep FlagName x)
-> (forall x. Rep FlagName x -> FlagName) -> Generic FlagName
forall x. Rep FlagName x -> FlagName
forall x. FlagName -> Rep FlagName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FlagName x -> FlagName
$cfrom :: forall x. FlagName -> Rep FlagName x
Generic, Eq FlagName
Eq FlagName
-> (FlagName -> FlagName -> Ordering)
-> (FlagName -> FlagName -> Bool)
-> (FlagName -> FlagName -> Bool)
-> (FlagName -> FlagName -> Bool)
-> (FlagName -> FlagName -> Bool)
-> (FlagName -> FlagName -> FlagName)
-> (FlagName -> FlagName -> FlagName)
-> Ord FlagName
FlagName -> FlagName -> Bool
FlagName -> FlagName -> Ordering
FlagName -> FlagName -> FlagName
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: FlagName -> FlagName -> FlagName
$cmin :: FlagName -> FlagName -> FlagName
max :: FlagName -> FlagName -> FlagName
$cmax :: FlagName -> FlagName -> FlagName
>= :: FlagName -> FlagName -> Bool
$c>= :: FlagName -> FlagName -> Bool
> :: FlagName -> FlagName -> Bool
$c> :: FlagName -> FlagName -> Bool
<= :: FlagName -> FlagName -> Bool
$c<= :: FlagName -> FlagName -> Bool
< :: FlagName -> FlagName -> Bool
$c< :: FlagName -> FlagName -> Bool
compare :: FlagName -> FlagName -> Ordering
$ccompare :: FlagName -> FlagName -> Ordering
$cp1Ord :: Eq FlagName
Ord, Int -> FlagName -> ShowS
[FlagName] -> ShowS
FlagName -> String
(Int -> FlagName -> ShowS)
-> (FlagName -> String) -> ([FlagName] -> ShowS) -> Show FlagName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FlagName] -> ShowS
$cshowList :: [FlagName] -> ShowS
show :: FlagName -> String
$cshow :: FlagName -> String
showsPrec :: Int -> FlagName -> ShowS
$cshowsPrec :: Int -> FlagName -> ShowS
Show, ReadPrec [FlagName]
ReadPrec FlagName
Int -> ReadS FlagName
ReadS [FlagName]
(Int -> ReadS FlagName)
-> ReadS [FlagName]
-> ReadPrec FlagName
-> ReadPrec [FlagName]
-> Read FlagName
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FlagName]
$creadListPrec :: ReadPrec [FlagName]
readPrec :: ReadPrec FlagName
$creadPrec :: ReadPrec FlagName
readList :: ReadS [FlagName]
$creadList :: ReadS [FlagName]
readsPrec :: Int -> ReadS FlagName
$creadsPrec :: Int -> ReadS FlagName
Read, Typeable, Typeable FlagName
DataType
Constr
Typeable FlagName
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FlagName -> c FlagName)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FlagName)
-> (FlagName -> Constr)
-> (FlagName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FlagName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FlagName))
-> ((forall b. Data b => b -> b) -> FlagName -> FlagName)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r)
-> (forall u. (forall d. Data d => d -> u) -> FlagName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> FlagName -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName)
-> Data FlagName
FlagName -> DataType
FlagName -> Constr
(forall b. Data b => b -> b) -> FlagName -> FlagName
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FlagName -> c FlagName
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FlagName
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) -> FlagName -> u
forall u. (forall d. Data d => d -> u) -> FlagName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FlagName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FlagName -> c FlagName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FlagName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FlagName)
$cFlagName :: Constr
$tFlagName :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> FlagName -> m FlagName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName
gmapMp :: (forall d. Data d => d -> m d) -> FlagName -> m FlagName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName
gmapM :: (forall d. Data d => d -> m d) -> FlagName -> m FlagName
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FlagName -> m FlagName
gmapQi :: Int -> (forall d. Data d => d -> u) -> FlagName -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> FlagName -> u
gmapQ :: (forall d. Data d => d -> u) -> FlagName -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> FlagName -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FlagName -> r
gmapT :: (forall b. Data b => b -> b) -> FlagName -> FlagName
$cgmapT :: (forall b. Data b => b -> b) -> FlagName -> FlagName
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FlagName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FlagName)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c FlagName)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FlagName)
dataTypeOf :: FlagName -> DataType
$cdataTypeOf :: FlagName -> DataType
toConstr :: FlagName -> Constr
$ctoConstr :: FlagName -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FlagName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FlagName
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FlagName -> c FlagName
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FlagName -> c FlagName
$cp1Data :: Typeable FlagName
Data, FlagName -> ()
(FlagName -> ()) -> NFData FlagName
forall a. (a -> ()) -> NFData a
rnf :: FlagName -> ()
$crnf :: FlagName -> ()
NFData)
mkFlagName :: String -> FlagName
mkFlagName :: String -> FlagName
mkFlagName = ShortText -> FlagName
FlagName (ShortText -> FlagName)
-> (String -> ShortText) -> String -> FlagName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ShortText
toShortText
instance IsString FlagName where
fromString :: String -> FlagName
fromString = String -> FlagName
mkFlagName
unFlagName :: FlagName -> String
unFlagName :: FlagName -> String
unFlagName (FlagName ShortText
s) = ShortText -> String
fromShortText ShortText
s
instance Binary FlagName
instance Pretty FlagName where
pretty :: FlagName -> Doc
pretty = String -> Doc
Disp.text (String -> Doc) -> (FlagName -> String) -> FlagName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagName -> String
unFlagName
instance Parsec FlagName where
parsec :: m FlagName
parsec = String -> FlagName
mkFlagName (String -> FlagName) -> ShowS -> String -> FlagName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShowS
lowercase (String -> FlagName) -> m String -> m FlagName
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m String
parsec'
where
parsec' :: m String
parsec' = (:) (Char -> ShowS) -> m Char -> m ShowS
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m Char
lead m ShowS -> m String -> m String
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> m String
rest
lead :: m Char
lead = (Char -> Bool) -> m Char
forall (m :: * -> *). CharParsing m => (Char -> Bool) -> m Char
P.satisfy (\Char
c -> Char -> Bool
isAlphaNum Char
c Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'_')
rest :: m String
rest = (Char -> Bool) -> m String
forall (m :: * -> *). CharParsing m => (Char -> Bool) -> m String
P.munch (\Char
c -> Char -> Bool
isAlphaNum Char
c Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'_' Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'-')
newtype FlagAssignment
= FlagAssignment { FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment :: Map.Map FlagName (Int, Bool) }
deriving (Get FlagAssignment
[FlagAssignment] -> Put
FlagAssignment -> Put
(FlagAssignment -> Put)
-> Get FlagAssignment
-> ([FlagAssignment] -> Put)
-> Binary FlagAssignment
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
putList :: [FlagAssignment] -> Put
$cputList :: [FlagAssignment] -> Put
get :: Get FlagAssignment
$cget :: Get FlagAssignment
put :: FlagAssignment -> Put
$cput :: FlagAssignment -> Put
Binary, (forall x. FlagAssignment -> Rep FlagAssignment x)
-> (forall x. Rep FlagAssignment x -> FlagAssignment)
-> Generic FlagAssignment
forall x. Rep FlagAssignment x -> FlagAssignment
forall x. FlagAssignment -> Rep FlagAssignment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FlagAssignment x -> FlagAssignment
$cfrom :: forall x. FlagAssignment -> Rep FlagAssignment x
Generic, FlagAssignment -> ()
(FlagAssignment -> ()) -> NFData FlagAssignment
forall a. (a -> ()) -> NFData a
rnf :: FlagAssignment -> ()
$crnf :: FlagAssignment -> ()
NFData)
instance Eq FlagAssignment where
== :: FlagAssignment -> FlagAssignment -> Bool
(==) (FlagAssignment Map FlagName (Int, Bool)
m1) (FlagAssignment Map FlagName (Int, Bool)
m2)
= ((Int, Bool) -> Bool)
-> Map FlagName (Int, Bool) -> Map FlagName Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Int, Bool) -> Bool
forall a b. (a, b) -> b
snd Map FlagName (Int, Bool)
m1 Map FlagName Bool -> Map FlagName Bool -> Bool
forall a. Eq a => a -> a -> Bool
== ((Int, Bool) -> Bool)
-> Map FlagName (Int, Bool) -> Map FlagName Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Int, Bool) -> Bool
forall a b. (a, b) -> b
snd Map FlagName (Int, Bool)
m2
instance Ord FlagAssignment where
compare :: FlagAssignment -> FlagAssignment -> Ordering
compare (FlagAssignment Map FlagName (Int, Bool)
m1) (FlagAssignment Map FlagName (Int, Bool)
m2)
= ((Int, Bool) -> Bool)
-> Map FlagName (Int, Bool) -> Map FlagName Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Int, Bool) -> Bool
forall a b. (a, b) -> b
snd Map FlagName (Int, Bool)
m1 Map FlagName Bool -> Map FlagName Bool -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` ((Int, Bool) -> Bool)
-> Map FlagName (Int, Bool) -> Map FlagName Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Int, Bool) -> Bool
forall a b. (a, b) -> b
snd Map FlagName (Int, Bool)
m2
combineFlagValues :: (Int, Bool) -> (Int, Bool) -> (Int, Bool)
combineFlagValues :: (Int, Bool) -> (Int, Bool) -> (Int, Bool)
combineFlagValues (Int
c1, Bool
_) (Int
c2, Bool
b2) = (Int
c1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
c2, Bool
b2)
instance Semigroup FlagAssignment where
<> :: FlagAssignment -> FlagAssignment -> FlagAssignment
(<>) (FlagAssignment Map FlagName (Int, Bool)
m1) (FlagAssignment Map FlagName (Int, Bool)
m2)
= Map FlagName (Int, Bool) -> FlagAssignment
FlagAssignment (((Int, Bool) -> (Int, Bool) -> (Int, Bool))
-> Map FlagName (Int, Bool)
-> Map FlagName (Int, Bool)
-> Map FlagName (Int, Bool)
forall k a. Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a
Map.unionWith (Int, Bool) -> (Int, Bool) -> (Int, Bool)
combineFlagValues Map FlagName (Int, Bool)
m1 Map FlagName (Int, Bool)
m2)
instance Monoid FlagAssignment where
mempty :: FlagAssignment
mempty = Map FlagName (Int, Bool) -> FlagAssignment
FlagAssignment Map FlagName (Int, Bool)
forall k a. Map k a
Map.empty
mappend :: FlagAssignment -> FlagAssignment -> FlagAssignment
mappend = FlagAssignment -> FlagAssignment -> FlagAssignment
forall a. Semigroup a => a -> a -> a
(<>)
mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment
mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment
mkFlagAssignment =
Map FlagName (Int, Bool) -> FlagAssignment
FlagAssignment (Map FlagName (Int, Bool) -> FlagAssignment)
-> ([(FlagName, Bool)] -> Map FlagName (Int, Bool))
-> [(FlagName, Bool)]
-> FlagAssignment
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
((Int, Bool) -> (Int, Bool) -> (Int, Bool))
-> [(FlagName, (Int, Bool))] -> Map FlagName (Int, Bool)
forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
Map.fromListWith (((Int, Bool) -> (Int, Bool) -> (Int, Bool))
-> (Int, Bool) -> (Int, Bool) -> (Int, Bool)
forall a b c. (a -> b -> c) -> b -> a -> c
flip (Int, Bool) -> (Int, Bool) -> (Int, Bool)
combineFlagValues) ([(FlagName, (Int, Bool))] -> Map FlagName (Int, Bool))
-> ([(FlagName, Bool)] -> [(FlagName, (Int, Bool))])
-> [(FlagName, Bool)]
-> Map FlagName (Int, Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((FlagName, Bool) -> (FlagName, (Int, Bool)))
-> [(FlagName, Bool)] -> [(FlagName, (Int, Bool))]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Bool -> (Int, Bool))
-> (FlagName, Bool) -> (FlagName, (Int, Bool))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\Bool
b -> (Int
1, Bool
b)))
unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)]
unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)]
unFlagAssignment = ((FlagName, (Int, Bool)) -> (FlagName, Bool))
-> [(FlagName, (Int, Bool))] -> [(FlagName, Bool)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (((Int, Bool) -> Bool)
-> (FlagName, (Int, Bool)) -> (FlagName, Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Int, Bool) -> Bool
forall a b. (a, b) -> b
snd) ([(FlagName, (Int, Bool))] -> [(FlagName, Bool)])
-> (FlagAssignment -> [(FlagName, (Int, Bool))])
-> FlagAssignment
-> [(FlagName, Bool)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map FlagName (Int, Bool) -> [(FlagName, (Int, Bool))]
forall k a. Map k a -> [(k, a)]
Map.toList (Map FlagName (Int, Bool) -> [(FlagName, (Int, Bool))])
-> (FlagAssignment -> Map FlagName (Int, Bool))
-> FlagAssignment
-> [(FlagName, (Int, Bool))]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment
nullFlagAssignment :: FlagAssignment -> Bool
nullFlagAssignment :: FlagAssignment -> Bool
nullFlagAssignment = Map FlagName (Int, Bool) -> Bool
forall k a. Map k a -> Bool
Map.null (Map FlagName (Int, Bool) -> Bool)
-> (FlagAssignment -> Map FlagName (Int, Bool))
-> FlagAssignment
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment
lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool
lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool
lookupFlagAssignment FlagName
fn = ((Int, Bool) -> Bool) -> Maybe (Int, Bool) -> Maybe Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Int, Bool) -> Bool
forall a b. (a, b) -> b
snd (Maybe (Int, Bool) -> Maybe Bool)
-> (FlagAssignment -> Maybe (Int, Bool))
-> FlagAssignment
-> Maybe Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagName -> Map FlagName (Int, Bool) -> Maybe (Int, Bool)
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup FlagName
fn (Map FlagName (Int, Bool) -> Maybe (Int, Bool))
-> (FlagAssignment -> Map FlagName (Int, Bool))
-> FlagAssignment
-> Maybe (Int, Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment
insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment
insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment
insertFlagAssignment FlagName
flag Bool
val =
Map FlagName (Int, Bool) -> FlagAssignment
FlagAssignment (Map FlagName (Int, Bool) -> FlagAssignment)
-> (FlagAssignment -> Map FlagName (Int, Bool))
-> FlagAssignment
-> FlagAssignment
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
((Int, Bool) -> (Int, Bool) -> (Int, Bool))
-> FlagName
-> (Int, Bool)
-> Map FlagName (Int, Bool)
-> Map FlagName (Int, Bool)
forall k a. Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a
Map.insertWith (((Int, Bool) -> (Int, Bool) -> (Int, Bool))
-> (Int, Bool) -> (Int, Bool) -> (Int, Bool)
forall a b c. (a -> b -> c) -> b -> a -> c
flip (Int, Bool) -> (Int, Bool) -> (Int, Bool)
combineFlagValues) FlagName
flag (Int
1, Bool
val) (Map FlagName (Int, Bool) -> Map FlagName (Int, Bool))
-> (FlagAssignment -> Map FlagName (Int, Bool))
-> FlagAssignment
-> Map FlagName (Int, Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment
diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment
diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment
diffFlagAssignment FlagAssignment
fa1 FlagAssignment
fa2 = Map FlagName (Int, Bool) -> FlagAssignment
FlagAssignment
(Map FlagName (Int, Bool)
-> Map FlagName (Int, Bool) -> Map FlagName (Int, Bool)
forall k a b. Ord k => Map k a -> Map k b -> Map k a
Map.difference (FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment FlagAssignment
fa1) (FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment FlagAssignment
fa2))
findDuplicateFlagAssignments :: FlagAssignment -> [FlagName]
findDuplicateFlagAssignments :: FlagAssignment -> [FlagName]
findDuplicateFlagAssignments =
Map FlagName (Int, Bool) -> [FlagName]
forall k a. Map k a -> [k]
Map.keys (Map FlagName (Int, Bool) -> [FlagName])
-> (FlagAssignment -> Map FlagName (Int, Bool))
-> FlagAssignment
-> [FlagName]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Int, Bool) -> Bool)
-> Map FlagName (Int, Bool) -> Map FlagName (Int, Bool)
forall a k. (a -> Bool) -> Map k a -> Map k a
Map.filter ((Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
1) (Int -> Bool) -> ((Int, Bool) -> Int) -> (Int, Bool) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Bool) -> Int
forall a b. (a, b) -> a
fst) (Map FlagName (Int, Bool) -> Map FlagName (Int, Bool))
-> (FlagAssignment -> Map FlagName (Int, Bool))
-> FlagAssignment
-> Map FlagName (Int, Bool)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagAssignment -> Map FlagName (Int, Bool)
getFlagAssignment
instance Read FlagAssignment where
readsPrec :: Int -> ReadS FlagAssignment
readsPrec Int
p String
s = [ (Map FlagName (Int, Bool) -> FlagAssignment
FlagAssignment Map FlagName (Int, Bool)
x, String
rest) | (Map FlagName (Int, Bool)
x,String
rest) <- Int -> ReadS (Map FlagName (Int, Bool))
forall a. Read a => Int -> ReadS a
readsPrec Int
p String
s ]
instance Show FlagAssignment where
showsPrec :: Int -> FlagAssignment -> ShowS
showsPrec Int
p (FlagAssignment Map FlagName (Int, Bool)
xs) = Int -> Map FlagName (Int, Bool) -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
p Map FlagName (Int, Bool)
xs
showFlagValue :: (FlagName, Bool) -> String
showFlagValue :: (FlagName, Bool) -> String
showFlagValue (FlagName
f, Bool
True) = Char
'+' Char -> ShowS
forall a. a -> [a] -> [a]
: FlagName -> String
unFlagName FlagName
f
showFlagValue (FlagName
f, Bool
False) = Char
'-' Char -> ShowS
forall a. a -> [a] -> [a]
: FlagName -> String
unFlagName FlagName
f
dispFlagAssignment :: FlagAssignment -> Disp.Doc
dispFlagAssignment :: FlagAssignment -> Doc
dispFlagAssignment = [Doc] -> Doc
Disp.hsep ([Doc] -> Doc)
-> (FlagAssignment -> [Doc]) -> FlagAssignment -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((FlagName, Bool) -> Doc) -> [(FlagName, Bool)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (String -> Doc
Disp.text (String -> Doc)
-> ((FlagName, Bool) -> String) -> (FlagName, Bool) -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (FlagName, Bool) -> String
showFlagValue) ([(FlagName, Bool)] -> [Doc])
-> (FlagAssignment -> [(FlagName, Bool)])
-> FlagAssignment
-> [Doc]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlagAssignment -> [(FlagName, Bool)]
unFlagAssignment
parsecFlagAssignment :: CabalParsing m => m FlagAssignment
parsecFlagAssignment :: m FlagAssignment
parsecFlagAssignment = [(FlagName, Bool)] -> FlagAssignment
mkFlagAssignment ([(FlagName, Bool)] -> FlagAssignment)
-> m [(FlagName, Bool)] -> m FlagAssignment
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
m (FlagName, Bool) -> m () -> m [(FlagName, Bool)]
forall (m :: * -> *) a sep. Alternative m => m a -> m sep -> m [a]
P.sepBy (m (FlagName, Bool)
onFlag m (FlagName, Bool) -> m (FlagName, Bool) -> m (FlagName, Bool)
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> m (FlagName, Bool)
offFlag) m ()
forall (m :: * -> *). CharParsing m => m ()
P.skipSpaces1
where
onFlag :: m (FlagName, Bool)
onFlag = do
Maybe Char
_ <- m Char -> m (Maybe Char)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
P.optional (Char -> m Char
forall (m :: * -> *). CharParsing m => Char -> m Char
P.char Char
'+')
FlagName
f <- m FlagName
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
parsec
(FlagName, Bool) -> m (FlagName, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (FlagName
f, Bool
True)
offFlag :: m (FlagName, Bool)
offFlag = do
Char
_ <- Char -> m Char
forall (m :: * -> *). CharParsing m => Char -> m Char
P.char Char
'-'
FlagName
f <- m FlagName
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
parsec
(FlagName, Bool) -> m (FlagName, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (FlagName
f, Bool
False)
data ConfVar = OS OS
| Arch Arch
| Flag FlagName
| Impl CompilerFlavor VersionRange
deriving (ConfVar -> ConfVar -> Bool
(ConfVar -> ConfVar -> Bool)
-> (ConfVar -> ConfVar -> Bool) -> Eq ConfVar
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfVar -> ConfVar -> Bool
$c/= :: ConfVar -> ConfVar -> Bool
== :: ConfVar -> ConfVar -> Bool
$c== :: ConfVar -> ConfVar -> Bool
Eq, Int -> ConfVar -> ShowS
[ConfVar] -> ShowS
ConfVar -> String
(Int -> ConfVar -> ShowS)
-> (ConfVar -> String) -> ([ConfVar] -> ShowS) -> Show ConfVar
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfVar] -> ShowS
$cshowList :: [ConfVar] -> ShowS
show :: ConfVar -> String
$cshow :: ConfVar -> String
showsPrec :: Int -> ConfVar -> ShowS
$cshowsPrec :: Int -> ConfVar -> ShowS
Show, Typeable, Typeable ConfVar
DataType
Constr
Typeable ConfVar
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConfVar -> c ConfVar)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConfVar)
-> (ConfVar -> Constr)
-> (ConfVar -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConfVar))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConfVar))
-> ((forall b. Data b => b -> b) -> ConfVar -> ConfVar)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConfVar -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ConfVar -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar)
-> Data ConfVar
ConfVar -> DataType
ConfVar -> Constr
(forall b. Data b => b -> b) -> ConfVar -> ConfVar
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConfVar -> c ConfVar
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConfVar
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) -> ConfVar -> u
forall u. (forall d. Data d => d -> u) -> ConfVar -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConfVar
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConfVar -> c ConfVar
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConfVar)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConfVar)
$cImpl :: Constr
$cFlag :: Constr
$cArch :: Constr
$cOS :: Constr
$tConfVar :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
gmapMp :: (forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
gmapM :: (forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConfVar -> m ConfVar
gmapQi :: Int -> (forall d. Data d => d -> u) -> ConfVar -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ConfVar -> u
gmapQ :: (forall d. Data d => d -> u) -> ConfVar -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConfVar -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConfVar -> r
gmapT :: (forall b. Data b => b -> b) -> ConfVar -> ConfVar
$cgmapT :: (forall b. Data b => b -> b) -> ConfVar -> ConfVar
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConfVar)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConfVar)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ConfVar)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConfVar)
dataTypeOf :: ConfVar -> DataType
$cdataTypeOf :: ConfVar -> DataType
toConstr :: ConfVar -> Constr
$ctoConstr :: ConfVar -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConfVar
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConfVar
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConfVar -> c ConfVar
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConfVar -> c ConfVar
$cp1Data :: Typeable ConfVar
Data, (forall x. ConfVar -> Rep ConfVar x)
-> (forall x. Rep ConfVar x -> ConfVar) -> Generic ConfVar
forall x. Rep ConfVar x -> ConfVar
forall x. ConfVar -> Rep ConfVar x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfVar x -> ConfVar
$cfrom :: forall x. ConfVar -> Rep ConfVar x
Generic)
instance Binary ConfVar
instance NFData ConfVar where rnf :: ConfVar -> ()
rnf = ConfVar -> ()
forall a. (Generic a, GNFData (Rep a)) => a -> ()
genericRnf