From 414ee7eee60300eb7f7c49e4890b056d19b3c59b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Jan 2015 13:59:29 -0400 Subject: added GADT to determine between a property with info and without Not yet used --- src/Propellor/PropAccum.hs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/Propellor/PropAccum.hs') diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs index beca8ccc..ddbc1e66 100644 --- a/src/Propellor/PropAccum.hs +++ b/src/Propellor/PropAccum.hs @@ -58,17 +58,18 @@ infixl 1 ! -- PrivData Info is propigated, so that properties used inside a -- PropAccum will have the necessary PrivData available. propigateContainer :: PropAccum container => container -> Property -> Property -propigateContainer c prop = prop - { propertyChildren = propertyChildren prop ++ hostprops - } +propigateContainer c prop = mkProperty + (propertyDesc prop) + (propertySatisfy prop) + (propertyInfo prop) + (propertyChildren prop ++ hostprops) where hostprops = map go $ getProperties c go p = let i = propertyInfo p - in p - { propertyInfo = mempty - { _dns = _dns i - , _privData = _privData i - } - , propertyChildren = map go (propertyChildren p) + i' = mempty + { _dns = _dns i + , _privData = _privData i } + cs = map go (propertyChildren p) + in mkProperty (propertyDesc p) (propertySatisfy p) i' cs -- cgit v1.2.3