vault backup: 2023-10-13 15:51:29

This commit is contained in:
Louis Gallet 2023-10-13 15:51:29 +02:00
parent f955d7c0fc
commit 83f1ecc9c0
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -198,8 +198,14 @@ val insert_nth: 'a -> int -> 'a list -> 'a list = <fun>
``` ```
## Exercise 3.4 ## Exercise 3.4
``` ```Ocaml
# let insert_post x y list = match list with # let insert_post x y = function
| [] -> failwith "list is too large or empty" | [] -> failwith "list is too large or empty"
| e::t -> if e = x then e::y::t else e::insert_post x y (t);; | e::t -> if e = y then e::x::t else e::insert_post x y t;;
val insert_post : 'a -> a' list -> list = <fun> val insert_post : 'a -> 'a -> a' list -> list = <fun>
```
## Exercise 3.5
```
```