[Haskell-beginners] Rank beginner question about debugging

Joe Fredette jfredett at gmail.com
Wed Jul 22 01:09:42 EDT 2009


I, for one, have never found a need for a more traditional debugger in 
haskell. Most of my 'bugs' are more accurately described as 'behavior 
which I did not intend' rather than the more normal description of 
'behavior which breaks things'. That is, Haskell programs (almost) 
always work if they type-check, however,
they may work in a way you had not planned on.

:)  

/Joe

Brent Yorgey wrote:
> On Tue, Jul 21, 2009 at 09:26:19AM -0400, Ben Wise wrote:
>   
>> Folks,
>>
>> I'm a rank beginner in Haskell, and though Haskell seems like a great
>> language to start using, I've got a serious concern about debugging.
>>
>> In about 15 years of Lisp experience, then 15 years of C++, I've gotten
>> pretty accustomed to the idea of using a debugger with lots of pre- and
>> post-conditions on functions, breakpoints, stack trace, and variable
>> inspection -- even though it gets tricky with delayed evaluation,
>> macros, etc. in Lisp!
>>     
>
> If you think it's tricky in Lisp, it's about ten times as tricky with
> a lazy language like Haskell!  Using gdb with Haskell executables is
> pretty much useless since the generated code doesn't correspond to the
> Haskell code in any obvious ways.  And it's really hard to make
> traditional debuggers since the ghc runtime model looks nothing like
> traditional ones.  However, There IS a debugger built into most recent
> versions of ghci which lets you do some of these things -- have you
> taken a look at that?
>
> I've done quite a bit of programming using the sort of debuggers you
> describe myself---with C, C++, and Java in particular.  And yet in all
> the Haskell coding I've done over the past few years---some of it
> quite significant---I've rarely missed those sorts of debuggers.  I'm
> not quite sure I understand the reason why.  Perhaps it's partly
> because Haskell lets you program on such a high level that there's
> less room for the sorts of titchy errors that debuggers are so good at
> helping you find.  In any case, I wouldn't worry about it too much at
> this point if I were you, and if you really do find yourself wanting
> it, take a look at the ghci debugger.
>
> -Brent
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jfredett.vcf
Type: text/x-vcard
Size: 296 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/beginners/attachments/20090722/90d3440c/jfredett.vcf


More information about the Beginners mailing list