Module Common

module Common: sig .. end
Basic types and definitions required throughout the system.

exception Bug of string
exception Finally of exn * exn
Raised when finalization after an exception failed, too. The first exception argument is the one raised by the initial function, the second exception the one raised by the finalizer.
exception Unimplemented of string
val unimplemented : string -> 'a Or_error.t
type decimal = float 
val sexp_of_decimal : decimal -> Sexplib.Sexp.t
val decimal_of_sexp : Sexplib.Sexp.t -> decimal
val bin_size_decimal : decimal Bin_prot.Size.sizer
val bin_write_decimal : decimal Bin_prot.Write_ml.writer
val bin_write_decimal_ : decimal Bin_prot.Unsafe_write_c.writer
val bin_writer_decimal : decimal Bin_prot.Type_class.writer
val bin_read_decimal : decimal Bin_prot.Read_ml.reader
val bin_read_decimal_ : decimal Bin_prot.Unsafe_read_c.reader
val bin_read_decimal__ : (int -> decimal) Bin_prot.Unsafe_read_c.reader
val bin_reader_decimal : decimal Bin_prot.Type_class.reader
val bin_decimal : decimal Bin_prot.Type_class.t
type passfail = 
| Pass
| Fail of string
type read_only 
Handy types for marking things read-only and read-write. One should not expose functions for converting between read_only/immutable/read_write because the private types expose the subtyping. Users would say "(db :> read_only Db.t)" to cast. The difference between read-only and immutable is that someone else can change a read-only object, while immutable never changes.
val bin_size_read_only : read_only Bin_prot.Size.sizer
val bin_write_read_only : read_only Bin_prot.Write_ml.writer
val bin_write_read_only_ : read_only Bin_prot.Unsafe_write_c.writer
val bin_writer_read_only : read_only Bin_prot.Type_class.writer
val bin_read_read_only : read_only Bin_prot.Read_ml.reader
val bin_read_read_only_ : read_only Bin_prot.Unsafe_read_c.reader
val bin_read_read_only__ : (int -> read_only) Bin_prot.Unsafe_read_c.reader
val bin_reader_read_only : read_only Bin_prot.Type_class.reader
val bin_read_only : read_only Bin_prot.Type_class.t
val sexp_of_read_only : read_only -> Sexplib.Sexp.t
val read_only_of_sexp : Sexplib.Sexp.t -> read_only
type immutable = private read_only 
val bin_size_immutable : immutable Bin_prot.Size.sizer
val bin_write_immutable : immutable Bin_prot.Write_ml.writer
val bin_write_immutable_ : immutable Bin_prot.Unsafe_write_c.writer
val bin_writer_immutable : immutable Bin_prot.Type_class.writer
val bin_read_immutable : immutable Bin_prot.Read_ml.reader
val bin_read_immutable_ : immutable Bin_prot.Unsafe_read_c.reader
val bin_read_immutable__ : (int -> immutable) Bin_prot.Unsafe_read_c.reader
val bin_reader_immutable : immutable Bin_prot.Type_class.reader
val bin_immutable : immutable Bin_prot.Type_class.t
val sexp_of_immutable : immutable -> Sexplib.Sexp.t
val immutable_of_sexp : Sexplib.Sexp.t -> immutable
type read_write = private read_only 
val bin_size_read_write : read_write Bin_prot.Size.sizer
val bin_write_read_write : read_write Bin_prot.Write_ml.writer
val bin_write_read_write_ : read_write Bin_prot.Unsafe_write_c.writer
val bin_writer_read_write : read_write Bin_prot.Type_class.writer
val bin_read_read_write : read_write Bin_prot.Read_ml.reader
val bin_read_read_write_ : read_write Bin_prot.Unsafe_read_c.reader
val bin_read_read_write__ : (int -> read_write) Bin_prot.Unsafe_read_c.reader
val bin_reader_read_write : read_write Bin_prot.Type_class.reader
val bin_read_write : read_write Bin_prot.Type_class.t
val sexp_of_read_write : read_write -> Sexplib.Sexp.t
val read_write_of_sexp : Sexplib.Sexp.t -> read_write
type write_only 
val bin_size_write_only : write_only Bin_prot.Size.sizer
val bin_write_write_only : write_only Bin_prot.Write_ml.writer
val bin_write_write_only_ : write_only Bin_prot.Unsafe_write_c.writer
val bin_writer_write_only : write_only Bin_prot.Type_class.writer
val bin_read_write_only : write_only Bin_prot.Read_ml.reader
val bin_read_write_only_ : write_only Bin_prot.Unsafe_read_c.reader
val bin_read_write_only__ : (int -> write_only) Bin_prot.Unsafe_read_c.reader
val bin_reader_write_only : write_only Bin_prot.Type_class.reader
val bin_write_only : write_only Bin_prot.Type_class.t
val sexp_of_write_only : write_only -> Sexplib.Sexp.t
val write_only_of_sexp : Sexplib.Sexp.t -> write_only
type never_returns 
never_returns should be used as the return type of functions that don't return and might block forever, rather than 'a or _. This forces callers of such functions to have a call to never_returns at the call site, which makes it clear to readers what's going on. We do not intend to use this type for functions such as failwithf that always raise an exception.
val never_returns : never_returns -> 'a

