let map2_exn t1 t2 ~f =
let lgth1 = (length t1) in
let lgth2 = (length t2) in
match lgth1, lgth2 with
| 0, 0 -> empty
| _, _ when lgth1 <> lgth2 -> failwith "map2_exn"
| lgth1, lgth2 ->
let res = make lgth1 (String.get t1 0) in
for i = 0 to lgth1 - 1 do
String.set res i (f (String.get t1 i) (String.get t2 i))
done;
res