extlib
A complete yet small extension for OCaml standard library (reduced, recommended)
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Library extLib
Raised when a global variable is accessed without first having been assigned a value. The parameter contains the name of the global.
val empty : string -> 'a t
Returns an new named empty global. The name of the global can be any string. It identifies the global and makes debugging easier.
val name : 'a t -> string
Retrieve the name of a global.
val set : 'a t -> 'a -> unit
Set the global value contents.
val get : 'a t -> 'a
Get the global value contents - raise Global_not_initialized if not defined.
val undef : 'a t -> unit
Reset the global value contents to undefined.
val isdef : 'a t -> bool
Return true
if the global value has been set.
val opt : 'a t -> 'a option
Return None
if the global is undefined, else Some v
where v is the current global value contents.