Computer Science Canada

Haskell Question

Author:  1of42 [ Fri Oct 14, 2005 8:48 pm ]
Post subject:  Haskell Question

In which module do functions like sqrt, log etc. reside?

It appears that they are in a class called Fractional, but I'm not sure which module to import to get a them...

Author:  wtd [ Fri Oct 14, 2005 8:54 pm ]
Post subject: 

http://www.zvon.org/other/haskell/Outputglobal/

They are part of the Prelude module.

Type classes are not what you're used to calling "classes" in object-oriented languages. Wink

Author:  1of42 [ Fri Oct 14, 2005 9:23 pm ]
Post subject: 

kill me now.

note to self:

sqrt != squrt

Author:  wtd [ Fri Oct 14, 2005 9:31 pm ]
Post subject: 

1of42 wrote:
kill me now.


May I ask why such a drastic course of action is necessary?

Author:  1of42 [ Fri Oct 14, 2005 9:34 pm ]
Post subject: 

because for some reason, while I was asking why sqrt wasn't in Prelude, the problem was I was unconsciously typing squrt into my code. >.<

Author:  wtd [ Fri Oct 14, 2005 9:42 pm ]
Post subject: 

Yep. That'll cause problems. Wink


: