vault backup: 2023-10-16 14:39:09

This commit is contained in:
Louis Gallet 2023-10-16 14:39:09 +02:00
parent e4518efe0a
commit 4aab4c46ec
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY
2 changed files with 14 additions and 3 deletions

View File

@ -81,7 +81,8 @@
}
],
"direction": "horizontal",
"width": 300
"width": 300,
"collapsed": true
},
"right": {
"id": "b83c16dd7908c658",

View File

@ -221,7 +221,7 @@ val reverse : 'a list -> 'a list = <fun>
val reverse: 'a list -> 'a list = <fun>
```
## Exercise 3.6
## Exercise 4.1
```Ocaml
let rec equals l = function
| [] when l = [] -> true
@ -230,7 +230,7 @@ let rec equals l = function
val equals = 'a list -> 'a list -> bool = <fun>
```
## Exercise 3.7
## Exercise 4.2
```Ocaml
let shared l1 l2 = function
| [] -> []
@ -242,3 +242,13 @@ let shared l1 l2 = function
else
shared (e::t) t2;;
val shard = 'a list -> 'a list -> 'a list -> 'a list = <fun>
```
## Exercise 5.1
```Ocaml
let assos k l =
if (k < 0) then
invalid_arg "k not natural"
else
match l with
| e::t ->