This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
12
unikernel/duniverse/httpun/lib/optional_thunk.ml
Normal file
12
unikernel/duniverse/httpun/lib/optional_thunk.ml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
type t = unit -> unit
|
||||
|
||||
let none = Sys.opaque_identity (fun () -> ())
|
||||
let some f =
|
||||
if f == none
|
||||
then failwith "Optional_thunk: this function is not representable as a some value";
|
||||
f
|
||||
|
||||
let is_none t = t == none
|
||||
let is_some t = not (is_none t)
|
||||
let call_if_some t = t ()
|
||||
let unchecked_value t = t
|
||||
Loading…
Add table
Add a link
Reference in a new issue