From 1c12b89a671152d7da4630b41b48815eefc8c2fe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 2 Jul 2019 14:39:51 -0400 Subject: use ConstraintKinds This is just a bit prettier code than manually needing to use constraint ~ True --- src/Propellor/PropAccum.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Propellor/PropAccum.hs') diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs index 3fc83202..ea85f04f 100644 --- a/src/Propellor/PropAccum.hs +++ b/src/Propellor/PropAccum.hs @@ -66,7 +66,7 @@ type family NoteFor symbol :: ErrorMessage where -- this constraint appears redundant, but is actually -- crucial. , MetaTypes y ~ GetMetaTypes p - , CheckCombinableNote x y (NoteFor ('Text "&")) ~ 'True + , CheckCombinableNote x y (NoteFor ('Text "&")) ) => Props (MetaTypes x) -> p @@ -81,7 +81,7 @@ Props c & p = Props (c ++ [toChildProperty p]) -- this constraint appears redundant, but is actually -- crucial. , MetaTypes y ~ GetMetaTypes p - , CheckCombinableNote x y (NoteFor ('Text "&^")) ~ 'True + , CheckCombinableNote x y (NoteFor ('Text "&^")) ) => Props (MetaTypes x) -> p @@ -93,7 +93,7 @@ Props c &^ p = Props (toChildProperty p : c) -- -Wredundant-constraints is turned off because -- this constraint appears redundant, but is actually -- crucial. - :: (CheckCombinableNote x z (NoteFor ('Text "!")) ~ 'True) + :: CheckCombinableNote x z (NoteFor ('Text "!")) => Props (MetaTypes x) -> RevertableProperty (MetaTypes y) (MetaTypes z) -> Props (MetaTypes (Combine x z)) -- cgit v1.2.3