diff options
| author | Joey Hess <id@joeyh.name> | 2014-12-07 12:04:58 -0400 |
|---|---|---|
| committer | Joey Hess <id@joeyh.name> | 2014-12-07 12:04:58 -0400 |
| commit | 322ae878bbaef94736fdc4cae60b6c3b8c17a54d (patch) | |
| tree | 4113593f21d964ad8f821ebbd408a528011f1398 /src/Propellor/Property.hs | |
| parent | b7da90a91516c0d496c44459ed03009e58f39233 (diff) | |
| parent | dd40a05ced3b7c50a3a7751c66ad5a253056459e (diff) | |
Merge branch 'joeyconfig'
Conflicts:
privdata.joey/privdata.gpg
Diffstat (limited to 'src/Propellor/Property.hs')
| -rw-r--r-- | src/Propellor/Property.hs | 10 |
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] |
