[Haskell-cafe] Debugging partial functions by the rules
dagit at eecs.oregonstate.edu
Wed Nov 15 00:21:59 EST 2006
On 11/14/06, Donald Bruce Stewart <dons at cse.unsw.edu.au> wrote:
> So, further work:
> * have 'assert' respected when -O is on
> * think up a technique for splicing in 'assert' via rewrite rules (or TH
> ...) such that the src locations are expanded after the rewrite, and
> correctly reflect the location of the splice point.
> Any ideas?
Overall I like what you've said. But when I read it, I wondered, "Why
do I have to fix every function which calls error? Why can't we just
fix error?" We discussed this a bit in #haskell and it was pointed
out that, that would only give us the line number of where error is
defined. Someone mentoined stack traces aren't so great in haskell,
but Cale sugested we try to get a "cost-center trace" plus line
Even though __FILE__ and __LINE__ are a bit simplistic in C they are
quite handy for things like this.
More information about the Haskell-Cafe