path: root/src
diff options
authorJoey Hess2019-07-02 12:13:44 -0400
committerJoey Hess2019-07-02 12:56:52 -0400
commit89fac12e48547e2dad5413a750469df05e258806 (patch)
tree02c2fc99704a080ab2abd32aea94c86269c87499 /src
parent8dfae9858f6fce6791e8111cb5ad72162eff7177 (diff)
better explain Property <unknown>
I had thought it could happen when passing the wrong type to a Property constructor, but happily that is not the case. For example & osDebian Unstable False Still produces a good error: • Couldn't match expected type ‘Architecture’ with actual type ‘Bool’ So Property <unknown> only happens when too many or too few parameters are passed, eg: & osDebian Unstable X86_64 False & osDebian Unstable Before commit 14f6ae30809d8bbdb10b91cc59757e865a365df8, the former of those resulted in: • Couldn't match expected type ‘[Char] -> p0’ with actual type ‘Property (HasInfo + Debian)’ • The function ‘osDebian’ is applied to three arguments, but its type ‘DebianSuite -> Architecture -> Property (HasInfo + Debian)’ has only two Unfortunately, it's now just Property <unknown>. This is the only reversion I've identified from commit 14f6ae30809d8bbdb10b91cc59757e865a365df8. My ghc bug isn't quite explaining this problem yet, and I need to find a minimal case of it. As to the latter with too few parameters, it used to result in a massive ugly useless error. Now it is also Property <unknown>, which is an improvement.
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Propellor/Types/MetaTypes.hs b/src/Propellor/Types/MetaTypes.hs
index 23c8e9d8..a7037a6a 100644
--- a/src/Propellor/Types/MetaTypes.hs
+++ b/src/Propellor/Types/MetaTypes.hs
@@ -185,7 +185,7 @@ type family UnknownType :: ErrorMessage where
UnknownType = 'Text "<unknown>"
type family UnknownTypeNote :: Maybe ErrorMessage where
- UnknownTypeNote = 'Just ('Text "(Property <unknown> is often due to a partially applied Property constructor, or due to passing the wrong type to a Property constructor.)")
+ UnknownTypeNote = 'Just ('Text "(Property <unknown> is often caused by a Property constructor being passed the wrong number of parameters.)")
type family CannotCombineMessage (a :: ErrorMessage) (b :: ErrorMessage) (note :: Maybe ErrorMessage) :: ErrorMessage where
CannotCombineMessage a b ('Just note) =