[Haskell-cafe] STM, newArray, and a stack overflow?

Ketil Malde ketil at malde.org
Wed Mar 23 16:34:59 CET 2011

Bas van Dijk <v.dijk.bas at gmail.com> writes:

Thanks to you and Felipe for trying this out.

>> omap <- atomically $ (newArray_ (0,n-1) :: STM (TArray Int Int))

> I can't reproduce this with ghci-7.0.2 (base-, array-
> and stm- 

It works (calling the same function) from GHCi, but breaks when
compiled.  Also when compiling with -O0.

I'm probably doing something wrong, but I can't for the life of me work
out what it might be.  I've surrounded the offending newArray with print
statements, so I can't see how it could be something else.

> What version of ghc/ghci are you using?

Happens with GHC 6.12.1 and 7.0.2.

6.12.1, array-, stm-
7.0.2,  array-, stm-

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list