summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2019-07-01 15:49:20 -0400
committerJoey Hess2019-07-01 16:20:51 -0400
commit14f6ae30809d8bbdb10b91cc59757e865a365df8 (patch)
treebe688e4685f05d6426cf30b0e0eff5a25cf003ee /src/Propellor/Property
parent70e71629b370349914e9fc89956a6756783296b0 (diff)
custom type error messages
* Avoid displaying an excessive amount of type error messages when many properties have been combined in a props list. * Added custom type error messages when Properties don't combine due to conflicting metatypes. * Added custom type error messages for ensureProperty and tightenTargets. * ensureProperty: The constraints have been simplified to EnsurePropertyAllowed. (API change) * ensureProperty: The contraints have been simplified to TightenTargetsAllowed. (API change) * CheckCombinable generates a Bool. (API change) This commit was sponsored by Jake Vosloo on Patreon.
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/Atomic.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Propellor/Property/Atomic.hs b/src/Propellor/Property/Atomic.hs
index 8519048b..2c7433f6 100644
--- a/src/Propellor/Property/Atomic.hs
+++ b/src/Propellor/Property/Atomic.hs
@@ -46,10 +46,8 @@ type CheckAtomicResourcePair a = AtomicResourcePair a -> Propellor (AtomicResour
-- inactiveAtomicResource, and if it was successful,
-- atomically activating that resource.
atomicUpdate
- -- Constriaints inherited from ensureProperty.
- :: ( Cannot_ensureProperty_WithInfo t ~ 'True
- , (Targets t `NotSuperset` Targets t) ~ 'CanCombine
- )
+ -- Constriaint inherited from ensureProperty.
+ :: (EnsurePropertyAllowed t t ~ 'True)
=> SingI t
=> AtomicResourcePair a
-> CheckAtomicResourcePair a
@@ -92,10 +90,8 @@ atomicUpdate rbase rcheck rswap mkp = property' d $ \w -> do
-- children: a symlink with the name of the directory itself, and two copies
-- of the directory, with names suffixed with ".1" and ".2"
atomicDirUpdate
- -- Constriaints inherited from ensureProperty.
- :: ( Cannot_ensureProperty_WithInfo t ~ 'True
- , (Targets t `NotSuperset` Targets t) ~ 'CanCombine
- )
+ -- Constriaint inherited from ensureProperty.
+ :: (EnsurePropertyAllowed t t ~ 'True)
=> SingI t
=> FilePath
-> (FilePath -> Property (MetaTypes t))