id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
5569,Ineffective seq/BangPatterns,daniel.is.fischer,igloo,"This could be related to #5557, but it might be something else.
7.2.1 was very picky about where you placed your bangs/seqs, for example
{{{
{-# LANGUAGE BangPatterns #-}
module Main (main) where

main :: IO ()
main = print (f 1000000)

f :: Integer -> Integer
f n = go n 0
  where
    go 0 !sm = sm
    go k acc = go (k-1) (acc+k)

OR

module Main (main) where

main :: IO ()
main = print (f 1000000)

f :: Integer -> Integer
f n = go n 0
  where
    go a b | a `seq` b `seq` False = undefined
    go k acc
        | k == 0    = acc
        | otherwise = go (k-1) (acc+k)
}}}
gave a stack overflow when compiled with ghc -O2. You have to place the bang/seq on the second equation for it to work. Older ghc versions treated it well, as does HEAD, so it seems fixed, but perhaps a regression test is in order?",bug,closed,normal,7.4.1,Compiler,7.2.1,fixed,,,Unknown/Multiple,Unknown/Multiple,Runtime performance bug,,,,,
