From ae84f01f6df1ffe3e2de747132eb8e092582d0f0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 19 Mar 2016 08:49:10 -0400 Subject: fix type error --- src/Propellor/Types/Target.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Propellor/Types/Target.hs b/src/Propellor/Types/Target.hs index 42cdb26a..1ffd53e2 100644 --- a/src/Propellor/Types/Target.hs +++ b/src/Propellor/Types/Target.hs @@ -142,15 +142,16 @@ 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) ~ CanCombine, NoInfo inner ~ True) + :: ((Targets inner `NotSuperset` Targets outer) ~ CanCombine, CannotUseEnsurePropertyWithInfo inner ~ True) => OuterPropTypes outer -> Property (WithTypes inner) -> IO () ensureProperty (OuterPropTypes outerproptypes) (Property innerproptypes a) = a -type family NoInfo (l :: [a]) :: Bool -type instance NoInfo '[] = 'True -type instance NoInfo (t ': ts) = Not (t `EqT` WithInfo) && NoInfo ts +-- The name of this was chosen to make type errors a more understandable. +type family CannotUseEnsurePropertyWithInfo (l :: [a]) :: Bool +type instance CannotUseEnsurePropertyWithInfo '[] = 'True +type instance CannotUseEnsurePropertyWithInfo (t ': ts) = Not (t `EqT` WithInfo) && CannotUseEnsurePropertyWithInfo ts {- @@ -232,7 +233,7 @@ type instance Targets (x ': xs) = type family IsTarget (a :: t) :: Bool type instance IsTarget (Targeting a) = True -type instance IsTarget HasInfo = False +type instance IsTarget WithInfo = False {- -- cgit v1.2.3