1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677(** Functions for working with boolean ([true] or [false]) values. *)moduleBool=TableclothBool(** Functions for working with single characters. *)moduleChar=TableclothChar(** Functions for working with ["strings"] *)moduleString=TableclothString(** Fixed precision integers *)moduleInt=TableclothInt(** Functions for working with floating point numbers. *)moduleFloat=TableclothFloat(** Interfaces for use with container types like {!Array} or {!List} *)moduleContainer=TableclothContainer(** A fixed lenfth collection of values *)moduleArray=TableclothArray(** Arbitrary length, singly linked lists *)moduleList=TableclothList(** Functions for working with optional values. *)moduleOption=TableclothOption(** Functions for working with computations which may fail. *)moduleResult=structincludeTableclothResult(** [Result.pp err_format ok_format dest_format result] "pretty-prints"
the [result], using [err_format] if the [result] is an [Error] value or
[ok_format] if the [result] is an [Ok] value. [dest_format] is a formatter
that tells where to send the output.
{[
let good: (int, string) Result.t = Ok 42 in
let not_good: (int, string) Tablecloth.Result.t = Error "bad" in
Result.pp Format.pp_print_int Format.pp_print_string Format.std_formatter good;
Result.pp Format.pp_print_int Format.pp_print_string Format.std_formatter not_good;
Format.pp_print_newline Format.std_formatter ();
(* prints <ok: 42><error: bad>*)
]}
*)letpp(okf:Format.formatter->'ok->unit)(errf:Format.formatter->'error->unit)(fmt:Format.formatter)(r:('ok,'error)t):unit=matchrwith|Okok->Format.pp_print_stringfmt"<ok: ";okffmtok;Format.pp_print_stringfmt">"|Errorerr->Format.pp_print_stringfmt"<error: ";errffmterr;Format.pp_print_stringfmt">"end(** Functions for manipulating tuples of length two *)moduleTuple2=TableclothTuple2(** Functions for manipulating tuples of length three *)moduleTuple3=TableclothTuple3moduleComparator=TableclothComparator(** A collection of unique values *)moduleSet=TableclothSet(** A collection of key-value pairs *)moduleMap=TableclothMap(** Functions for working with functions. *)moduleFun=TableclothFun