Commit b8a40855 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Improve error message for fundeps a bit more

parent 259e1ae7
......@@ -475,14 +475,18 @@ checkInstCoverage be_liberal clas theta inst_taus
conservative_ok = rs_tvs `subVarSet` ls_tvs
liberal_ok = rs_tvs `subVarSet` oclose theta ls_tvs
liberal_doc = ppWhen be_liberal (ptext (sLit "liberal"))
msg = vcat [ sep [ ptext (sLit "The") <+> liberal_doc
msg = vcat [ sep [ ptext (sLit "The")
<+> ppWhen be_liberal (ptext (sLit "liberal"))
<+> ptext (sLit "coverage condition fails in class")
<+> quotes (ppr clas)
, nest 2 $ ptext (sLit "for functional dependency:")
<+> quotes (pprFunDep fd) ]
, sep [ ptext (sLit "Reason:") <+> pprQuotedList ls
, nest 2 $ ptext (sLit "do not jointly determine")
, sep [ ptext (sLit "Reason: lhs type")<>plural ls <+> pprQuotedList ls
, nest 2 $
(if isSingleton ls
then ptext (sLit "does not")
else ptext (sLit "do not jointly"))
<+> ptext (sLit "deternine rhs type")<>plural rs
<+> pprQuotedList rs ]
, ppWhen (not be_liberal && liberal_ok) $
ptext (sLit "Using UndecidableInstances might help") ]
......
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