Commit 65785a09 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-07-11 10:47:20 by simonpj]

Wibbles to unifyFunTy error messages
parent 1360bef3
......@@ -647,7 +647,7 @@ pprMatch :: OutputableBndr id => HsMatchContext id -> Match id -> SDoc
pprMatch ctxt (Match pats maybe_ty grhss)
= pp_name ctxt <+> sep [sep (map ppr pats),
ppr_maybe_ty,
nest 2 (pprDeeper (pprGRHSs ctxt grhss))]
nest 2 (pprGRHSs ctxt grhss)]
where
pp_name (FunRhs fun) = ppr fun -- Not pprBndr; the AbsBinds will
-- have printed the signature
......
......@@ -185,11 +185,11 @@ subFunTys ctxt group@(MatchGroup (match:matches) _) (Check ty) thing_inside
n_pats = length (hsLMatchPats match)
msg = case ctxt of
FunRhs fun -> ptext SLIT("The equation(s) for") <+> quotes (ppr fun)
<+> ptext SLIT("have") <+> speakN n_pats <+> ptext SLIT("arguments")
<+> ptext SLIT("have") <+> speakNOf n_pats (ptext SLIT("argument"))
LambdaExpr -> sep [ ptext SLIT("The lambda expression")
<+> quotes (pprSetDepth 1 $ pprMatches ctxt group),
-- The pprSetDepth makes the abstraction print briefly
ptext SLIT("has") <+> speakN n_pats <+> ptext SLIT("arguments")]
ptext SLIT("has") <+> speakNOf n_pats (ptext SLIT("arguments"))]
other -> pprPanic "subFunTys" (pprMatchContext ctxt)
......@@ -232,7 +232,8 @@ unifyFunTys error_herald arity ty
mk_msg n_actual
= error_herald <> comma $$
sep [ptext SLIT("but its type") <+> quotes (pprType ty),
ptext SLIT("has only") <+> speakN n_actual]
if n_actual == 0 then ptext SLIT("has none")
else ptext SLIT("has only") <+> speakN n_actual]
unify_fun_ty :: Bool -> Arity -> TcRhoType
-> TcM (Bool, -- Arity satisfied?
......
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