diff options
| author | Joey Hess <joey@kitenet.net> | 2014-03-30 16:11:00 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-03-30 16:11:00 -0400 |
| commit | afb7afee0ce011754e60f313b6929d1eadfcc701 (patch) | |
| tree | fd2a50f5069fd0e0449fb68e769b0db184a6f3a5 /Property.hs | |
| parent | 4d33b25ba37d7dd91ffeb44b185d24d09f3c1320 (diff) | |
more description improvements
Diffstat (limited to 'Property.hs')
| -rw-r--r-- | Property.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Property.hs b/Property.hs index 84a57a1b..77a1f502 100644 --- a/Property.hs +++ b/Property.hs @@ -43,8 +43,8 @@ propertyList desc ps = Property desc $ ensureProperties' ps {- Combines a list of properties, resulting in one property that - ensures each in turn, stopping on failure. -} -combineProperties :: Desc -> [Property] -> Property -combineProperties desc ps = Property desc $ go ps NoChange +combineProperties :: [Property] -> Property +combineProperties ps = Property desc $ go ps NoChange where go [] rs = return rs go (l:ls) rs = do @@ -52,6 +52,9 @@ combineProperties desc ps = Property desc $ go ps NoChange case r of FailedChange -> return FailedChange _ -> go ls (combineResult r rs) + desc = case ps of + (p:_) -> propertyDesc p + _ -> "(empty)" {- Makes a perhaps non-idempotent Property be idempotent by using a flag - file to indicate whether it has run before. @@ -81,7 +84,7 @@ property `onChange` hook = Property (propertyDesc property) $ do {- Indicates that the first property can only be satisfied once - the second is. -} requires :: Property -> Property -> Property -x `requires` y = combineProperties (propertyDesc x) [y, x] +x `requires` y = combineProperties [y, x] `describe` propertyDesc x describe :: Property -> Desc -> Property describe p d = p { propertyDesc = d } |
