
3 Jul
2004
3 Jul
'04
5:12 a.m.
Hi I have noticed that lists seem to swtich between using [] and using (). for example: listSum [] = 0 listSum (x:xs) = x + listsum xs but when specificy lists you use [] as in [1,2,3]. or type signatures are [a] -> [a] It also seems when they mentioned on the right hand side it also always []. Is it just for pattern matching that you use the "tuple" syntax ? How does haskell know we dont mean a tuple ? Or do we mean a tuple when we say (x:xs) ? Thanks _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus