let set s ~index ~v = if index > String.length s - 1 then None else begin let cop = String.copy s in cop.[index] <- v; Some cop end