[Haskell-cafe] Re: Debugging partial functions by the rules

John Meacham john at repetae.net
Fri Nov 17 19:21:38 EST 2006

On Fri, Nov 17, 2006 at 11:37:12AM +0000, Neil Mitchell wrote:
> fromJust is simple, useful and clear. What you mean is that
> implementations aren't very good at debugging this. It seems unfair to
> blame partial functions for the lack of a debugger. If a call stack
> was automatically output every time a fromJust failed would this even
> be something people complained about?

indeed. jhc debugs this quite fine. when you use it the wrong way you

Main.hs:23:33:fromJust Nothing

as your error message. or you should at least.

likewise for head, tail, undefined, etc.. actually any function
including ones you write yourself for which you give the SRCLOC_ANNOTATE

boy I want to have the time to port that to ghc... a six pack of beer
for whoever does :)


John Meacham - ⑆repetae.net⑆john⑈

More information about the Haskell-Cafe mailing list