
13 Jan
2008
13 Jan
'08
2:23 p.m.
Hello Brandon S. Allbery KF8NH,
depth emptyBT = 0 depth (NodeBT _ left right) = max (1 + depth left) (1 + depth right) If you use a variable in a pattern match, it creates a new binding which irrefutably matches the corresponding argument. In other words, you get a new local variable "emptyBT", ignoring your global. You must use the actual constructor instead.
I was wondering why depth always returned zero... Thanks. :-)