RE: More on integer division

2002-07-01 Thread Simon Marlow
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

qualified instance declarations

2002-07-01 Thread Ralf Hinze
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

Re: qualified instance declarations

2002-07-01 Thread Alastair Reid
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

RE: qualified instance declarations

2002-07-01 Thread Simon Marlow
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

RE: More on integer division

2002-07-01 Thread Simon Marlow
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

RE: GHC 5.03 CVS NT2000 Mingw32 - Possible profiling problem in rts/GC.c (or in gmp?)

2002-07-01 Thread Simon Peyton-Jones
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

Re: More on integer division

2002-07-01 Thread Alastair Reid
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