summaryrefslogtreecommitdiff
path: root/src/Propellor/PropAccum.hs
diff options
context:
space:
mode:
authorJoey Hess2019-07-02 00:45:57 -0400
committerJoey Hess2019-07-02 00:45:57 -0400
commit7ac0fbfa247ca153a6187c47dde9fc3a94c9cdb5 (patch)
treecc69e43ade9ca443d9161c764e640a2b8e9cb30f /src/Propellor/PropAccum.hs
parentd8ba8acbc58498641b729d7068d9e0b6c93c890b (diff)
parent9241f54cf269e7ce3c9897ff66a9bfa2eb1ab64b (diff)
Merge branch 'joeyconfig' into custom-error-types
Diffstat (limited to 'src/Propellor/PropAccum.hs')
-rw-r--r--src/Propellor/PropAccum.hs17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs
index 3fc83202..c60ced73 100644
--- a/src/Propellor/PropAccum.hs
+++ b/src/Propellor/PropAccum.hs
@@ -19,7 +19,6 @@ import Propellor.Types.MetaTypes
import Propellor.Types.Core
import Propellor.Property
-import GHC.TypeLits
import Data.Monoid
import Prelude
@@ -46,16 +45,6 @@ type family GetMetaTypes x where
GetMetaTypes (Property (MetaTypes t)) = MetaTypes t
GetMetaTypes (RevertableProperty (MetaTypes t) undo) = MetaTypes t
--- When many properties are combined, ghc error message
--- can include quite a lot of code, typically starting with
--- `props and including all the properties up to and including the
--- one that fails to combine. Point the user in the right direction.
-type family NoteFor symbol :: ErrorMessage where
- NoteFor symbol =
- 'Text "Probably the problem is with the last property added with "
- ':<>: symbol
- ':<>: 'Text " in the code excerpt below."
-
-- | Adds a property to a Props.
--
-- Can add Properties and RevertableProperties
@@ -66,7 +55,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
+ , CheckCombinable x y ~ 'CanCombine
)
=> Props (MetaTypes x)
-> p
@@ -81,7 +70,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
+ , CheckCombinable x y ~ 'CanCombine
)
=> Props (MetaTypes x)
-> p
@@ -93,7 +82,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)
+ :: (CheckCombinable x z ~ 'CanCombine)
=> Props (MetaTypes x)
-> RevertableProperty (MetaTypes y) (MetaTypes z)
-> Props (MetaTypes (Combine x z))