vault backup: 2023-10-16 13:59:49

This commit is contained in:
2023-10-16 13:59:49 +02:00
parent 7e268ea3b7
commit 3c5fd625a5
2 changed files with 22 additions and 7 deletions

View File

@ -220,3 +220,19 @@ val reverse : 'a list -> 'a list = <fun>
in rev [] l
val reverse: 'a list -> 'a list = <fun>
```
## Exercise 3.6
```Ocaml
let rec equals l = function
| [] when l = [] -> true
| [] -> false
| e::t -> if l = [] then false else (let e2::l2 = l in e = e2 + equal (l-1))
val equals = 'a list -> 'a list -> bool = <fun>
```
## Exercise 3.7
```Ocaml
let shared l1 l2 = function
| [] -> []
| e::t -> let rec s l2 = function
|e::t ->