RosettaCodeData/Task/Order-two-numerical-lists/OCaml/order-two-numerical-lists-3.ocaml
2015-11-18 06:14:39 +00:00

8 lines
198 B
Text

let rec ordered_lists = function
| x1::tl1, x2::tl2 ->
(match compare x1 x2 with
| 0 -> ordered_lists (tl1, tl2)
| 1 -> false
| _ -> true)
| [], _ -> true
| _ -> false