spot135 <[email protected]> writes:

> So this is what ive got so far.
>
> data Tree a = Empty | Leaf a | Branch a [Tree a]

[Homework mode on, i.e. hints and careful nudges to help you work it out
on your own]

The definition above gives two ways to build a Tree with only one data
element.  Can you see which ones?  Is this a good thing?

What is the difference between your definition and

     data Tree a = Empty | Branch a [Tree a]

What would the consequences be if you replaced your definition with
this one?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to