Error handling

val protect : f:(unit -> 'a) -> finally:(unit -> unit) -> 'a
See exn.mli
val protectx : f:('b -> 'a) -> 'b -> finally:('b -> unit) -> 'a

Input Output

val read_wrap : ?binary:'a -> f:'b -> 'c -> [ `Deprecated_use_In_channel_with_file ]
val write_wrap : ?binary:'a -> f:'b -> 'c -> [ `Deprecated_use_Out_channel_with_file ]
val write_lines : 'a -> 'b -> [ `Deprecated_use_Out_channel_write_lines ]
val input_lines : ?fix_win_eol:'a -> 'b -> [ `Deprecated_use_In_channel_input_lines ]
val read_lines : 'a -> [ `Deprecated_use_In_channel_read_lines ]
val fst3 : 'a * 'b * 'c -> 'a
triple handling

val snd3 : 'b * 'a * 'c -> 'a
val trd3 : 'b * 'c * 'a -> 'a
val uw : 'a option -> 'a
Option handling

val is_none : 'a option -> bool
val is_some : 'a option -> bool
val (|!) : 'a -> ('a -> 'b) -> 'b
Functions from function.ml

val ident : 'a -> 'a
val const : 'a -> 'b -> 'a
val (==>) : bool -> bool -> bool
val ascending : 'a -> 'a -> int
A comparator that returns results in ascending order.

A comparator that returns results in descending order.

val descending : 'a -> 'a -> int
val (^/) : string -> string -> string
same as Filename.concat
val failwiths : string -> 'a -> ('a -> Sexplib.Sexp.t) -> 'b
val failwithf : ('r, unit, string, unit -> 'a) Pervasives.format4 -> 'r
val invalid_argf : ('r, unit, string, unit -> 'a) Pervasives.format4 -> 'r
val sexp_of_a : 'a -> Sexplib.Sexp.t
val sexp_of_a1 : 'a -> Sexplib.Sexp.t
val sexp_of_a2 : 'a -> Sexplib.Sexp.t
val sexp_of_a3 : 'a -> Sexplib.Sexp.t
val sexp_of_a4 : 'a -> Sexplib.Sexp.t
val sexp_of_a5 : 'a -> Sexplib.Sexp.t
val sexp_of_b : 'a -> Sexplib.Sexp.t
val sexp_of_c : 'a -> Sexplib.Sexp.t
val sexp_of_d : 'a -> Sexplib.Sexp.t
val sexp_of_e : 'a -> Sexplib.Sexp.t
type 'a return = private {
   return :'b. 'a -> 'b;
}
val with_return : ('a return -> 'a) -> 'a
val equal : 'a -> 'a -> bool
toplevel binding for polymorphic equality (=). Named for easy use in labelled arguments (one can do f x y ~equal).
val phys_equal : 'a -> 'a -> bool
val (==) : 'a -> 'a -> [ `Consider_using_phys_equal ]
val (!=) : 'a -> 'a -> [ `Consider_using_phys_equal ]
val force : 'a Lazy.t -> 'a
val seek_out : [ `Deprecated_use_out_channel ]
val pos_out : [ `Deprecated_use_out_channel ]
val out_channel_length : [ `Deprecated_use_out_channel ]
val seek_in : [ `Deprecated_use_in_channel ]
val pos_in : [ `Deprecated_use_in_channel ]
val in_channel_length : [ `Deprecated_use_in_channel ]
val modf : [ `Deprecated_use_float_modf ]
val truncate : [ `Deprecated_use_float_iround_towards_zero ]
val close_in : In_channel.t -> unit
we have our own version of these two, the INRIA version doesn't release the runtime lock.
val close_out : Pervasives.out_channel -> unit
val stage : 'a -> 'a Staged.t
val unstage : 'a Staged.t -> 'a