[GHC] #3053: Modular arithmetic bug?

GHC trac at galois.com
Fri Feb 27 09:01:48 EST 2009


#3053: Modular arithmetic bug?
----------------------+-----------------------------------------------------
 Reporter:  vlaad     |          Owner:         
     Type:  bug       |         Status:  closed 
 Priority:  normal    |      Milestone:         
Component:  GHCi      |        Version:  6.10.1 
 Severity:  critical  |     Resolution:  invalid
 Keywords:            |       Testcase:         
       Os:  Windows   |   Architecture:  x86    
----------------------+-----------------------------------------------------
Changes (by augustss):

  * status:  reopened => closed
  * resolution:  => invalid

Comment:

 Both ghc and ghci are working exactly as they should.
 If you say
 {{{
 [ x | x <- [1..], x < 10]
 }}}
 then it will let x go through all the numbers from 1 and up, and only keep
 those that are < 10.  The compiler "does not know" that the seqeunce is
 monotonically increasing, so it has to loop after delivering 9, because it
 "thinks" that somewhere in the infinite list (beyond 9) there could again
 be a number < 10.

 This is '''not''' a bug.

 (And indeed, for some non-standard kind of numbers it could very well be
 that enumFrom would deliver some smaller numbers later.)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3053#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list