summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
authorJoey Hess2015-01-25 01:26:38 -0400
committerJoey Hess2015-01-25 01:26:38 -0400
commitf5da1c2b230d8b57547af3f1c8ce3a13aa4643e2 (patch)
treeb32c1e6e8fc8834e216f1c70c7e6c3f6d565ef58 /src/Propellor/Property.hs
parenta780cae4415af7c901fab89c25b2614a50acb059 (diff)
improve docs
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index e9c8cf23..1801902e 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -14,7 +14,8 @@ import Propellor.Types
import Propellor.Info
import Utility.Monad
--- Constructs a Property.
+-- | Constructs a Property, from a description and an action to run to
+-- ensure the Property is met.
property :: Desc -> Propellor Result -> Property NoInfo
property d s = simpleProperty d s mempty
@@ -38,7 +39,7 @@ flagFile' p getflagfile = adjustPropertySatisfy p $ \satisfy -> do
writeFile flagfile ""
return r
---- | Whenever a change has to be made for a Property, causes a hook
+-- | Whenever a change has to be made for a Property, causes a hook
-- Property to also be run, but not otherwise.
onChange
:: (Combines (Property x) (Property y))
@@ -53,6 +54,7 @@ onChange = combineWith $ \p hook -> do
return $ r <> r'
_ -> return r
+-- | Alias for @flip describe@
(==>) :: IsProp (Property i) => Desc -> Property i -> Property i
(==>) = flip describe
infixl 1 ==>
@@ -86,9 +88,6 @@ trivial p = adjustPropertySatisfy p $ \satisfy -> do
then return NoChange
else return r
-doNothing :: Property NoInfo
-doNothing = property "noop property" noChange
-
-- | Makes a property that is satisfied differently depending on the host's
-- operating system.
--
@@ -106,6 +105,9 @@ makeChange a = liftIO a >> return MadeChange
noChange :: Propellor Result
noChange = return NoChange
+doNothing :: Property NoInfo
+doNothing = property "noop property" 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]