diff options
author | simonpj <unknown> | 2005-07-11 09:54:44 +0000 |
---|---|---|
committer | simonpj <unknown> | 2005-07-11 09:54:44 +0000 |
commit | 9fe510d19e48f1cefdf3591c8669cd74a63867b7 (patch) | |
tree | 900695f6c1198f275d432adc42fbd322f36bcb63 /ghc/compiler/hsSyn/HsExpr.lhs | |
parent | a6f3a1f8f6e28289b5986637f47bd08e1381675e (diff) | |
download | haskell-9fe510d19e48f1cefdf3591c8669cd74a63867b7.tar.gz |
[project @ 2005-07-11 09:54:43 by simonpj]
Improve the error message from unifyFunTys. Previously we got a really
horrible message from this:
t = ((\Just x -> x) :: Maybe a -> a) (Just 1)
Try.hs:1:6:
Couldn't match the rigid variable `a' against `t -> t1'
Expected type: a
Inferred type: t -> t1
Now it's much better:
Try.hs:14:6:
The lambda expression `\ Just x -> ...' has two arguments,
but its type `Maybe a -> a' has only one
In the expression: (\ Just x -> x) :: Maybe a -> a
tcfail140 tests some cases
Diffstat (limited to 'ghc/compiler/hsSyn/HsExpr.lhs')
-rw-r--r-- | ghc/compiler/hsSyn/HsExpr.lhs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ghc/compiler/hsSyn/HsExpr.lhs b/ghc/compiler/hsSyn/HsExpr.lhs index 3f061964e6..2f4ab1b9b6 100644 --- a/ghc/compiler/hsSyn/HsExpr.lhs +++ b/ghc/compiler/hsSyn/HsExpr.lhs @@ -319,7 +319,7 @@ ppr_expr (SectionL expr op) pp_prefixly = hang (hsep [text " \\ x_ ->", ppr op]) 4 (hsep [pp_expr, ptext SLIT("x_ )")]) - pp_infixly v = parens (sep [pp_expr, ppr v]) + pp_infixly v = parens (sep [pp_expr, pprInfix v]) ppr_expr (SectionR op expr) = case unLoc op of @@ -331,7 +331,7 @@ ppr_expr (SectionR op expr) pp_prefixly = hang (hsep [text "( \\ x_ ->", ppr op, ptext SLIT("x_")]) 4 ((<>) pp_expr rparen) pp_infixly v - = parens (sep [ppr v, pp_expr]) + = parens (sep [pprInfix v, pp_expr]) ppr_expr (HsLam matches) = pprMatches LambdaExpr matches @@ -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 (pprGRHSs ctxt grhss)] + nest 2 (pprDeeper (pprGRHSs ctxt grhss))] where pp_name (FunRhs fun) = ppr fun -- Not pprBndr; the AbsBinds will -- have printed the signature |