From 42da8445470a6e4950873fc5d6bea88646ec2b63 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 26 Mar 2016 18:54:18 -0400 Subject: got rid of the undefined in privdata addInfoProperty' is like addInfoProperty but for when the input property is already known to HasInfo. --- src/Propellor/Types.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Propellor/Types.hs') diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index 4b3f665a..ccbfd3e0 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -25,6 +25,8 @@ module Propellor.Types , HasInfo , type (+) , addInfoProperty + , addInfoProperty' + , addChildrenProperty , adjustPropertySatisfy , propertyInfo , propertyDesc @@ -159,6 +161,19 @@ addInfoProperty addInfoProperty (Property _ d a oldi c) newi = Property sing d a (oldi <> newi) c +-- | Adds more info to a Property that already HasInfo. +addInfoProperty' + :: (IncludesInfo metatypes ~ 'True) + => Property metatypes + -> Info + -> Property metatypes +addInfoProperty' (Property t d a oldi c) newi = + Property t d a (oldi <> newi) c + +-- | Adds children to a Property. +addChildrenProperty :: Property metatypes -> [ChildProperty] -> Property metatypes +addChildrenProperty (Property t s a i cs) cs' = Property t s a i (cs ++ cs') + -- | Changes the action that is performed to satisfy a property. adjustPropertySatisfy :: Property metatypes -> (Propellor Result -> Propellor Result) -> Property metatypes adjustPropertySatisfy (Property t d s i c) f = Property t d (f s) i c -- cgit v1.2.3