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


_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to