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

2005-12-21 Thread Daniel Carrera
Hey, The sqrt function is not doing what I want. This is what I want: round sqrt(2) The problem is that sqrt() returns a Floating value and round wants a ReacFrac: --//-- *Main round sqrt(2) interactive:1:0: No instances for (RealFrac (a - a), Integral (t - a1)) arising from use of

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

2005-12-21 Thread Daniel Carrera
Daniel Carrera wrote: Hey, The sqrt function is not doing what I want. This is what I want: round sqrt(2) 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

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

2005-12-21 Thread Radu Grigore
On 12/21/05, Daniel Carrera [EMAIL PROTECTED] wrote: round sqrt(2) I don't understand why it dosn't work without brackets. Function application is left associative in Haskell. -- regards, radu http://rgrig.blogspot.com/ ___ Haskell-Cafe mailing

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

2005-12-21 Thread Jon Fairbairn
On 2005-12-21 at 18:10GMT Daniel Carrera wrote: Daniel Carrera wrote: Hey, The sqrt function is not doing what I want. This is what I want: round sqrt(2) Sigh... never fails. Spend an hour trying to solve a problem, and a minute after you write to the list you find the solution.

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

2005-12-21 Thread Hal Daume III
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

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

2005-12-21 Thread Daniel Carrera
Radu Grigore wrote: I don't understand why it dosn't work without brackets. Function application is left associative in Haskell. Ah. I implicitly assumed right-association (it works in Perl ;) ) Thanks. -- /\/`) http://oooauthors.org /\/_/ http://opendocumentfellowship.org

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

2005-12-21 Thread Tomasz Zielonka
On Wed, Dec 21, 2005 at 06:10:56PM +, Daniel Carrera wrote: Daniel Carrera wrote: Hey, The sqrt function is not doing what I want. This is what I want: round sqrt(2) Sigh... never fails. Spend an hour trying to solve a problem, and a minute after you write to the list you find the

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

2005-12-21 Thread Mark Goldman
nitpicky detail: () - Parenthesis {} - Braces [] - Brackets Sorry to be pedantic, but using the wrong terminology confuses me and I'm sure others as well. On 12/21/05, Daniel Carrera [EMAIL PROTECTED] wrote: Daniel Carrera wrote: Hey, The sqrt function is not doing what I want. This is

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

2005-12-21 Thread Jared Updike
MG () - Parenthesis MG {} - Braces MG [] - Brackets MG Sorry to be pedantic, but using the wrong terminology confuses me and MG I'm sure others as well. This is true for Haskell, but Daniel is correct if he is calling () Brackets because they are, in British English, right? (Just like '.' is a

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

2005-12-21 Thread Daniel Carrera
Mark Goldman wrote: nitpicky detail: () - Parenthesis {} - Braces [] - Brackets Sorry to be pedantic, but using the wrong terminology confuses me and I'm sure others as well. Being pedantic can be fun :) The Macquarie Dictionary, which is the official dictionary in Australia, says that ()