X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=ocaml%2Flistx.ml;h=821e281d5e9d94fa426b6aa2bb62fcccff2efc53;hb=f7a60345135a4032bf63a7dc650bcc9fe30aa30a;hp=ecc8a920f1019c94abe3238780dccf21618c2473;hpb=e4aa4a66dd0a4946607245a0f43eab803f2770c4;p=fireball-separation.git diff --git a/ocaml/listx.ml b/ocaml/listx.ml index ecc8a92..821e281 100644 --- a/ocaml/listx.ml +++ b/ocaml/listx.ml @@ -56,6 +56,10 @@ let rec max = | Nil x -> x | Cons (x, l) -> Pervasives.max x (max l) +let rec last = + function + | Nil x -> x + | Cons (_, l) -> last l (* let rec nth i l = match l, i with | Cons (x, _), 1 -> x @@ -65,4 +69,3 @@ let rec nth i l = match l, i with | Nil _, _ -> raise (Invalid_argument "Listx.nth") ;; *) -