diff --git a/fcore/search-list.sml b/fcore/search-list.sml index 254a838..0a29707 100644 --- a/fcore/search-list.sml +++ b/fcore/search-list.sml @@ -130,4 +130,15 @@ struct {left = left, right = right} end | [] => {left = left, right = right} + + fun insert (new, {left, right}: t) = + (* look at elements to see which way to traverse *) + case right of + hd :: _ => + if Vector.sub (hd, 0) >= new then + insRight (new, left, right) + else + insLeft (new, left, right) + | [] => + insLeft (new, left, right) end diff --git a/shf b/shf index 751e7e1..59f4b3a 100755 Binary files a/shf and b/shf differ