vault backup: 2023-10-02 14:18:14

This commit is contained in:
2023-10-02 14:18:14 +02:00
parent 1d85a712b0
commit 3942739253
3 changed files with 39 additions and 8 deletions

View File

@ -0,0 +1,8 @@
## 1.1
```Ocaml
let product n =
if n = [] then
0
else
let rec p =

View File

@ -108,3 +108,12 @@ val t: int list = [2; 3]
1 +. length t;;
Warning : pattern matching not exhaustive
val length: 'a list -> int = <fun>
# let rec length = function
| [] -> 0
| _::t -> 1 + length t;;
(* with this solution there is no warning *)
val length : 'a list -> int = <fun>
```