vault backup: 2023-09-11 16:18:42

This commit is contained in:
Louis Gallet 2023-09-11 16:18:42 +02:00
parent 0666f58d6f
commit 226cb54ea1
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -202,3 +202,16 @@ val rate_express : int -> float = <fun>
| x when x = "express" -> rate_express(kg)
| _ -> invalid_arg "Bad type of shipping class";;
val rate : string -> int -> float = <fun>
(*4th question*)
let price w (p1, p2, p3, p4) =
if w <=500 then p1
else if w <=1000 then p2
else if w <=2000 then p3
else if w <=3000 then p4
else failwith "Too heavy";;
val price = int -> 'a * 'a * 'a * 'a -> 'a = <fun>
```