summaryrefslogtreecommitdiff
path: root/src/Propellor/Types.hs
diff options
context:
space:
mode:
authorJoey Hess2015-01-25 14:45:14 -0400
committerJoey Hess2015-01-25 14:47:57 -0400
commite9d5d9aff1cc2046149d3e5dcd9f4ef0f2a334a1 (patch)
tree24b5bc62ac3851c317023d79080eb0ed8176cdba /src/Propellor/Types.hs
parent334abae31277b9f47b85813d7b2fd783e5b3b12d (diff)
remove toSimpleProp
It didn't do what I thought it did with a RevertableProperty; it always returned Nothing because even if the input properties to <!> are NoInfo, it casts them to HasInfo. Even if it had worked, it lost type safety. Better to export the Property NoInfo that is used in a RevertableProperty, so it can be used directly.
Diffstat (limited to 'src/Propellor/Types.hs')
-rw-r--r--src/Propellor/Types.hs4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs
index 9a0e22ab..ba63cf9d 100644
--- a/src/Propellor/Types.hs
+++ b/src/Propellor/Types.hs
@@ -179,7 +179,6 @@ class IsProp p where
-- | Sets description.
describe :: p -> Desc -> p
toProp :: p -> Property HasInfo
- toSimpleProp :: p -> Maybe (Property NoInfo)
getDesc :: p -> Desc
-- | Gets the info of the property, combined with all info
-- of all children properties.
@@ -188,7 +187,6 @@ class IsProp p where
instance IsProp (Property HasInfo) where
describe (IProperty _ a i cs) d = IProperty d a i cs
toProp = id
- toSimpleProp _ = Nothing
getDesc = propertyDesc
getInfoRecursive (IProperty _ _ i cs) =
i <> mconcat (map getInfoRecursive cs)
@@ -196,7 +194,6 @@ instance IsProp (Property NoInfo) where
describe (SProperty _ a cs) d = SProperty d a cs
toProp = toIProperty
getDesc = propertyDesc
- toSimpleProp = Just
getInfoRecursive _ = mempty
instance IsProp RevertableProperty where
@@ -205,7 +202,6 @@ instance IsProp RevertableProperty where
RevertableProperty (describe p1 d) (describe p2 ("not " ++ d))
getDesc (RevertableProperty p1 _) = getDesc p1
toProp (RevertableProperty p1 _) = p1
- toSimpleProp = toSimpleProp . toProp
-- | Return the Info of the currently active side.
getInfoRecursive (RevertableProperty p1 _p2) = getInfoRecursive p1