projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
46934dd
)
Improve error message in deriving (fix Trac #2851)
author
simonpj@microsoft.com
<unknown>
Tue, 30 Dec 2008 16:59:06 +0000
(16:59 +0000)
committer
simonpj@microsoft.com
<unknown>
Tue, 30 Dec 2008 16:59:06 +0000
(16:59 +0000)
compiler/typecheck/TcDeriv.lhs
patch
|
blob
|
history
diff --git
a/compiler/typecheck/TcDeriv.lhs
b/compiler/typecheck/TcDeriv.lhs
index
419ec94
..
5053a06
100644
(file)
--- a/
compiler/typecheck/TcDeriv.lhs
+++ b/
compiler/typecheck/TcDeriv.lhs
@@
-1314,7
+1314,9
@@
standaloneCtxt ty = hang (ptext (sLit "In the stand-alone deriving instance for"
derivInstCtxt :: Class -> [Type] -> Message
derivInstCtxt clas inst_tys
derivInstCtxt :: Class -> [Type] -> Message
derivInstCtxt clas inst_tys
- = ptext (sLit "When deriving the instance for") <+> parens (pprClassPred clas inst_tys)
+ = vcat [ptext (sLit "Alternative fix: use a standalone 'deriving instance' declaration"),
+ nest 2 (ptext (sLit "instead, so you can specify the instance context yourself")),
+ ptext (sLit "When deriving the instance for") <+> parens (pprClassPred clas inst_tys)]
badDerivedPred :: PredType -> Message
badDerivedPred pred
badDerivedPred :: PredType -> Message
badDerivedPred pred