summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index bf69ff60..1d750a78 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
@@ -135,38 +135,6 @@ revert (RevertableProperty p1 p2) = RevertableProperty p2 p1
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) }