Module Utils

module Utils: sig .. end
Generic utilities

val get_opt_or_default : 'a -> 'a option -> 'a

Option types

get_opt_or_default default vopt returns default if vopt is None, the contents of vopt otherwise

val unsafe_get_opt : 'a option -> 'a
unsafe_get_opt vopt retrieves the contents of vopt. Raise Assert_failure if vopt is None.
val is_none : 'a option -> bool
is_none vopt tests if vopt is indeed None.

Timing


val time : (unit -> 'a) -> float * 'a
time f times the execution of function f and returns both the time taken and the result