summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2014-10-23 03:27:40 -0400
committerJoey Hess2014-10-23 03:27:40 -0400
commit856a4c673cc890b1e2e5ee749bdc70ea6d7f1cb9 (patch)
treeef7bac9df90a885278e0b61af19a91654c946c62 /src/Propellor/Property.hs
parent93099b862768235d3f9936435f6f65292b8d9b7c (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index 87136042..4b957317 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -145,6 +145,14 @@ h ! p = h & revert p
infixl 1 !
+-- | Like (&), but adds the property as the first property of the host.
+-- Normally, property order should not matter, but this is useful
+-- when it does.
+(&^) :: IsProp p => Host -> p -> Host
+(Host hn ps is) &^ p = Host hn ([toProp p] ++ ps) (getInfo p <> is)
+
+infixl 1 &^
+
-- Changes the action that is performed to satisfy a property.
adjustProperty :: Property -> (Propellor Result -> Propellor Result) -> Property
adjustProperty p f = p { propertySatisfy = f (propertySatisfy p) }