I'm not working, but still checking mail.
If you don't care about balancing the tree or the order of elements, you can
just use
Branch :: Tree a -> Tree a -> Tree a
as a concatenation operator. Check with GHCi to see that the Branch constructor
actually has the above type.
/ Emil
Max cs skrev:
hi all, not sure if there is someone still working during holiday like
me : )
I got a little problem in implementing some operations on tree.
suppose we have a tree date type defined:
data Tree a = Leaf a | Branch (Tree a) (Tree a)
I want to do a concatenation on these tree just like the concat on list.
Anyone has idea on it? or there are some existing implementation?
Thank you and Happy New Year!
regards,
Max
------------------------------------------------------------------------
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe