#1997: Stricter enumFrom instance for Integer, to match Int
----------------------------+-----------------------------------------------
Reporter: dons | Owner:
Type: bug | Status: new
Priority: normal | Milestone: Not GHC
Component: libraries/base | Version: 6.8.2
Severity: normal | Resolution:
Keywords: | Difficulty: Easy (1 hr)
Testcase: | Architecture: Multiple
Os: Multiple |
----------------------------+-----------------------------------------------
Comment (by dons):
Further on this, the use of strict enumFromTo is mixed across
the base Enum instances. The following types use strict
accumulators:
{{{
Word32
Word64
Int32
Int64
Int
Word
()
Bool
Ordering
}}}
While these use lazy accumulators:
{{{
Integer
}}}
And these share the same enumFrom implementation,
{{{
Float
Double
Rational
}}}
Based on
{{{
iterate (+1) 0
}}}
This proposal fixes Integer, but it seems like we should fix the later to?
We gain the ability to rely on [x .. ] to work for large sizes, without
memory overflow.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1997#comment:2>
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