summaryrefslogtreecommitdiff
path: root/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-02 20:56:02 -0400
committerJoey Hess2014-04-02 20:56:02 -0400
commit5674818300966d4186bf98ef8a075c502271c9cb (patch)
tree6263c4f32ac98b7e7f83bc5a4057d55c0dd7cd5b /Propellor/Property.hs
parent595794a250a35f3f3613dcf47b955bcdae867e04 (diff)
propellor spin
Diffstat (limited to 'Propellor/Property.hs')
-rw-r--r--Propellor/Property.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Propellor/Property.hs b/Propellor/Property.hs
index 7419f352..29f6bb80 100644
--- a/Propellor/Property.hs
+++ b/Propellor/Property.hs
@@ -69,6 +69,12 @@ check c property = Property (propertyDesc property) $ ifM c
, return NoChange
)
+boolProperty :: Desc -> IO Bool -> Property
+boolProperty desc a = Property desc $ ifM a
+ ( return MadeChange
+ , return FailedChange
+ )
+
-- | Undoes the effect of a property.
revert :: RevertableProperty -> RevertableProperty
revert (RevertableProperty p1 p2) = RevertableProperty p2 p1