summaryrefslogtreecommitdiff
path: root/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2014-03-30 00:52:02 -0400
committerJoey Hess2014-03-30 00:52:02 -0400
commite812acce3e46b7dd259783fc28c2c65d4ad7a228 (patch)
tree0e4fb9437427d5b58cfaaee77d3025a6c8c93498 /Property.hs
parent08a0a46efe9b96ba741d4cd28451e313726dcba4 (diff)
improvements
Diffstat (limited to 'Property.hs')
-rw-r--r--Property.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Property.hs b/Property.hs
index 3243d278..c4db8bcf 100644
--- a/Property.hs
+++ b/Property.hs
@@ -147,6 +147,9 @@ property `onChange` hook = IOProperty (propertyDesc property) $ do
return $ combineResult r r'
_ -> return r
+requires :: Property -> Property -> Property
+x `requires` y = combineProperties (propertyDesc x) [y, x]
+
{- Makes a Property only be performed when a test succeeds. -}
check :: IO Bool -> Property -> Property
check c property = IOProperty (propertyDesc property) $ ifM c