Commit 93f62bc2 authored by POTTIER Francois's avatar POTTIER Francois Committed by POTTIER Francois
Browse files

Add [Option.force].

parent 255cbcf1
......@@ -31,6 +31,12 @@ let fold f o accu =
| Some x ->
f x accu
let force = function
| Some x ->
x
| None ->
assert false
let project = function
| Some x ->
x
......
......@@ -14,6 +14,7 @@
val map: ('a -> 'b) -> 'a option -> 'b option
val iter: ('a -> unit) -> 'a option -> unit
val fold: ('a -> 'b -> 'b) -> 'a option -> 'b -> 'b
val force: 'a option -> 'a
val project: 'a option -> 'a (* careful: calls [exit 1] in case of failure *)
val equal: ('a -> 'b -> bool) -> 'a option -> 'b option -> bool
val hash: ('a -> int) -> 'a option -> int
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment