[Haskell-beginners] recursion and pattern matching

Brent Yorgey byorgey at seas.upenn.edu
Tue Oct 18 15:30:55 CEST 2011


On Tue, Oct 18, 2011 at 06:22:05AM -0700, Alia wrote:
> Sorry, as soon as I sent my email below, I realized that c should remain arbitrary because we don't
> yet know whatwe want (if the function is to be truly pluggable) so you were probably right in your 
> 
> initial signature (I think).

Exactly right.

> But then unless we apply some function that recurses into the
> tree and generates [c] ...

You are on the right track here although you seem not to realize it. =)
Look at your implementations of treeSum, depth, etc. for inspiration...

-Brent



More information about the Beginners mailing list