A Pointless Library Proposal
seth at cql.com
Mon Oct 30 20:11:17 EST 2006
On Mon, 30 Oct 2006 16:58:40 -0800
John Meacham <john at repetae.net> wrote:
> 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.
> John Meacham - ⑆repetae.net⑆john⑈
> Libraries mailing list
> Libraries at haskell.org
More information about the Libraries