
26 Aug
2007
26 Aug
'07
7:53 a.m.
Andrew Coppin wrote:
Daniel C. Bastos wrote: But that won't compile, because it doesn't obey the syntax rules of Haskell. You could, however, write
data List x = x : (List x) | End
and it would work.
1 : (2 : (3 : End))
Except that (for no particularly good reason) ":" is a reserved symbol that always refers to the Prelude list version. You could define a similar name like: data List x = x :- (List x) | End 1 :- (2 :- (3 :- End)) Isaac