From 5b517effceed913b3fcc0e6b43ee2cbc614f7b63 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 Mar 2016 12:09:40 -0400 Subject: fix tightenTargets --- src/Propellor/Types/Target.hs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Types/Target.hs b/src/Propellor/Types/Target.hs index 3b21d1f8..1c0f79ee 100644 --- a/src/Propellor/Types/Target.hs +++ b/src/Propellor/Types/Target.hs @@ -135,9 +135,10 @@ outerPropTypes (Property proptypes _) = OuterPropTypes proptypes -- with HasInfo in its PropTypes. Doing so would cause the info associated -- with the property to be lost. ensureProperty - :: ((Targets inner `NotSuperset` Targets outer) ~ CanCombineTargets - , CannotUseEnsurePropertyWithInfo inner ~ True - ) + :: + ( (Targets inner `NotSuperset` Targets outer) ~ CanCombineTargets + , CannotUseEnsurePropertyWithInfo inner ~ True + ) => OuterPropTypes outer -> Property (WithTypes inner) -> IO () @@ -152,10 +153,12 @@ type instance CannotUseEnsurePropertyWithInfo (t ': ts) = Not (t `EqT` WithInfo) -- -- Anything else in the PropType list is passed through unchanged. tightenTargets - :: ( combined ~ Concat (NonTargets old) (Intersect (Targets old) newtargets) - , CannotCombineTargets old new combined ~ CanCombineTargets - ) - => Targeting newtargets + :: + ( combined ~ Concat (NonTargets old) (Intersect (Targets old) (Targets new)) + , CannotCombineTargets old new combined ~ CanCombineTargets + , Sing combined + ) + => WithTypes new -> Property (WithTypes old) -> Property (WithTypes combined) tightenTargets _ (Property old a) = Property sing a -- cgit v1.2.3