xapi-stdext-pervasives

A deprecated collection of utility functions - Pervasives extension
IN THIS PACKAGE
val finally : ( unit -> 'a ) -> ( unit -> unit ) -> 'a

finally f g returns f () guaranteeing to run clean-up actions g () even if f () throws an exception.

val maybe_with_default : 'b -> ( 'a -> 'b ) -> 'a option -> 'b

maybe_with_default d f v is Some f c if v is Some c and d otherwise.

val may : ( 'a -> 'b ) -> 'a option -> 'b option

may f v is Some f c if v is Some c and None otherwise.

val default : 'a -> 'a option -> 'a

default d v is c if o is Some c and d otherwise.

val maybe : ( 'a -> unit ) -> 'a option -> unit

maybe f v is f c if v is Some c and () otherwise.

val reraise_if : bool -> ( unit -> unit ) -> unit

reraise bool fct runs fct (). If not bool ignores raised exceptions

val ignore_exn : ( unit -> unit ) -> unit

reraise bool fct runs fct (). If not bool ignores raised exceptions

val ignore_int : int -> unit
val ignore_int32 : int32 -> unit
val ignore_int64 : int64 -> unit
val ignore_string : string -> unit
val ignore_float : float -> unit
val ignore_bool : bool -> unit
val (++) : ( 'b -> 'c ) -> ( 'a -> 'b ) -> 'a -> 'c
val ($) : ( 'a -> 'b ) -> 'a -> 'b