diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-20 19:21:22 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-20 19:21:22 -0400 |
| commit | 1eaeddc2ebc5af5351b2de3d8a4d1788a77039da (patch) | |
| tree | 2a7d89097f2392788b1461083f0aa1c617950d90 /src/Propellor/Property.hs | |
| parent | 02b8b2dec7c767ba3b7154e424b9c11e6a8d544f (diff) | |
| parent | ba862ae8877c21eb63f7fba08ba5fc934a4c391c (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property.hs')
| -rw-r--r-- | src/Propellor/Property.hs | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index bf69ff60..6ace5e4e 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -3,6 +3,7 @@ module Propellor.Property where import System.Directory +import System.FilePath import Control.Monad import Data.Monoid import Control.Monad.IfElse @@ -12,7 +13,6 @@ import Propellor.Types import Propellor.Info import Propellor.Engine import Utility.Monad -import System.FilePath -- Constructs a Property. property :: Desc -> Propellor Result -> Property @@ -131,42 +131,6 @@ boolProperty desc a = property desc $ ifM (liftIO a) revert :: RevertableProperty -> RevertableProperty revert (RevertableProperty p1 p2) = RevertableProperty p2 p1 --- | Turns a revertable property into a regular property. -unrevertable :: RevertableProperty -> Property -unrevertable (RevertableProperty p1 _p2) = p1 - --- | Starts accumulating the properties of a Host. --- --- > host "example.com" --- > & someproperty --- > ! oldproperty --- > & otherproperty -host :: HostName -> Host -host hn = Host hn [] mempty - -class Hostlike h where - -- | Adds a property to a Host - -- - -- Can add Properties and RevertableProperties - (&) :: IsProp p => h -> p -> h - -- | 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 => h -> p -> h - -instance Hostlike Host where - (Host hn ps is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p) - (Host hn ps is) &^ p = Host hn ([toProp p] ++ ps) (getInfo p <> is) - --- | Adds a property to the Host in reverted form. -(!) :: Hostlike h => h -> RevertableProperty -> h -h ! p = h & revert p - -infixl 1 &^ -infixl 1 & -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) } |
