summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2015-10-23 17:25:31 -0400
committerJoey Hess2015-10-23 17:25:31 -0400
commit1cd7f557f0c89714c47855f38583073c313674f2 (patch)
treeeab23a5274f1d511d4c11fd680da97a34c5c6f85 /src/Propellor/Property.hs
parent3aee86abac10f1ad9d4b51c024f5f3c02cdbfc68 (diff)
generalize check
Hmm, do I really need my own type class for LiftPropellor? This seems like a general problem so I am probably reinventing the wheel.
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index 342db1a5..95805054 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -142,11 +142,12 @@ ensureProperty :: Property NoInfo -> Propellor Result
ensureProperty = catchPropellor . propertySatisfy
-- | Makes a Property only need to do anything when a test succeeds.
-check :: IO Bool -> Property i -> Property i
-check c p = adjustPropertySatisfy p $ \satisfy -> ifM (liftIO c)
- ( satisfy
- , return NoChange
- )
+check :: (LiftPropellor m) => m Bool -> Property i -> Property i
+check c p = adjustPropertySatisfy p $ \satisfy ->
+ ifM (liftPropellor c)
+ ( satisfy
+ , return NoChange
+ )
-- | Tries the first property, but if it fails to work, instead uses
-- the second.