git.annexia.org
/
goaljobs-goals.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
25fc7400d3587443ff64d6b21dd1c12fc9ee6aba
[goaljobs-goals.git]
/
utils.ml
1
open Printf
2
3
open Goaljobs
4
open Config
5
6
(* From supermin *)
7
let rec uniq ?(cmp = Pervasives.compare) = function
8
| [] -> []
9
| [x] -> [x]
10
| x :: y :: xs when cmp x y = 0 ->
11
uniq ~cmp (x :: xs)
12
| x :: y :: xs ->
13
x :: uniq ~cmp (y :: xs)
14
15
let sort_uniq ?(cmp = Pervasives.compare) xs =
16
let xs = List.sort cmp xs in
17
let xs = uniq ~cmp xs in
18
xs