From f5da1c2b230d8b57547af3f1c8ce3a13aa4643e2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2015 01:26:38 -0400 Subject: improve docs --- src/Propellor/Property.hs | 12 +++++++----- 1 file 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] -- cgit v1.2.3