summaryrefslogtreecommitdiff
path: root/src/Propellor/PropAccum.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-25 14:24:09 -0400
committerJoey Hess2016-03-25 14:24:09 -0400
commit9768434f5fa2f2ed0bbb0212763a76471186a3cd (patch)
treec5c13b99ef9cb38351a0a0c8ab25280ff3a155f9 /src/Propellor/PropAccum.hs
parent91d1833155a2e8be2c435d0a92a750cc9d2f30b5 (diff)
finished porting Property.User
Diffstat (limited to 'src/Propellor/PropAccum.hs')
-rw-r--r--src/Propellor/PropAccum.hs14
1 files changed, 7 insertions, 7 deletions
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)])
{-