summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2014-06-07 00:14:05 -0400
committerJoey Hess2014-06-07 00:14:05 -0400
commit582be8ebe00838509d978091d3c97ebeb1bf99de (patch)
treeffef9bbb4ef25db03cf48962058146258993652f /src/Propellor/Property.hs
parent969db1ed56157aa202359c0f47fff783baba6eac (diff)
combineProperties no longer stops when a property fails; now it continues trying to satisfy all properties on the list before propigating the failure.
Audited all of my calls to combineProperties and they should be fine with this behavior.. which suggests it's the right behavior.
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index c7a03765..8e419a6b 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -26,7 +26,8 @@ propertyList :: Desc -> [Property] -> Property
propertyList desc ps = Property desc (ensureProperties ps) (combineAttrs ps)
-- | Combines a list of properties, resulting in one property that
--- ensures each in turn, stopping on failure.
+-- ensures each in turn. Does not stop on failure; does propigate
+-- overall success/failure.
combineProperties :: Desc -> [Property] -> Property
combineProperties desc ps = Property desc (go ps NoChange) (combineAttrs ps)
where
@@ -37,15 +38,6 @@ combineProperties desc ps = Property desc (go ps NoChange) (combineAttrs ps)
FailedChange -> return FailedChange
_ -> go ls (r <> rs)
--- | Does not stop on failure (but does propigate failure at the end).
-combineProperties' :: Desc -> [Property] -> Property
-combineProperties' desc ps = Property desc (go ps NoChange) (combineAttrs ps)
- where
- go [] rs = return rs
- go (l:ls) rs = do
- r <- ensureProperty l
- go ls (r <> rs)
-
-- | Combines together two properties, resulting in one property
-- that ensures the first, and if the first succeeds, ensures the second.
-- The property uses the description of the first property.