Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*3*)
- type product = {nazwa : string; cena: float; ilosc: int};;
- let prod_list = [{nazwa = "apple"; cena = 90.0; ilosc = 0};{nazwa = "plum"; cena = 1.4; ilosc = 3};{nazwa = "cherry"; cena = 15.5; ilosc = 7}];;
- exception My_exception;;
- let findprod li =
- try (List.find (fun x -> x.cena>100. && x.ilosc = 0) li )
- with Not_found -> raise(My_exception);;
- findprod prod_list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement