Change calls Data.Vector.Generic.modifythat calls clone, which has the following rewrite rule:
"clone/new [Vector]" forall p.
clone (new p) = p
So, when something is in syntactic form new p, it is not copied. There modify, slice, init, tail, take, drop, unstreamand clone- this is important, that the well-fused here. All this is closely related to the work of merging flows (paper for deep diving), which reinforces vector design.
: , . new p . , , new, . 1, , , , new , , modify , - , , create, force, modify unstream.
, :
v = fromList [1..10]
g = modify f v
f = undefined
v , new p ( fromList unstream, new), modify .
, :
v = let v0 = fromList [1..10] in
{-
g = modify f v
v - , , . modify f (new p), .
, :
g = let v = fromList [1..10]
t = v ! 4
v2 = modify f v
in t + (v2 ! 4)
, - , , ( new), v.
1 . "slice/new [Vector]", .