freeze{Float,Double}Array: state token not threaded properly
| otherwise
= case (readFloatArray# from# cur# s#) of { StateAndFloat# s1# ele ->
case (writeFloatArray# to# cur# ele s1#) of { s2# ->
- copy (cur# +# 1#) from# to# s1#
+ copy (cur# +# 1#) from# to# s2#
}}
freezeDoubleArray (MutableByteArray ixs arr#) = ST $ \ (S# s#) ->
| otherwise
= case (readDoubleArray# from# cur# s#) of { StateAndDouble# s1# ele ->
case (writeDoubleArray# to# cur# ele s1#) of { s2# ->
- copy (cur# +# 1#) end# from# to# s1#
+ copy (cur# +# 1#) end# from# to# s2#
}}
unsafeFreezeArray :: Ix ix => MutableArray s ix elt -> ST s (Array ix elt)