diff options
| author | Joey Hess <joey@kitenet.net> | 2014-10-24 09:58:12 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-10-24 09:58:12 -0400 |
| commit | 3959d5be901121cc697316837b96b6bdc37248d2 (patch) | |
| tree | 93bbef55ad3d247f2e64d5cb7ceb1f3679514935 /src/Propellor/Property.hs | |
| parent | 2bd599470a875b10159535ecb44b3a3aac59da85 (diff) | |
| parent | b5ab8a7f9fedc283cd561b8a414748ecee3868fd (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property.hs')
| -rw-r--r-- | src/Propellor/Property.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index ce825192..4b957317 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -135,7 +135,7 @@ host hn = Host hn [] mempty -- -- Can add Properties and RevertableProperties (&) :: IsProp p => Host -> p -> Host -(Host hn ps as) & p = Host hn (ps ++ [toProp p]) (as <> getInfo p) +(Host hn ps is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p) infixl 1 & @@ -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) } |
