id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
1131	newArray_ allocates an array full of garbage	igloo		"In http://www.haskell.org/pipermail/haskell-cafe/2006-December/020115.html
Stefan O'Rear points out that newArray_ allocates an array full of garbage. For ST this violates referential transparency, and it presumably also means we are leaking information we shouldn't.

For example, running

{{{
import Control.Monad.ST
import Data.Array.ST
import Data.Array
import System.Mem

tickle :: Int
tickle = runST (do {
     x <- newArray_ (0,100) ;
     (readArray :: STUArray s Int Int -> Int -> ST s Int) x 3
   })

main :: IO ()
main = do print $ length (replicate 100000 'a')
          performGC
          print tickle
}}}

produced

{{{
$ ./q
100000
46912506425344
}}}"	bug	closed	high	6.8.1	libraries/base	6.6	fixed		iampure@…	Unknown/Multiple	Unknown/Multiple		Unknown	arr018			
