1 {-# LANGUAGE DeriveFunctor #-}
2 module Distribution
.Solver
.Modular
.Var
(
8 import Prelude
hiding (pi)
10 import Distribution
.Solver
.Modular
.Flag
11 import Distribution
.Solver
.Types
.PackagePath
13 {-------------------------------------------------------------------------------
15 -------------------------------------------------------------------------------}
17 -- | The type of variables that play a role in the solver.
18 -- Note that the tree currently does not use this type directly,
19 -- and rather has separate tree nodes for the different types of
20 -- variables. This fits better with the fact that in most cases,
21 -- these have to be treated differently.
22 data Var qpn
= P qpn | F
(FN qpn
) | S
(SN qpn
)
23 deriving (Eq
, Ord
, Show, Functor
)
25 showVar
:: Var QPN
-> String
26 showVar
(P qpn
) = showQPN qpn
27 showVar
(F qfn
) = showQFN qfn
28 showVar
(S qsn
) = showQSN qsn
30 -- | Extract the package name from a Var
31 varPN
:: Var qpn
-> qpn
33 varPN
(F
(FN qpn _
)) = qpn
34 varPN
(S
(SN qpn _
)) = qpn