Up – Package index » dream-httpaf » Sources » dream-httpaf.websocketaf » optional_thunk.mlSource file optional_thunk.ml dream-httpaf LICENSE README Library dream-httpaf Library dream-httpaf.gluten Library dream-httpaf.gluten-lwt Library dream-httpaf.gluten-lwt-unix Library dream-httpaf.h2 Library dream-httpaf.h2-lwt Library dream-httpaf.h2-lwt-unix Library dream-httpaf.hpack Library dream-httpaf.httpaf Library dream-httpaf.httpaf-lwt Library dream-httpaf.httpaf-lwt-unix Library dream-httpaf.websocketaf Library dream-httpaf.websocketaf-lwt Library dream-httpaf.websocketaf-lwt-unix Sources dream-httpaf dream-httpaf.gluten dream-httpaf.gluten-lwt dream-httpaf.gluten-lwt-unix dream-httpaf.h2 dream-httpaf.h2-lwt dream-httpaf.h2-lwt-unix dream-httpaf.hpack dream-httpaf.httpaf dream-httpaf.httpaf-lwt dream-httpaf.httpaf-lwt-unix dream-httpaf.websocketaf dream-httpaf.websocketaf-lwt dream-httpaf.websocketaf-lwt-unix 1
2
3
4
5
6
7
8
9
10
11
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