#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_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs