#1997: Stricter enumFrom instance for Integer, to match Int
-----------------------------------+----------------------------------------
 Reporter:  dons                   |          Owner:             
     Type:  bug                    |         Status:  new        
 Priority:  normal                 |      Milestone:  6.10 branch
Component:  libraries/base         |        Version:  6.8.2      
 Severity:  normal                 |     Resolution:             
 Keywords:                         |     Difficulty:  Easy (1 hr)
 Testcase:  lib/should_run/enum04  |   Architecture:  Multiple   
       Os:  Multiple               |  
-----------------------------------+----------------------------------------
Comment (by dons):

 Similary, there are other list functions on numeric types that should be
 strict in the
 accumulator:

 {{{
 Prelude> sum [1..1000000]
 *** Exception: stack overflow
 }}}

 maximum/minimum have rules for this:

 {{{
   "maximumInt"     maximum = (strictMaximum :: [Int]     -> Int);
   "maximumInteger" maximum = (strictMaximum :: [Integer] -> Integer)
 }}}

 and 'sum' works with -O, but none of them work in GHCi -- it would be good
 if
 this could be made more robust.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1997#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

Reply via email to