[Haskell-cafe] Newbie question: the need for parentheses

Fernando Rodriguez frr149 at easyjob.net
Tue Jan 8 16:36:38 EST 2008


Hi,

I have this function that sums up a list of numbers:

suma [] = 0
suma (h:t) = h + suma t

However, why do I need the parenthes in the second clause? What does the 
compiler think I'm trying to do when I type
suma [] = 0
suma h:t = h + suma t

Thanks! :-)





More information about the Haskell-Cafe mailing list