diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-19 14:35:10 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-19 14:35:10 -0400 |
| commit | 368eaf569846199f4a68fe52d74ff50e19cc3820 (patch) | |
| tree | 1ba0945375c9309a84b4f2eebb01778849cbc0d7 /src | |
| parent | 345dbafc5131030fd56f2fb442bb89e56fb34dff (diff) | |
wip
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Types/Target.hs | 17 |
1 files changed, 8 insertions, 9 deletions
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 {- |
