Commit 1053834a authored by kristenk's avatar kristenk

Move BooleanFlag from D.C.Types to D.S.Setup

parent dfd8a46e
......@@ -66,6 +66,7 @@ module Distribution.Simple.Setup (
fromFlagOrDefault,
flagToMaybe,
flagToList,
BooleanFlag(..),
boolOpt, boolOpt', trueArg, falseArg,
optionVerbosity, optionNumJobs, readPToMaybe ) where
......@@ -175,6 +176,13 @@ allFlags flags = if all (\f -> fromFlagOrDefault False f) flags
then Flag True
else NoFlag
-- | Types that represent boolean flags.
class BooleanFlag a where
asBool :: a -> Bool
instance BooleanFlag Bool where
asBool = id
-- ------------------------------------------------------------
-- * Global flags
-- ------------------------------------------------------------
......
......@@ -23,7 +23,8 @@ import Distribution.Client.Dependency.Modular.Package
import qualified Distribution.Client.Dependency.Modular.Preference as P
import Distribution.Client.Dependency.Modular.Validate
import Distribution.Client.Dependency.Modular.Linking
import Distribution.Client.Types (BooleanFlag(..))
import Distribution.Simple.Setup (BooleanFlag(..))
-- | Various options for the modular solver.
data SolverConfig = SolverConfig {
......
......@@ -61,8 +61,7 @@ import Data.Monoid
import Distribution.Client.PkgConfigDb
( PkgConfigDb )
import Distribution.Client.Types
( BooleanFlag(..), OptionalStanza(..), SourcePackage(..)
, SolverPackage )
( OptionalStanza(..), SourcePackage(..), SolverPackage )
import qualified Distribution.Compat.ReadP as Parse
( pfail, munch1 )
......@@ -73,6 +72,7 @@ import Distribution.InstalledPackageInfo
import qualified Distribution.Client.PackageIndex as PackageIndex
( PackageIndex )
import Distribution.Simple.PackageIndex ( InstalledPackageIndex )
import Distribution.Simple.Setup ( BooleanFlag(..) )
import Distribution.Package
( PackageName )
import Distribution.Version
......
......@@ -55,7 +55,7 @@ module Distribution.Client.Setup
) where
import Distribution.Client.Types
( BooleanFlag(..), Username(..), Password(..), RemoteRepo(..) )
( Username(..), Password(..), RemoteRepo(..) )
import Distribution.Client.BuildReports.Types
( ReportLevel(..) )
import Distribution.Client.Dependency.Types
......@@ -82,7 +82,8 @@ import Distribution.Simple.Setup
, SDistFlags(..), HaddockFlags(..)
, readPackageDbList, showPackageDbList
, Flag(..), toFlag, flagToMaybe, flagToList
, optionVerbosity, boolOpt, boolOpt', trueArg, falseArg
, BooleanFlag(..), optionVerbosity
, boolOpt, boolOpt', trueArg, falseArg
, readPToMaybe, optionNumJobs )
import Distribution.Simple.InstallDirs
( PathTemplate, InstallDirs(sysconfdir)
......
......@@ -51,13 +51,6 @@ import Distribution.Compat.Binary (Binary(..))
newtype Username = Username { unUsername :: String }
newtype Password = Password { unPassword :: String }
-- | Types that represent boolean flags.
class BooleanFlag a where
asBool :: a -> Bool
instance BooleanFlag Bool where
asBool = id
-- | This is the information we get from a @00-index.tar.gz@ hackage index.
--
data SourcePackageDb = SourcePackageDb {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment