On 2012-03-09 02:13, Johan Tibell wrote:
Hi,

I just ran across some code that calls unsafeThawArray#, writeArray#,
and unsafeFreezeArray#, in that order. How unsafe is that?

Quick follow up question:

Are unsafeThawArray# and unsafeFreezeArray# guaranteed to not make a copy? I.e. are these two pieces of code equivalent with respect to further usage of the return value:

    do mary <- unsafeThawArray# ary
       writeArray# mary 123# newValue
       unsafeFreezeArray# mary

and

    do mary <- unsafeThawArray# ary
       writeArray# mary 123# newValue
       return ary

(where do notation is actually done manually.)


Twan

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to