
On Dec 5, 2007 12:16 AM, Aaron Denney
On 2007-12-04, Paulo J. Matos
wrote: Hello all,
As you might have possibly read in some previous blog posts: http://users.ecs.soton.ac.uk/pocm06r/fpsig/?p=10 http://users.ecs.soton.ac.uk/pocm06r/fpsig/?p=11
we (the FPSIG group) defined: data BTree a = Leaf a | Branch (BTree a) a (BTree a)
Totally avoiding your question, but I'm curious as to why you deliberately exclude empty trees.
Come to think of it, how can you represent a tree with two elements?
Good question. I think we were just trying to define a tree in the meeting and everyone agreed on this representation.
Wouldn't
data BTree a = Empty | Branch (BTree a) a (BTree a)
be better?
Possibly :) I think that at the time nobody really cared about empty trees! But for a really application we would have had to define them probably. Now thinking about it, it seems like defining lists without Null, strange, isn't it?
-- Aaron Denney -><-
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Paulo Jorge Matos - pocm at soton.ac.uk http://www.personal.soton.ac.uk/pocm PhD Student @ ECS University of Southampton, UK