From 413c74cdd336eeae59aea9660e6fc7331d599a1b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 24 Mar 2016 15:21:48 -0400 Subject: simplify --- src/Propellor/Types.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/Propellor/Types.hs') diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index 6c1412c1..25269969 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -30,6 +30,7 @@ module Propellor.Types , propertyDesc , propertyChildren , RevertableProperty(..) + , ChildProperty , IsProp(..) , Combines(..) , CombinedType @@ -230,17 +231,14 @@ instance IsProp ChildProperty where i <> mconcat (map getInfoRecursive c) instance IsProp (RevertableProperty setupmetatypes undometatypes) where - setDesc = setDescR + -- | Sets the description of both sides. + 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. getInfoRecursive (RevertableProperty p1 _p2) = getInfoRecursive p1 --- | Sets the description of both sides. -setDescR :: IsProp (Property setupmetatypes) => RevertableProperty setupmetatypes undometatypes -> Desc -> RevertableProperty setupmetatypes undometatypes -setDescR (RevertableProperty p1 p2) d = - RevertableProperty (setDesc p1 d) (setDesc p2 ("not " ++ d)) - -- | Type level calculation of the type that results from combining two -- types of properties. type family CombinedType x y -- cgit v1.2.3