From 7a5aca7bf27215113171742e1b1108dcc5fb299d Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Tue, 9 Dec 2025 12:33:06 +0000 Subject: [PATCH] add function in persistent-vector.sml to insert --- fcore/persistent-vector.sml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fcore/persistent-vector.sml b/fcore/persistent-vector.sml index 0fc0e2d..a094262 100644 --- a/fcore/persistent-vector.sml +++ b/fcore/persistent-vector.sml @@ -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) =