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
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
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
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.
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
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
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
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
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
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 ()
10 matches
Mail list logo