summaryrefslogtreecommitdiff
path: root/src/Propellor/Types
diff options
context:
space:
mode:
authorJoey Hess2016-03-19 14:35:10 -0400
committerJoey Hess2016-03-19 14:35:10 -0400
commit368eaf569846199f4a68fe52d74ff50e19cc3820 (patch)
tree1ba0945375c9309a84b4f2eebb01778849cbc0d7 /src/Propellor/Types
parent345dbafc5131030fd56f2fb442bb89e56fb34dff (diff)
wip
Diffstat (limited to 'src/Propellor/Types')
-rw-r--r--src/Propellor/Types/Target.hs17
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
{-