Closed jorisdral closed 1 month ago
It's poorly worded. force
always creates copy except when optimized is able to elide that copy. Specifically after using slice it will perform copy.
On the other hand output in some very special cases there're rules that could elide that copy. force (generate 10 f)
.
The haddocks of the
force
function mentions that the input vector is possibly copied into a new return vector.It seems however that
force
always copies regardless of the vector type, because the implementation for each vector type callsData.Vector.Generic.force
, which usesbasicUnsafeCopy
.If my understanding is correct, should the haddocks be updated to specify that the function always copies?