GHC infinite loop when building vector program

Bas van Dijk v.dijk.bas at
Tue Oct 11 21:11:30 CEST 2011


When benchmarking my new vector-bytestring[1] package I discovered
that building the following program causes GHC to go into, what seems
to be, an infinite loop:

import Data.Vector (Vector)
import qualified Data.Vector.Generic as VG

main = print $ VG.foldl f z (VG.fromList [] :: Vector Int)

f = flip (:)
z = []

I build it with:

$ ghc --make vectorGHCloop.hs -O2

It compiles fine without the -O2 or if you specify
-fno-enable-rewrite-rules. So it's probably a loop in a rule

Note that the program also builds fine when I change the 'f' and 'z' to:

f = flip (:)
z = []

I use vector-0.9 and ghc-7.2.1.




More information about the Glasgow-haskell-users mailing list