let set t ~index ~v:c =
let lgth = length t in
if index < 0 || lgth <= index then None
else Some (
let res = make lgth (S.get t 0) in
blit ~dst:res ~dst_pos:0 ~src:t ~src_pos:0 ~len:lgth;
S.set res index c;
res)