Commit 58bd37ed authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Add emptyFlag

parent 48ea0e29
......@@ -86,7 +86,7 @@ module Distribution.PackageDescription (
-- * package configuration
GenericPackageDescription(..),
Flag(..), FlagName(..), FlagAssignment,
Flag(..), emptyFlag, FlagName(..), FlagAssignment,
CondTree(..), ConfVar(..), Condition(..),
cNot, cAnd, cOr,
......
......@@ -980,7 +980,7 @@ parsePackageDescription file = do
flag <- lift $ parseFields
flagFieldDescrs
warnUnrec
(MkFlag (FlagName (lowercase sec_label)) "" True False)
(emptyFlag (FlagName (lowercase sec_label)))
sec_fields
skipField
(repos, flags, csetup, mlib, sub_libs, exes, tests, bms) <- getBody pkg
......
......@@ -7,6 +7,7 @@
module Distribution.Types.GenericPackageDescription (
GenericPackageDescription(..),
Flag(..),
emptyFlag,
FlagName(..),
FlagAssignment,
ConfVar(..),
......@@ -64,6 +65,15 @@ data Flag = MkFlag
instance Binary Flag
-- | A 'Flag' initialized with default parameters.
emptyFlag :: FlagName -> Flag
emptyFlag name = MkFlag
{ flagName = name
, flagDescription = ""
, flagDefault = True
, flagManual = False
}
-- | A 'FlagName' is the name of a user-defined configuration flag
newtype FlagName = FlagName String
deriving (Eq, Generic, Ord, Show, Read, Typeable, Data)
......
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