-\begin{code}
-mkCaseAltMsg :: PlainCoreCaseAlternatives -> ErrMsg
-mkCaseAltMsg alts sty
- = ppAbove (ppStr "In some case alternatives, type of alternatives not all same:")
- (ppr sty alts)
-
-mkCaseDataConMsg :: PlainCoreExpr -> ErrMsg
-mkCaseDataConMsg expr sty
- = ppAbove (ppStr "A case scrutinee not a type-constructor type:")
- (pp_expr sty expr)
-
-mkCasePrimMsg :: Bool -> TyCon -> ErrMsg
-mkCasePrimMsg True tycon sty
- = ppAbove (ppStr "A primitive case on a non-primitive type:")
- (ppr sty tycon)
-mkCasePrimMsg False tycon sty
- = ppAbove (ppStr "An algebraic case on a primitive type:")
- (ppr sty tycon)
-
-mkCaseAbstractMsg :: TyCon -> ErrMsg
-mkCaseAbstractMsg tycon sty
- = ppAbove (ppStr "An algebraic case on an abstract type:")
- (ppr sty tycon)
-
-mkDefltMsg :: PlainCoreCaseDefault -> ErrMsg
-mkDefltMsg deflt sty
- = ppAbove (ppStr "Binder in default case of a case expression doesn't match type of scrutinee:")
- (ppr sty deflt)
-
-mkFunAppMsg :: UniType -> [UniType] -> PlainCoreExpr -> ErrMsg
-mkFunAppMsg fun_ty arg_tys expr sty
- = ppAboves [ppStr "In a function application, function type doesn't match arg types:",
- ppHang (ppStr "Function type:") 4 (ppr sty fun_ty),
- ppHang (ppStr "Arg types:") 4 (ppAboves (map (ppr sty) arg_tys)),
- ppHang (ppStr "Expression:") 4 (pp_expr sty expr)]
-
-mkUnappTyMsg :: Id -> UniType -> ErrMsg
-mkUnappTyMsg var ty sty
- = ppAboves [ppStr "Variable has a for-all type, but isn't applied to any types.",
- ppBeside (ppStr "Var: ") (ppr sty var),
- ppBeside (ppStr "Its type: ") (ppr sty ty)]
-
-mkAlgAltMsg1 :: UniType -> ErrMsg
-mkAlgAltMsg1 ty sty
- = ppAbove (ppStr "In some case statement, type of scrutinee is not a data type:")
- (ppr sty ty)
-
-mkAlgAltMsg2 :: UniType -> Id -> ErrMsg
-mkAlgAltMsg2 ty con sty
- = ppAboves [
- ppStr "In some algebraic case alternative, constructor is not a constructor of scrutinee type:",
- ppr sty ty,
- ppr sty con
- ]