add function in persistent-vector.sml to insert

This commit is contained in:
2025-12-09 12:33:06 +00:00
parent 102f2788a1
commit 7a5aca7bf2

View File

@@ -955,6 +955,15 @@ struct
end
end
fun insert (start, length, tree) =
let
val left = splitLeft (start, tree)
val left = append (start, start + length, tree)
val right = splitRight (start + 1, tree)
in
join (left, right)
end
(* conversion functions for testing *)
fun helpFromList ([], acc) = acc
| helpFromList ((start, finish) :: tl, acc) =