vault backup: 2023-10-13 15:12:28

This commit is contained in:
2023-10-13 15:12:28 +02:00
parent 17ba01e9e2
commit fd68313ddd

View File

@ -190,12 +190,9 @@ let insert_nth w i list =
invalid_arg "negative rank"
else
let rec insrec i = function
[] -> if i > 1 then
failwith "out of bound"
else
x::t
| e::E when i = 1 -> x::e::t
| e::t -> e::insrec (i - 1) t
(1,l) -> x::l
| (_, []) -> failwith "out of bound"
| (i, e::t) -> e::insrec(i-1, t)
in insrec i list;;
val insert_nth: 'a -> int -> 'a list -> 'a list = <fun>