summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/List.hs
diff options
context:
space:
mode:
authorJoey Hess2016-02-08 11:18:17 -0400
committerJoey Hess2016-02-08 11:18:17 -0400
commitb33807cec25f232d5bd43fea6e954d596acbad24 (patch)
treeab07223b2a7e2ffde115464ccbd73e904ddd5968 /src/Propellor/Property/List.hs
parentb493414d30c7aef37af904e55316436554fe54b2 (diff)
Allow using combineProperties and propertyList with lists of RevertableProperty.
Diffstat (limited to 'src/Propellor/Property/List.hs')
-rw-r--r--src/Propellor/Property/List.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Propellor/Property/List.hs b/src/Propellor/Property/List.hs
index 86fdfbf1..74aa6ca6 100644
--- a/src/Propellor/Property/List.hs
+++ b/src/Propellor/Property/List.hs
@@ -50,6 +50,8 @@ class PropertyList l where
type family PropertyListType t
type instance PropertyListType [Property HasInfo] = HasInfo
type instance PropertyListType [Property NoInfo] = NoInfo
+type instance PropertyListType [RevertableProperty NoInfo] = NoInfo
+type instance PropertyListType [RevertableProperty HasInfo] = HasInfo
type instance PropertyListType PropList = HasInfo
instance PropertyList [Property NoInfo] where
@@ -63,6 +65,14 @@ instance PropertyList [Property HasInfo] where
propertyList desc ps = infoProperty desc (ensureProperties $ map ignoreInfo ps) mempty ps
combineProperties desc ps = infoProperty desc (combineSatisfy ps NoChange) mempty ps
+instance PropertyList [RevertableProperty HasInfo] where
+ propertyList desc ps = propertyList desc (map setupRevertableProperty ps)
+ combineProperties desc ps = combineProperties desc (map setupRevertableProperty ps)
+
+instance PropertyList [RevertableProperty NoInfo] where
+ propertyList desc ps = propertyList desc (map setupRevertableProperty ps)
+ combineProperties desc ps = combineProperties desc (map setupRevertableProperty ps)
+
instance PropertyList PropList where
propertyList desc = propertyList desc . getProperties
combineProperties desc = combineProperties desc . getProperties