package xapi-stdext-pervasives

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
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.

  • deprecated Replace with Option.fold
val may : ('a -> 'b) -> 'a option -> 'b option

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

  • deprecated Replace with Option.map
val default : 'a -> 'a option -> 'a

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

  • deprecated Replace with Option.value
val maybe : ('a -> unit) -> 'a option -> unit

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

  • deprecated Replace with Option.iter
val reraise_if : bool -> (unit -> unit) -> unit

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

  • deprecated Use ignore_exn instead
val ignore_exn : (unit -> unit) -> unit
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
  • deprecated Not a standard idiom. Define it locally if needed.
val ($) : ('a -> 'b) -> 'a -> 'b
  • deprecated Not right-associative. Replace with @@