From 368eaf569846199f4a68fe52d74ff50e19cc3820 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 19 Mar 2016 14:35:10 -0400 Subject: wip --- src/Propellor/Types/Target.hs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/Propellor/Types') diff --git a/src/Propellor/Types/Target.hs b/src/Propellor/Types/Target.hs index dd098c3b..549cf99b 100644 --- a/src/Propellor/Types/Target.hs +++ b/src/Propellor/Types/Target.hs @@ -146,18 +146,17 @@ type family CannotUseEnsurePropertyWithInfo (l :: [a]) :: Bool type instance CannotUseEnsurePropertyWithInfo '[] = 'True type instance CannotUseEnsurePropertyWithInfo (t ': ts) = Not (t `EqT` WithInfo) && CannotUseEnsurePropertyWithInfo ts -{- - -- | Changes the target of a property. -- -- This can only tighten the target list to contain fewer targets. target - :: (combinedtarget ~ IntersectTarget oldtarget newtarget, CannotCombineTargets oldtarget newtarget combinedtarget ~ CanCombineTargets) + :: (combined ~ IntersectTarget old new, CannotCombineTargets old new combined ~ CanCombineTargets) => Targeting newtarget - -> Property (Targeting oldtarget) - -> Property (Targeting combinedtarget) -target newtarget (Property oldtarget a) = - Property (intersectTarget oldtarget newtarget) a + -> Property (WithTypes old) + -> Property (WithTypes new) +target newtarget (Property old a) = Property (intersectTarget old new) a + +{- -- | Picks one of the two input properties to use, -- depending on the targeted OS. @@ -183,6 +182,8 @@ unionTargets unionTargets (Targeting l1) (Targeting l2) = Targeting $ nub $ l1 ++ l2 +-} + -- | The intersection between two lists of Targets. intersectTarget :: (r ~ IntersectTarget l1 l2, CannotCombineTargets l1 l2 r ~ CanCombineTargets) @@ -192,8 +193,6 @@ intersectTarget intersectTarget (Targeting l1) (Targeting l2) = Targeting $ nub $ filter (`elem` l2) l1 --} - data CheckCombine = CannotCombine | CanCombine {- -- cgit v1.2.3