From 9768434f5fa2f2ed0bbb0212763a76471186a3cd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Mar 2016 14:24:09 -0400 Subject: finished porting Property.User --- src/Propellor/PropAccum.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Propellor/PropAccum.hs') diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs index 8177b97b..91d7b80d 100644 --- a/src/Propellor/PropAccum.hs +++ b/src/Propellor/PropAccum.hs @@ -30,17 +30,17 @@ import Propellor.PrivData -- > ! oldproperty -- > & otherproperty host :: HostName -> Props metatypes -> Host -host hn (Props i c) = Host hn c i +host hn (Props c) = Host hn c (mconcat (map getInfoRecursive c)) -- | Props is a combination of a list of properties, with their combined --- metatypes and info. -data Props metatypes = Props Info [ChildProperty] +-- metatypes. +data Props metatypes = Props [ChildProperty] -- | Start accumulating a list of properties. -- -- Properties can be added to it using `(&)` etc. props :: Props UnixLike -props = Props mempty [] +props = Props [] infixl 1 & infixl 1 &^ @@ -62,7 +62,7 @@ type instance GetMetaTypes (RevertableProperty (MetaTypes t) undo) = MetaTypes t => Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y)) -Props i c & p = Props (i <> getInfoRecursive p) (c ++ [toProp p]) +Props c & p = Props (c ++ [toProp p]) -- | Adds a property before any other properties. (&^) @@ -74,7 +74,7 @@ Props i c & p = Props (i <> getInfoRecursive p) (c ++ [toProp p]) => Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y)) -Props i c &^ p = Props (i <> getInfoRecursive p) (toProp p : c) +Props c &^ p = Props (toProp p : c) -- | Adds a property in reverted form. (!) @@ -82,7 +82,7 @@ Props i c &^ p = Props (i <> getInfoRecursive p) (toProp p : c) => Props (MetaTypes x) -> RevertableProperty (MetaTypes y) (MetaTypes z) -> Props (MetaTypes (Combine x z)) -Props i c ! p = Props (i <> getInfoRecursive p) (c ++ [toProp (revert p)]) +Props c ! p = Props (c ++ [toProp (revert p)]) {- -- cgit v1.2.3