From 349e675a499187379ddb14c5f6ce8203de10183e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 10 Oct 2015 11:40:12 -0400 Subject: Improved documentation, particularly of the Propellor module. This involved some code changes, including some renaming of instance methods. (ABI change) --- src/Propellor/Property.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Propellor/Property.hs') diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index e8d70a80..3ab66ca3 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -39,6 +39,18 @@ flagFile' p getflagfile = adjustPropertySatisfy p $ \satisfy -> do writeFile flagfile "" return r +-- | Indicates that the first property depends on the second, +-- so before the first is ensured, the second must be ensured. +requires :: Combines x y => x -> y -> CombinedType x y +requires = (<<>>) + +-- | Combines together two properties, resulting in one property +-- that ensures the first, and if the first succeeds, ensures the second. +-- +-- The combined property uses the description of the first property. +before :: (IsProp x, Combines y x, IsProp (CombinedType y x)) => x -> y -> CombinedType y x +before x y = (y `requires` x) `describe` getDesc x + -- | Whenever a change has to be made for a Property, causes a hook -- Property to also be run, but not otherwise. onChange -- cgit v1.3-2-g0d8e