-mkAppMsg fun arg expr sty
- = ppAboves [ppStr "Argument values doesn't match argument type:",
- ppHang (ppStr "Fun type:") 4 (ppr sty fun),
- ppHang (ppStr "Arg type:") 4 (ppr sty arg),
- ppHang (ppStr "Expression:") 4 (pp_expr sty expr)]
-
-mkTyAppMsg :: Type -> Type -> CoreExpr -> ErrMsg
-mkTyAppMsg ty arg expr sty
- = panic "mkTyAppMsg"
-{-
- = ppAboves [ppStr "Illegal type application:",
- ppHang (ppStr "Exp type:") 4 (ppr sty exp),
- ppHang (ppStr "Arg type:") 4 (ppr sty arg),
- ppHang (ppStr "Expression:") 4 (pp_expr sty expr)]
--}
-
-mkUsageAppMsg :: Type -> Usage -> CoreExpr -> ErrMsg
-mkUsageAppMsg ty u expr sty
- = ppAboves [ppStr "Illegal usage application:",
- ppHang (ppStr "Exp type:") 4 (ppr sty ty),
- ppHang (ppStr "Usage exp:") 4 (ppr sty u),
- ppHang (ppStr "Expression:") 4 (pp_expr sty expr)]
+mkAppMsg fun arg expr
+ = vcat [ptext SLIT("Argument value doesn't match argument type:"),
+ hang (ptext SLIT("Fun type:")) 4 (ppr fun),
+ hang (ptext SLIT("Arg type:")) 4 (ppr arg),
+ hang (ptext SLIT("Expression:")) 4 (pprCoreExpr expr)]
+
+mkKindErrMsg :: TyVar -> Type -> CoreExpr -> ErrMsg
+mkKindErrMsg tyvar arg_ty expr
+ = vcat [ptext SLIT("Kinds don't match in type application:"),
+ hang (ptext SLIT("Type variable:"))
+ 4 (ppr tyvar <+> ptext SLIT("::") <+> ppr (tyVarKind tyvar)),
+ hang (ptext SLIT("Arg type:"))
+ 4 (ppr arg_ty <+> ptext SLIT("::") <+> ppr (typeKind arg_ty)),
+ hang (ptext SLIT("Expression:")) 4 (pprCoreExpr expr)]
+
+mkTyAppMsg :: FAST_STRING -> Type -> Type -> CoreExpr -> ErrMsg
+mkTyAppMsg msg ty arg expr
+ = vcat [hsep [ptext msg, ptext SLIT("type application:")],
+ hang (ptext SLIT("Exp type:"))
+ 4 (ppr ty <+> ptext SLIT("::") <+> ppr (typeKind ty)),
+ hang (ptext SLIT("Arg type:"))
+ 4 (ppr arg <+> ptext SLIT("::") <+> ppr (typeKind arg)),
+ hang (ptext SLIT("Expression:")) 4 (pprCoreExpr expr)]