[Haskell-cafe] Problems with square root...

Hal Daume III hdaume at ISI.EDU
Wed Dec 21 13:16:47 EST 2005

> Sigh... never fails. Spend an hour trying to solve a problem, and a 
> minute after you write to the list you find the solution. I need 
> brackets around sqrt. I'm surprised though. I don't understand why it 
> dosn't work without brackets.

because "x y z" parses as "(x y) z", so "round sqrt 2" parses as "(round 
sqrt) 2" and "round sqrt" doesn't make sense.  "x(y)" doesn't mean 
necessarily "apply y to x" as it does in C.  parens only are used as they 
are in math to separate stuff.

 Hal Daume III                                   | hdaume at isi.edu
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume

More information about the Haskell-Cafe mailing list