[Haskell-cafe] Re: how do you debug programs?

Neil Mitchell ndmitchell at gmail.com
Wed Sep 6 12:00:59 EDT 2006


I think that when it comes to debuggers and Haskell its fairly safe to say:

1) There aren't any which are production quality, regularly work "out
of the box" and are avaiable without much effort. There may be ones
which are debuggers (Hat/GHCi breakpoints), but we probably haven't
got to the stage where they are "polished" (being exceptionally vague
about what that means).

2) We disagree if they would be useful. I say yes. Others say no. I
guess this is an academic argument until we fix 1, and I guess no one
who says "no" to 2 is going to bother fixing 1.

> H'm.  I've never been completely convinced that head should
> be in the language at all.  If you use it, you really have
> to think, every time you type in the letters h-e-a-d, "Am I
> /really/ /really/ sure the argument will never be []?"
> Otherwise you should be using a case expression or (more
> often, I think) a subsidiary function with a pattern match.

I disagree (again...) - head is useful. And as you go on to say, if
you apply it to the infinite list, who cares if you used head. Head is
only unsafe on an empty list. So the problem then becomes can you
detect unsafe calls to head and let the programmer know.

Answer, not yet, but again, its being worked on:





More information about the Haskell-Cafe mailing list