vault backup: 2023-10-13 15:27:04

This commit is contained in:
Louis Gallet 2023-10-13 15:27:04 +02:00
parent fd68313ddd
commit 80756ff275
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -195,4 +195,11 @@ let insert_nth w i list =
| (i, e::t) -> e::insrec(i-1, t)
in insrec i list;;
val insert_nth: 'a -> int -> 'a list -> 'a list = <fun>
```
## Exercise 3.4
```
# let insert_post x y list = match list with
| [] -> failwith "list is too large or empty"
| e::t -> if e = x then e::y::t else e::insert_post x y (t);;
val insert_post : 'a -> '