Haskell `Data.Vector.Mutable.unsafeNew` zero memory?

docs says that it new"creates a mutable vector of a given length" and unsafeNew"creates a mutable vector from a specified length. The length is not checked."

However, this resolved github issue indicates that it unsafeNewdoes not reset the memory, but newdoes.

Which one?

+4
source share
1 answer

No, not in general. If you click on the source, this is pretty clear:

https://hackage.haskell.org/package/vector-0.11.0.0/docs/src/Data-Vector-Generic-Mutable.html#new

newthere is unsafeNewwith the addition basicInitialize.

+3
source

Source: https://habr.com/ru/post/1610052/


All Articles