Changes between Initial Version and Version 2 of Ticket #3677


Ignore:
Timestamp:
Nov 20, 2009 9:59:58 PM (6 years ago)
Author:
igloo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3677 – Description

    initial v2  
    11The following code creates a stack overflow at -O1 or -O2, when running with a moderately small stack (+RTS -K94k):
    2 
     2{{{
    33import Data.Bits
    44hmm :: [Integer]
    55hmm = filter (\n -> (n .&. (n-1))==0) [1..]
    66main = mapM_ print hmm
    7 
     7}}}
    88The lambda just picks out powers of two, so that filter will skip increasingly long subsequences. It's the filter causing the overflow.
    99