From 856a4c673cc890b1e2e5ee749bdc70ea6d7f1cb9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 03:27:40 -0400 Subject: propellor spin --- src/Propellor/Property.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Propellor/Property.hs') 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) } -- cgit v1.2.3