    {-# LANGUAGE DeriveGeneric #-}
    module Distribution.Solver.Types.SolverPackage
        ( SolverPackage(..)
        ) where

    import Distribution.Solver.Compat.Prelude
    import Prelude ()

    import Distribution.Package ( Package(..) )
    import Distribution.PackageDescription ( FlagAssignment )
    import Distribution.Solver.Types.ComponentDeps ( ComponentDeps )
    import Distribution.Solver.Types.OptionalStanza
    import Distribution.Solver.Types.SolverId
    import Distribution.Solver.Types.SourcePackage

    -- | A 'SolverPackage' is a package specified by the dependency solver.
    -- It will get elaborated into a 'ConfiguredPackage' or even an
    -- 'ElaboratedConfiguredPackage'.
    --
    -- NB: 'SolverPackage's are essentially always with 'UnresolvedPkgLoc',
    -- but for symmetry we have the parameter.  (Maybe it can be removed.)
    --
    data SolverPackage loc = SolverPackage {
            forall loc. SolverPackage loc -> SourcePackage loc
    solverPkgSource  :: SourcePackage loc,
            forall loc. SolverPackage loc -> FlagAssignment
    solverPkgFlags   :: FlagAssignment,
            forall loc. SolverPackage loc -> OptionalStanzaSet
    solverPkgStanzas :: OptionalStanzaSet,
            forall loc. SolverPackage loc -> ComponentDeps [SolverId]
    solverPkgLibDeps :: ComponentDeps [SolverId],
            forall loc. SolverPackage loc -> ComponentDeps [SolverId]
    solverPkgExeDeps :: ComponentDeps [SolverId]
        }
      deriving (SolverPackage loc -> SolverPackage loc -> Bool
    (SolverPackage loc -> SolverPackage loc -> Bool)
    -> (SolverPackage loc -> SolverPackage loc -> Bool)
    -> Eq (SolverPackage loc)
    forall loc.
    Eq loc =>
    SolverPackage loc -> SolverPackage loc -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall loc.
    Eq loc =>
    SolverPackage loc -> SolverPackage loc -> Bool
    == :: SolverPackage loc -> SolverPackage loc -> Bool
    $c/= :: forall loc.
    Eq loc =>
    SolverPackage loc -> SolverPackage loc -> Bool
    /= :: SolverPackage loc -> SolverPackage loc -> Bool
    Eq, Int -> SolverPackage loc -> ShowS
    [SolverPackage loc] -> ShowS
    SolverPackage loc -> String
    (Int -> SolverPackage loc -> ShowS)
    -> (SolverPackage loc -> String)
    -> ([SolverPackage loc] -> ShowS)
    -> Show (SolverPackage loc)
    forall loc. Show loc => Int -> SolverPackage loc -> ShowS
    forall loc. Show loc => [SolverPackage loc] -> ShowS
    forall loc. Show loc => SolverPackage loc -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall loc. Show loc => Int -> SolverPackage loc -> ShowS
    showsPrec :: Int -> SolverPackage loc -> ShowS
    $cshow :: forall loc. Show loc => SolverPackage loc -> String
    show :: SolverPackage loc -> String
    $cshowList :: forall loc. Show loc => [SolverPackage loc] -> ShowS
    showList :: [SolverPackage loc] -> ShowS
    Show, (forall x. SolverPackage loc -> Rep (SolverPackage loc) x)
    -> (forall x. Rep (SolverPackage loc) x -> SolverPackage loc)
    -> Generic (SolverPackage loc)
    forall x. Rep (SolverPackage loc) x -> SolverPackage loc
    forall x. SolverPackage loc -> Rep (SolverPackage loc) x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    forall loc x. Rep (SolverPackage loc) x -> SolverPackage loc
    forall loc x. SolverPackage loc -> Rep (SolverPackage loc) x
    $cfrom :: forall loc x. SolverPackage loc -> Rep (SolverPackage loc) x
    from :: forall x. SolverPackage loc -> Rep (SolverPackage loc) x
    $cto :: forall loc x. Rep (SolverPackage loc) x -> SolverPackage loc
    to :: forall x. Rep (SolverPackage loc) x -> SolverPackage loc
    Generic)

    instance Binary loc => Binary (SolverPackage loc)
    instance Structured loc => Structured (SolverPackage loc)

    instance Package (SolverPackage loc) where
      packageId :: SolverPackage loc -> PackageIdentifier
    packageId = SourcePackage loc -> PackageIdentifier
    forall pkg. Package pkg => pkg -> PackageIdentifier
    packageId (SourcePackage loc -> PackageIdentifier)
    -> (SolverPackage loc -> SourcePackage loc)
    -> SolverPackage loc
    -> PackageIdentifier
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . SolverPackage loc -> SourcePackage loc
    forall loc. SolverPackage loc -> SourcePackage loc
    solverPkgSource