Are new vectors created even if the old ones aren't used anymore?
This question is about the Data.Vector package. Given the fact that I'll never use the old value of a certain cell once the cell is updated. Will the update operation always create a new vector, reflecting the update, or will it be done as an in-place update ? Note: I know about Data.Vector.Mutable No, but something even better can happen. Data.Vector is built using "stream fusion" . This means that if the sequence of operations that you are performing to build up and then tear down the vector can be fused away, then the Vector itself will never even be constructed and your code will turn into