[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Isarmathlib-devel] Haskell
From: |
Slawomir Kolodynski |
Subject: |
Re: [Isarmathlib-devel] Haskell |
Date: |
Mon, 30 Jun 2008 18:58:58 -0700 (PDT) |
> How do you debug Haskell programs?
I don't, if they compile, they work...
More seriously, it's a major pain. I don't use hat, although I guess it would
be useful to learn. My technique is that if there is a problem I run suspected
functions from GHCi to see if they work as expected. If something fails in
tiddlyisar, it is usually the parser. Parsec gives the line number, so I know
more or less the theorem where the problem happens (don't forget to add 30 or
so to the line Parsec gives, tiddlyisar's parser gets the theory file without
that initial comment with the license). Then I try to parse that part of the
text using my knowledge on how it should be parsed. After a couple of hours I
know what is wrong...
This works only if you know the code and how it is supposed to work very well.
I don't think I would be able to use this method to debug Haskell code written
by someone else. But hey, there are lots of people smarter than me, and maybe
you are one of them... Good luck.
One thing that would help in debugging is adding some <?> combinators to the
parser. I will do that next.
Slawek