summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2014-12-07 12:04:58 -0400
committerJoey Hess2014-12-07 12:04:58 -0400
commit322ae878bbaef94736fdc4cae60b6c3b8c17a54d (patch)
tree4113593f21d964ad8f821ebbd408a528011f1398 /src/Propellor/Property.hs
parentb7da90a91516c0d496c44459ed03009e58f39233 (diff)
parentdd40a05ced3b7c50a3a7751c66ad5a253056459e (diff)
Merge branch 'joeyconfig'
Conflicts: privdata.joey/privdata.gpg
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index 6ace5e4e..6371cc09 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -7,7 +7,7 @@ import System.FilePath
import Control.Monad
import Data.Monoid
import Control.Monad.IfElse
-import "mtl" Control.Monad.Reader
+import "mtl" Control.Monad.RWS.Strict
import Propellor.Types
import Propellor.Info
@@ -131,11 +131,11 @@ boolProperty desc a = property desc $ ifM (liftIO a)
revert :: RevertableProperty -> RevertableProperty
revert (RevertableProperty p1 p2) = RevertableProperty p2 p1
--- Changes the action that is performed to satisfy a property.
+-- | 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) }
--- Combines the Info of two properties.
+-- | Combines the Info of two properties.
combineInfo :: (IsProp p, IsProp q) => p -> q -> Info
combineInfo p q = getInfo p <> getInfo q
@@ -147,3 +147,7 @@ makeChange a = liftIO a >> return MadeChange
noChange :: Propellor Result
noChange = return NoChange
+
+-- | Registers an action that should be run at the very end,
+endAction :: Desc -> (Result -> Propellor Result) -> Propellor ()
+endAction desc a = tell [EndAction desc a]