I have an IOArray, but it doesn't work the way I expected it to.

I defined

newMem s = newIOArray (0, size-1) 0

and then

x = newMem 30

then

do {
   y <- x
 ; v <- readIOArray y 2
 ; print v
 ; writeIOArray y 2 20
 ; v <- readIOArray y 2
 ; print v
}

this resulted in 0, 2  as expected.

however, then

do {
 y <- x
 ; v <- readIOArray y 20
 ; print v
}

results in 0

I thought the IOArray was basically a static structure?

Thanks
_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to