git.annexia.org
/
goaljobs-goals.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Temporarily ignore graphviz.
[goaljobs-goals.git]
/
utils.ml
diff --git
a/utils.ml
b/utils.ml
index
25fc740
..
43119ee
100644
(file)
--- a/
utils.ml
+++ b/
utils.ml
@@
-16,3
+16,10
@@
let sort_uniq ?(cmp = Pervasives.compare) xs =
let xs = List.sort cmp xs in
let xs = uniq ~cmp xs in
xs
let xs = List.sort cmp xs in
let xs = uniq ~cmp xs in
xs
+
+let rec filter_map f = function
+ | [] -> []
+ | x :: xs ->
+ match f x with
+ | Some y -> y :: filter_map f xs
+ | None -> filter_map f xs