Commit a2abcf6e authored by Simon Peyton Jones's avatar Simon Peyton Jones

Minor improvement to error message

"One fewer arguments to ..." rather than
"One fewer argument to ..."
parent af6dced9
......@@ -1695,23 +1695,20 @@ mkExpectedActualMsg ty1 ty2 (TypeEqOrigin { uo_actual = act
Just num_act_args -> num_act_args >= -n
-- don't report to strip off args that aren't there
-> Just $ text "Expecting" <+> speakN (abs n) <+>
more_or_fewer <+> plural_n (abs n) (text "argument")
<+> text "to" <+> quotes (ppr thing)
more_or_fewer <+> quotes (ppr thing)
where
more_or_fewer | n < 0 = text "fewer"
| otherwise = text "more"
more_or_fewer
| n < 0 = text "fewer arguments to"
| n == 1 = text "more argument to"
| otherwise = text "more arguments to" -- n > 1
_ -> Nothing
maybe_num_args_msg = case num_args_msg of
Nothing -> empty
Just m -> m
count_args ty = count isVisibleBinder $ fst $ splitPiTys ty
plural_n 1 doc = doc
plural_n _ doc = doc <> char 's'
expandedTys =
ppUnless (expTy1 `pickyEqType` exp && expTy2 `pickyEqType` act) $ vcat
[ text "Type synonyms expanded:"
......
drvfail005.hs:4:13: error:
• Expecting one fewer argument to ‘Show a’
• Expecting one fewer arguments to ‘Show a’
Expected kind ‘k0 -> Constraint’,
but ‘Show a’ has kind ‘Constraint’
• In the data declaration for ‘Test’
T6039.hs:5:14: error:
• Expecting one fewer argument to ‘j’
• Expecting one fewer arguments to ‘j’
Expected kind ‘* -> *’, but ‘j’ has kind ‘*’
• In the kind ‘j k’
T3177a.hs:8:8: error:
• Expecting one fewer argument to ‘Int’
• Expecting one fewer arguments to ‘Int’
Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
• In the type signature:
f :: Int Int
T3177a.hs:11:6: error:
• Expecting one fewer argument to ‘Int’
• Expecting one fewer arguments to ‘Int’
Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
• In the type signature:
g :: Int Int
T11356.hs:3:7: error:
• Expecting one fewer argument to ‘T p’
• Expecting one fewer arguments to ‘T p’
Expected kind ‘k0 -> Constraint’, but ‘T p’ has kind ‘Constraint’
• In the class declaration for ‘C’
......@@ -18,7 +18,7 @@ T2994.hs:13:23: error:
In the instance declaration for ‘MonadReader (Reader' r)’
T2994.hs:15:10: error:
• Expecting one fewer argument to ‘MonadReader r r’
• Expecting one fewer arguments to ‘MonadReader r r’
Expected kind ‘(* -> *) -> Constraint’,
but ‘MonadReader r r’ has kind ‘Constraint’
• In the instance declaration for ‘MonadReader r r (Reader' r)’
T4875.hs:27:24: error:
• Expecting one fewer argument to ‘r’
• Expecting one fewer arguments to ‘r’
Expected kind ‘* -> *’, but ‘r’ has kind ‘*’
• In the type signature:
multiplicities :: r c -> [c]
......
T7778.hs:3:7: error:
• Expecting one fewer argument to ‘Num Int => Num’
• Expecting one fewer arguments to ‘Num Int => Num’
Expected kind ‘* -> Constraint’, but ‘Num Int => Num’ has kind ‘*’
• In the type signature:
v :: ((Num Int => Num) ()) => ()
......
tcfail070.hs:15:15:
Expecting one fewer argument to ‘[Int]’
Expected kind ‘* -> k0’, but ‘[Int]’ has kind ‘*’
In the type ‘[Int] Bool’
In the type declaration for ‘State’
tcfail070.hs:15:15: error:
• Expecting one fewer arguments to ‘[Int]’
Expected kind ‘* -> k0’, but ‘[Int]’ has kind ‘*’
In the type ‘[Int] Bool’
In the type declaration for ‘State’
tcfail078.hs:5:6: error:
• Expecting one fewer argument to ‘Integer’
• Expecting one fewer arguments to ‘Integer’
Expected kind ‘* -> Constraint’, but ‘Integer’ has kind ‘*’
• In the type signature:
f :: Integer i => i
......@@ -12,7 +12,7 @@ tcfail113.hs:15:8: error:
g :: T Int
tcfail113.hs:18:6: error:
• Expecting one fewer argument to ‘Int’
• Expecting one fewer arguments to ‘Int’
Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
• In the type signature:
h :: Int Int
tcfail132.hs:17:37: error:
Expecting one fewer argument to ‘Object f' f t’
Expected kind ‘* -> * -> * -> *’,
but ‘Object f' f t’ has kind ‘* -> * -> *’
In the first argument of ‘T’, namely ‘Object f' f t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
• Expecting one fewer arguments to ‘Object f' f t’
Expected kind ‘* -> * -> * -> *’,
but ‘Object f' f t’ has kind ‘* -> * -> *’
In the first argument of ‘T’, namely ‘Object f' f t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
tcfail132.hs:17:53: error:
Expected kind ‘* -> * -> * -> *’,
but ‘DUnit t’ has kind ‘* -> * -> *’
In the second argument of ‘T’, namely ‘DUnit t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
Expected kind ‘* -> * -> * -> *’,
but ‘DUnit t’ has kind ‘* -> * -> *’
In the second argument of ‘T’, namely ‘DUnit t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment