Sorting algorithms/Insertion sort: Difference between revisions
→OCaml: clean-up & simplify
m (→{{header|Pascal}}: cosmetic) |
(→OCaml: clean-up & simplify) |
||
Line 3,727:
=={{header|OCaml}}==
<syntaxhighlight lang="ocaml">let rec insert lst x =
match lst with
| y
|
▲let insertion_sort = List.fold_left insert [];;
|> insertion_sort |> List.iter (Printf.printf " %u") |> print_newline</syntaxhighlight>
{{out}}
<pre> 1 2 3 4 5 6 7 8 9</pre>
=={{header|Oforth}}==
|