Re: A question about overloading

2003-11-08 Thread Hamilton Richards
At 7:02 PM -0800 11/8/03, Ryoko Nanase wrote: Hello, everyone. I can't use any instance of type "Int". Every other type is working, but not Int and Float. In the following source, "isTrue 'T'" is working, but "isTrue 0" is not working, printing "Unresolved overloading - Type : (Num a, Boolable

A question about overloading

2003-11-08 Thread Ryoko Nanase
Hello, everyone.I can't use any instance of type "Int". Every other type is working, but not Int and Float. In the following source, "isTrue 'T'" is working, but "isTrue 0" is not working, printing "Unresolved overloading - Type : (Num a, Boolable a) => Bool". Can you tell me how to solve this pro

Re: Number conversions, like floats to doubles

2003-11-08 Thread Ben Escoto
On Sun, 09 Nov 2003 01:11:09 +0100 "Marcin 'Qrczak' Kowalczyk" <[EMAIL PROTECTED]> wrote: > realToFrac :: (Fractional b, Real a) => a -> b > > It is actually defined as fromRational . toRational but GHC knows to > generate specialized code for particular types. Oops, I was looking through the pre

Re: Number conversions, like floats to doubles

2003-11-08 Thread Marcin 'Qrczak' Kowalczyk
W liście z sob, 08-11-2003, godz. 22:59, Hal Daume III pisze: > In NumExts, there's floatToDouble and doubleToFloat. It's a GHC extension, while realToFrac is Haskell 98. -- __("< Marcin Kowalczyk \__/ [EMAIL PROTECTED] ^^ http://qrnik.knm.org.pl/~qrczak/ __

Re: Number conversions, like floats to doubles

2003-11-08 Thread Marcin 'Qrczak' Kowalczyk
W liście z sob, 08-11-2003, godz. 22:41, Ben Escoto pisze: > If I want to convert a Float to a Double, should I use > > fromRational . toRational realToFrac :: (Fractional b, Real a) => a -> b It is actually defined as fromRational . toRational but GHC knows to generate specialized code for par

Re: Number conversions, like floats to doubles

2003-11-08 Thread Hal Daume III
In NumExts, there's floatToDouble and doubleToFloat. On Sat, 8 Nov 2003, Ben Escoto wrote: > Quick and probably stupid question: > > If I want to convert a Float to a Double, should I use > > fromRational . toRational > > ? It seems to work, but isn't this a bit weird? It took a while for >

Number conversions, like floats to doubles

2003-11-08 Thread Ben Escoto
Quick and probably stupid question: If I want to convert a Float to a Double, should I use fromRational . toRational ? It seems to work, but isn't this a bit weird? It took a while for me to figure this out. I suppose they are rationals because of the finite precision of Floats and Doubles?

type class problem / GHC bug

2003-11-08 Thread Brandon Michael Moore
Hi everyone I've built GHC from CVS and I'm getting some odd errors about overlapping instances. This is different from 6.0.1, but it's not obvious it is wrong, so I'm probably missing something here. The example is class A x class (A x) => B x instance A x instance B x The new GHC complains th