Regular.StdInterface that should support any regular data type.
A regular type is catch all term for all data types that are regular, like numbers, characters, strings and their algebraic closure. A proper term for such types would be inductive types. A regular type always has a concrete representation, it is printable, comparable (with total order), hashable, etc.
To contrast, functions, closures, proxies, descriptors, and any co-inductive types are non-regular. The main difference, is that regular type is self contained, where non-regular types, usually represent something that can be only observed, but not really represented with the data type.
On the border line we have Opaque data types. These are types, that pretend to be Regular, but we can't actually inspect their representation.
So what the library actually provides. First of all it defines the Regular interface, that each regular data type is expected to implement. This includes a full set of Io functions, that allows one to read, write and serialize values of the type (see Data interface). It also provides an interface for creating different collections from the values of that type, including trees, hashtables, maps, sets, etc. Also, it describes the whole algebra of comparison functions. For the opaque data types an interface called Opaque is provided, that is a proper subset of the Regular. It doesn't provide printing and serialization, but has everything that can be derived for a type with a total order (e.g., containers, comparison function, etc).
A functor is provided for each interface, that requires the minimal implementation, and derives the rest.
Finally, a Bytes module is provided that facilitates the transfer from mutable to immutable Strings. It is the extension of OCaml standard Bytes module, enhanced with the expected set of functions.
val bin_size_bytes : bytes Core_kernel.Bin_prot.Size.sizerval bin_write_bytes : bytes Core_kernel.Bin_prot.Write.writerval bin_writer_bytes : bytes Core_kernel.Bin_prot.Type_class.writerval bin_read_bytes : bytes Core_kernel.Bin_prot.Read.readerval __bin_read_bytes__ : (int -> bytes) Core_kernel.Bin_prot.Read.readerval bin_reader_bytes : bytes Core_kernel.Bin_prot.Type_class.readerval bin_bytes : bytes Core_kernel.Bin_prot.Type_class.tval sexp_of_bytes : bytes -> Ppx_sexp_conv_lib.Sexp.tval bytes_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> bytesEach type class is an abstraction of a tuple of function.
val bin_size_digest : digest Core_kernel.Bin_prot.Size.sizerval bin_write_digest : digest Core_kernel.Bin_prot.Write.writerval bin_writer_digest : digest Core_kernel.Bin_prot.Type_class.writerval bin_read_digest : digest Core_kernel.Bin_prot.Read.readerval __bin_read_digest__ : (int -> digest) Core_kernel.Bin_prot.Read.readerval bin_reader_digest : digest Core_kernel.Bin_prot.Type_class.readerval bin_digest : digest Core_kernel.Bin_prot.Type_class.tval sexp_of_digest : digest -> Ppx_sexp_conv_lib.Sexp.tval digest_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> digest'a printer constructs a printer type for arbitrary type 'a.
A value of type 'a printer is a function that is expected by the %a specifier of the Format.printf family of functions.
module Printable : sig ... endPrintable data structures.
module Seq : sig ... endLazy sequence.
type 'a seq = 'a Seq.tAbbreviation for 'a Sequence.t
val bin_size_seq :
'a Core_kernel.Bin_prot.Size.sizer ->
'a seq Core_kernel.Bin_prot.Size.sizerval bin_write_seq :
'a Core_kernel.Bin_prot.Write.writer ->
'a seq Core_kernel.Bin_prot.Write.writerval bin_writer_seq :
'a Core_kernel.Bin_prot.Type_class.writer ->
'a seq Core_kernel.Bin_prot.Type_class.writerval bin_read_seq :
'a Core_kernel.Bin_prot.Read.reader ->
'a seq Core_kernel.Bin_prot.Read.readerval __bin_read_seq__ :
'a Core_kernel.Bin_prot.Read.reader ->
(int -> 'a seq) Core_kernel.Bin_prot.Read.readerval bin_reader_seq :
'a Core_kernel.Bin_prot.Type_class.reader ->
'a seq Core_kernel.Bin_prot.Type_class.readerval bin_seq :
'a Core_kernel.Bin_prot.Type_class.t ->
'a seq Core_kernel.Bin_prot.Type_class.tval sexp_of_seq :
('a -> Ppx_sexp_conv_lib.Sexp.t) ->
'a seq ->
Ppx_sexp_conv_lib.Sexp.tval seq_of_sexp :
(Ppx_sexp_conv_lib.Sexp.t -> 'a) ->
Ppx_sexp_conv_lib.Sexp.t ->
'a seqmodule Data : sig ... endData types support module.
module Regular : sig ... endRegular types models a general concept of value, i.e., something that can be used in way similar to regular int, string, char and other built in types. So that it can be compared, used in maps, sets, hashtables, printer, etc.
module Opaque : sig ... endOpaque type is like regular type, except that we can print or examine it in any way. So it can't be serialized or pretty-printed. An Opaque.Make can create an instances of such type.
module Bytes : sig ... endExtension of the standard bytes module.