After a looking a little more, there seem to be other problems
(including errors in my proposed solution). I don't know where the
code for quotRem is, but it is also buggy. For instance,
Prelude 9 `quotRem` (-5)
(-1,4)
(The correct answer is (-1,-4).) I'm frankly astonished: has
Hi,
GHC (5.03.20020410) wrongly accepts the following:
::
C.lhs
::
module C
where
class A a where
a :: a - Int
::
X.lhs
::
module X
where
import qualified C
instance C.A Int where
C.a = id
Note that the class method is qualified
For those puzzled by the number of things called 'a' in Ralf's
program, I'm attaching an alpha-renamed version. Removing the type
signature (or changing the type signature to Integer) for a results in
Ralf's type error in Hugs.
It does indeed look as though Hugs applies defaulting to 'a' and
GHC (5.03.20020410) wrongly accepts the following:
::
C.lhs
::
module C
where
class A a where
a :: a - Int
::
X.lhs
::
module X
where
import qualified C
instance C.A Int where
C.a = id
This has been fixed, and
I'm shocked that non of the three Haskell implementations had a test
suite that caught this problem.
Take a look at
fptools/testsuite/tests/ghc-regress/numeric/should_run/arith0011.hs.
There may be one or two wrong answers lurking in there, but
that's a lot
of results to check by
Title: Message
I
doubt it.
Simon
-Original Message-From: Mike Thomas
[mailto:[EMAIL PROTECTED]] Sent: 29 June 2002 10:32To:
Simon Peyton-Jones; [EMAIL PROTECTED]Cc:
[EMAIL PROTECTED]Subject: Re: GHC 5.03 CVS NT2000 Mingw32 - Possible
profiling problem in rts/GC.c
However, it's easy to write a program to verify such results,
assuming you trust your addition and multiplication and comparisons:
[...]
Also, looking at arith003, there are a few more test cases I might
include, with quotient/remainder, say, 3/4 or 1/2 of maxInt. You
also don't seem to