\begin{code}
data UnifyErrInfo
= UnifyMisMatch UniType UniType
- | TypeRec TyVar TauType -- Occurs check failure
+ | TypeRec TyVar TauType -- Occurs check failure
+
+ | UnifyListMisMatch [TauType] [TauType] -- Args to unifyList: diff lengths
+ -- produces system error
+
+ | UnifyUnboxedMisMatch UniType UniType -- No unboxed specialisation
- | UnifyListMisMatch [TauType] [TauType] -- Args to unifyList: diff lengths
- -- produces system error
\end{code}
@UnifyErrContext@ gives some context for unification
pprUnifyErrInfo sty (UnifyMisMatch mt1 mt2) err_ctxt
= ppUnifyErr (ppSep [ppBesides [ppStr "Couldn't match the type `", ppr sty mt1, ppStr "'"],
- ppBesides [ppStr "against `", ppr sty mt2, ppStr "'."]])
+ ppBesides [ppStr "against `", ppr sty mt2, ppStr "'."]])
(pprUnifyErrContext sty err_ctxt)
pprUnifyErrInfo sty (TypeRec tyvar ty) err_ctxt
pprUnifyErrInfo sty (UnifyListMisMatch tys1 tys2) err_ctxt
= panic "pprUnifyErrInfo: unifying lists of types of different lengths"
+
+pprUnifyErrInfo sty (UnifyUnboxedMisMatch mt1 mt2) err_ctxt
+ = ppUnifyErr (ppSep [ppBesides [ppStr "Couldn't match the type variable `", ppr sty mt1, ppStr "'"],
+ ppBesides [ppStr "against unboxed type `", ppr sty mt2, ppStr "'."],
+ ppStr "Try using -fspecialise-unboxed ..." ])
+ (pprUnifyErrContext sty err_ctxt)
\end{code}
%************************************************************************