Module Support.Misc

Totally miscellaneous functions.

include module type of struct include Equality end
val (=) : int -> int -> bool

A restricted form of the equality operator that works only for integers.

Fully polymorphic equality is dangerous and limits refactorability of the code, so every module should open this one to avoid using polymorphic equality.

val noexcept : (unit -> unit) -> unit

Runs a function ignoring all exceptions. In general this is a terrible idea, but it is sometimes necessary when performing cleanup that may fail while in an exception handler.

exception NotImplemented of string

An exception to be raised in unimplemented features. * Code that raises this exception should never be committed.

val not_implemented : string -> 'a
val tuple : 'a -> 'b -> 'a * 'b

Forms the tuple of its two inputs.

val throw : exn -> 'b -> 'a

Creates a constant function that raises the given exception. Useful when eliminating option-types.