[Haskell-cafe] Debugging

Stefan O'Rear stefanor at cox.net
Sat May 5 01:55:55 EDT 2007


On Fri, May 04, 2007 at 10:44:15PM -0700, Ryan Dickie wrote:
> I've only written trivial applications and functions in haskell. But the
> title of this thread got me thinking.
> 
> In an imperative language you have clear steps, states, variables to watch,
> etc.
> What techniques/strategies might one use for a functional language?

I personally most often use a divide-and-conquer approach.  I pick a
point about halfway down the call stack, and add trace calls.  If the
subproblems are handled correctly, narrow scope to higher levels;
otherwise narrow to lower levels.  Repeat until you have a single
misbehaving function.

Stefan


More information about the Haskell-Cafe mailing list