summaryrefslogtreecommitdiff
path: root/src/Propellor/Types.hs
diff options
context:
space:
mode:
authorJoey Hess2015-10-10 14:56:22 -0400
committerJoey Hess2015-10-10 15:05:05 -0400
commitae380f085bc867f7405ef0a16c849864c6552e47 (patch)
tree22bd030a05f85bfeff90eaa48a87915edf9cdf27 /src/Propellor/Types.hs
parent28fe270223ed56ef8e7fd867573b5ba6a5a221c7 (diff)
tighten focus of Propellor module, adding Propellor.Base for all the exports
Diffstat (limited to 'src/Propellor/Types.hs')
-rw-r--r--src/Propellor/Types.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs
index 0dfafbe8..fc700df0 100644
--- a/src/Propellor/Types.hs
+++ b/src/Propellor/Types.hs
@@ -177,9 +177,9 @@ data RevertableProperty = RevertableProperty (Property HasInfo) (Property HasInf
(<!>) :: Property i1 -> Property i2 -> RevertableProperty
p1 <!> p2 = RevertableProperty (toIProperty p1) (toIProperty p2)
+-- | Class of types that can be used as properties of a host.
class IsProp p where
- -- | Sets description.
- describe :: p -> Desc -> p
+ setDesc :: p -> Desc -> p
toProp :: p -> Property HasInfo
getDesc :: p -> Desc
-- | Gets the info of the property, combined with all info
@@ -187,21 +187,21 @@ class IsProp p where
getInfoRecursive :: p -> Info
instance IsProp (Property HasInfo) where
- describe (IProperty _ a i cs) d = IProperty d a i cs
+ setDesc (IProperty _ a i cs) d = IProperty d a i cs
toProp = id
getDesc = propertyDesc
getInfoRecursive (IProperty _ _ i cs) =
i <> mconcat (map getInfoRecursive cs)
instance IsProp (Property NoInfo) where
- describe (SProperty _ a cs) d = SProperty d a cs
+ setDesc (SProperty _ a cs) d = SProperty d a cs
toProp = toIProperty
getDesc = propertyDesc
getInfoRecursive _ = mempty
instance IsProp RevertableProperty where
-- | Sets the description of both sides.
- describe (RevertableProperty p1 p2) d =
- RevertableProperty (describe p1 d) (describe p2 ("not " ++ d))
+ setDesc (RevertableProperty p1 p2) d =
+ RevertableProperty (setDesc p1 d) (setDesc p2 ("not " ++ d))
getDesc (RevertableProperty p1 _) = getDesc p1
toProp (RevertableProperty p1 _) = p1
-- | Return the Info of the currently active side.