non-intuitive error message in ghci

Simon Peyton-Jones simonpj at microsoft.com
Fri Oct 31 05:34:27 EST 2003


This bug has gone away in the HEAD, and isn't present in the stable
branch.  So I can't reproduce it any more, and I propose to declare it
fixed.  Please yell if you find it isn't.

Simon

| -----Original Message-----
| From: glasgow-haskell-bugs-admin at haskell.org
[mailto:glasgow-haskell-bugs-admin at haskell.org] On
| Behalf Of Hal Daume
| Sent: 11 August 2003 20:56
| To: glasgow-haskell-bugs at haskell.org
| Subject: non-intuitive error message in ghci
| 
| When we'd try to evaluate a finite map at the prompt, we get an error
| about there not being a show instance:
| 
| Prelude> :m Data.FiniteMap
| Prelude Data.FiniteMap> emptyFM
| 
| No instance for (Show (FiniteMap key elt))
| arising from use of `print' at <No locn>
| In a 'do' expression pattern binding: print it
| 
| 
| However, if we have Control.Exception in scope, we get a very
different
| message:
| 
| Prelude> :m Prelude Control.Exception Data.FiniteMap
| Data.FiniteMap Control.Exception Prelude> emptyFM
| 
| No instance for (Monad (FiniteMap key))
|   arising from use of `print' at <No locn>
| In a 'do' expression: print it
| 
| 
| Presumably this is because Control.Exception introduces some instance
of
| Monad which then confuses the environment.  It took me a while to
figure
| this out and I can imagine that it would be confusing to other people
| too.
| 
| Is there any (relatively easy) way to get it to report the "real"
error
| message?
| 
|  - Hal
| 
|  --
|  Hal Daume III                                   | hdaume at isi.edu
|  "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs




More information about the Glasgow-haskell-bugs mailing list