
On Mon, 30 Oct 2006 16:58:40 -0800
John Meacham
On Mon, Oct 30, 2006 at 10:16:46AM -0500, Lennart Augustsson wrote:
I like to use undefined is the stub for unimplemented functions since it's nice and terse. Unfortunately, ghc doesn't give much information about where the undefined was called. It would be great if the message for undefined could include file name and line number (like hbc did :).
jhc has the SRCLOC_ANNOTATE pragma, which lets you attach file and line number information to arbitrary functions. sort of a generalization of the 'assert' feature of ghc. One day I will get around to implementing it in ghc. perhaps the next time a program I write mysteriously dies with "Prelude.undefined" being the only thing printed.
There are many other situations where this would be _extremely_ useful. In my commercially deployed Haskell system, I received repeated requests for filename/line number information to be added to trace logs. I had to resort to using a preprocessor. This is for obvious reasons not an attractive solution. Seth
John
-- John Meacham - ⑆repetae.net⑆john⑈ _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries