You need some type constructor:
data Tree a = Leaf a | Branch (Tree a) (Tree a)
Am 01.01.2009 um 08:32 schrieb Max.cs:
hi all, I want to define a data type Tree a that can either be a
or Branch (Tree a) (Tree a)?
I tried
data Tree a = a | Branch (Tree a) (Tree a) deriving Show
but it se
On 2009 Jan 1, at 2:32, Max.cs wrote:
data Tree a = a | Branch (Tree a) (Tree a) deriving Show
but it seems not accpetable in haskell ?
You need a constructor in both legs of the type:
> data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving Show
--
brandon s. allbery [solaris,freebsd,perl
hi all, I want to define a data type Tree a that can either be a or Branch
(Tree a) (Tree a)?
I tried
data Tree a = a | Branch (Tree a) (Tree a) deriving Show
but it seems not accpetable in haskell ?
any way I could achieve this ?
Thanks
max___