diff options
Diffstat (limited to 'lib/util.ml')
-rw-r--r-- | lib/util.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml index 885278da7..441cf3744 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -559,6 +559,10 @@ let option_app f = function | None -> None | Some x -> Some (f x) +let option_cons a l = match a with + | Some x -> x::l + | None -> l + let option_fold_left2 f e a b = match (a,b) with | Some x, Some y -> f e x y | _ -> e |