Tools for haskell problem solving
This is your very first tool. Write out the type for the function that will solve your problem.
Write down your trivial base cases
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.