7 lines
171 B
OCaml
7 lines
171 B
OCaml
let rec is_ordered l = match l with
|
|
| a::b::q -> a <= b && is_ordered (b::q)
|
|
| _ -> true;;
|
|
|
|
assert (is_ordered [1; 5; 6]);;
|
|
assert (not (is_ordered [5.6; 7.8; 3.]));;
|