summaryrefslogtreecommitdiff
path: root/src/Propellor/Types
diff options
context:
space:
mode:
authorJoey Hess2016-03-19 08:49:10 -0400
committerJoey Hess2016-03-19 08:49:10 -0400
commitae84f01f6df1ffe3e2de747132eb8e092582d0f0 (patch)
tree8f16493cab3cd995ae3ef7b9beef9e1faf14590b /src/Propellor/Types
parente64ef009d9ee5d21acb1e7de2ee03a23c4ff2c27 (diff)
fix type error
Diffstat (limited to 'src/Propellor/Types')
-rw-r--r--src/Propellor/Types/Target.hs11
1 files changed, 6 insertions, 5 deletions
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
{-