Commit 0de7b313 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by GitHub
Browse files

Merge pull request #4679

Turn `allow-{newer,older}` into an accumulating field to match CLI semantics
parents 6a088500 35181170
......@@ -831,12 +831,12 @@ legacySharedConfigFieldDescrs =
disp parse
configPreferences (\v conf -> conf { configPreferences = v })
, simpleField "allow-older"
, monoidField "allow-older"
(maybe mempty disp) (fmap Just parse)
(fmap unAllowOlder . configAllowOlder)
(\v conf -> conf { configAllowOlder = fmap AllowOlder v })
, simpleField "allow-newer"
, monoidField "allow-newer"
(maybe mempty disp) (fmap Just parse)
(fmap unAllowNewer . configAllowNewer)
(\v conf -> conf { configAllowNewer = fmap AllowNewer v })
......@@ -1255,6 +1255,15 @@ listFieldWithSep separator name showF readF get' set =
set' xs b = set (get' b ++ xs) b
showF' = separator . map showF
-- | Parser combinator for simple fields which uses the field type's
-- 'Monoid' instance for combining multiple occurences of the field.
monoidField :: Monoid a => String -> (a -> Doc) -> ReadP a a
-> (b -> a) -> (a -> b -> b) -> FieldDescr b
monoidField name showF readF get' set =
liftField get' set' $ ParseUtils.field name showF readF
where
set' xs b = set (get' b `mappend` xs) b
--TODO: [code cleanup] local redefinition that should replace the version in
-- D.ParseUtils. This version avoid parse ambiguity for list element parsers
-- that have multiple valid parses of prefixes.
......
......@@ -18,7 +18,11 @@
* `--store-dir` option can be used to configure the location of
the build global build store.
2.0.0.2 Mikhail Glushenkov <mikhail.glushenkov@gmail.com> July 2017
2.0.TBD
* Turn `allow-{newer,older}` in `cabal.project` files into an
accumulating field to match CLI flag semantics (#4679).
2.0.0.0 Mikhail Glushenkov <mikhail.glushenkov@gmail.com> August 2017
* Removed the '--root-cmd' parameter of the 'install' command
(#3356).
* Deprecated 'cabal install --global' (#3356).
......
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