Tools for haskell problem solving

Submitted by metaperl on Tue, 11/28/2006 - 6:43pm.

TYPING
This is your very first tool. Write out the type for the function that will solve your problem.

CASES
Write down your trivial base cases

INDUCTION STEP
You wrote down your accurate base case. Now imagine your function having to process an input data set with just one element more than your base case.

Then, write out that case algebraically

PICTURES OF DATA FLOW
Cale Gibbard has some nice pictures of how data can flow through functions when using foldl. And the technique is applicable elsewhere.

Submitted by metaperl on Wed, 11/29/2006 - 7:50am.

Note these are all the top-down tools... one should not forget bottom up parsing as well.

Submitted by metaperl on Thu, 11/30/2006 - 9:48am.

Toss out the hard cases!

If you feel yourself knitting your brows while cooking up a solution to the problem, see what is giving you hissy fit, and ignore that case.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.