module Datatype:sig..end
A datatype provides useful values for types. It is a high-level API on top
of module Type.
type 'a t = private {
|
equal : |
|
compare : |
|
hash : |
|
copy : |
|
internal_pretty_code : |
|
pretty_code : |
|
pretty : |
|
varname : |
|
mem_project : |
}
Values associated to each datatype.
Some others are provided directly in module Type.
module type Ty =sig..end
A type with its type value.
module type S_no_copy =sig..end
All values associated to a datatype, excepted copy.
module type S =sig..end
All values associated to a datatype.
val info : 'a Type.t -> 'a t
val equal : 'a Type.t -> 'a -> 'a -> bool
val compare : 'a Type.t -> 'a -> 'a -> int
val hash : 'a Type.t -> 'a -> int
val copy : 'a Type.t -> 'a -> 'a
val internal_pretty_code : 'a Type.t -> Type.precedence -> Stdlib.Format.formatter -> 'a -> unit
val pretty_code : 'a Type.t -> Stdlib.Format.formatter -> 'a -> unit
val pretty : 'a Type.t -> Stdlib.Format.formatter -> 'a -> unit
val varname : 'a Type.t -> 'a -> string
val mem_project : 'a Type.t -> (Project_skeleton.t -> bool) -> 'a -> boolval undefined : 'a -> 'bMust be used if you don't want to implement a required function.
val identity : 'a -> 'aMust be used if you want to implement a required function by fun x ->. Only useful for implementing
xrehash and copy.
val from_compare : 'a -> 'a -> boolMust be used for equal in order to implement it by compare x y = 0
(with your own compare function).
val from_pretty_code : Stdlib.Format.formatter -> 'a -> unitMust be used for pretty in order to implement it by pretty_code
provided by the datatype from your own internal_pretty_code function.
val never_any_project : (Project_skeleton.t -> bool) -> 'a -> boolMust be used for mem_project if values of your type does never contain
any project.
val pp_fail : Type.precedence -> Stdlib.Format.formatter -> 'a -> unitMust be used for internal_pretty_code if this pretty-printer must
fail only when called.
module type Undefined =sig..end
Sub-signature of Datatype.S.
module Undefined:Undefined
Each values in these modules are undefined.
module Serializable_undefined:Undefined
Same as Datatype.Undefined, but the type is supposed to be marshallable by the
standard OCaml way (in particular, no hash-consing or projects inside
the type).
module type Make_input =sig..end
Input signature of Datatype.Make and Datatype.Make_with_collections.
module Make:
Generic datatype builder.
module type Functor_info =sig..end
Additional info for building Set, Map and Hashtbl.
module type Set =sig..end
A standard OCaml set signature extended with datatype operations.
module type Map =sig..end
A standard OCaml map signature extended with datatype operations.
module type Hashtbl_with_descr =sig..end
Marshallable collectors with hashtbl-like interface.
module type Hashtbl =sig..end
A standard OCaml hashtbl signature extended with datatype operations.
module type S_with_collections =sig..end
A datatype for a type t extended with predefined set, map and hashtbl
over t.
module Make_with_collections:
Generic comparable datatype builder: functions equal, compare and
hash must not be Datatype.undefined.
module With_collections:
Add sets, maps and hashtables modules to an existing datatype, provided the
equal, compare and hash functions are not Datatype.undefined.
module Unit:S_with_collectionswith type t = unit
val unit : unit Type.tmodule Bool:S_with_collectionswith type t = bool
val bool : bool Type.tmodule Int:S_with_collectionswith type t = int
val int : int Type.tmodule Int32:S_with_collectionswith type t = int32
val int32 : int32 Type.t
module Int64:S_with_collectionswith type t = int64
val int64 : int64 Type.t
module Nativeint:S_with_collectionswith type t = nativeint
val nativeint : nativeint Type.t
module Float:S_with_collectionswith type t = float
val float : float Type.t
module Char:S_with_collectionswith type t = char
val char : char Type.tmodule String:S_with_collectionswith type t = string
val string : string Type.tmodule Formatter:Swith type t = Format.formatter
val formatter : Stdlib.Format.formatter Type.t
module Integer:S_with_collectionswith type t = Integer.t
val integer : Integer.t Type.t
module Filepath:sig..end
Type-safe strings representing normalized filepaths.
module type Polymorphic =sig..end
Output signature of Datatype.Polymorphic.
module Polymorphic:functor (P:siginclude Type.Polymorphic_inputval mk_equal :('a -> 'a -> bool) -> 'a Datatype.t -> 'a Datatype.t -> boolval mk_compare :('a -> 'a -> int) -> 'a Datatype.t -> 'a Datatype.t -> intval mk_hash :('a -> int) -> 'a Datatype.t -> intval map :('a -> 'a) -> 'a Datatype.t -> 'a Datatype.tval mk_internal_pretty_code :(Type.precedence -> Stdlib.Format.formatter -> 'a -> unit) ->
Type.precedence -> Stdlib.Format.formatter -> 'a Datatype.t -> unitval mk_pretty :(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter -> 'a Datatype.t -> unitval mk_varname :('a -> string) -> 'a Datatype.t -> stringval mk_mem_project :((Project_skeleton.t -> bool) -> 'a -> bool) ->
(Project_skeleton.t -> bool) -> 'a Datatype.t -> boolend) ->Polymorphicwith type 'a poly = 'a P.t
Functor for polymorphic types with only 1 type variable.
module type Polymorphic2 =sig..end
Output signature of Datatype.Polymorphic2.
module Polymorphic2:functor (P:siginclude Type.Polymorphic2_inputval mk_equal :('a -> 'a -> bool) ->
('b -> 'b -> bool) -> ('a, 'b) Datatype.t -> ('a, 'b) Datatype.t -> boolval mk_compare :('a -> 'a -> int) ->
('b -> 'b -> int) -> ('a, 'b) Datatype.t -> ('a, 'b) Datatype.t -> intval mk_hash :('a -> int) -> ('b -> int) -> ('a, 'b) Datatype.t -> intval map :('a -> 'a) -> ('b -> 'b) -> ('a, 'b) Datatype.t -> ('a, 'b) Datatype.tval mk_internal_pretty_code :(Type.precedence -> Stdlib.Format.formatter -> 'a -> unit) ->
(Type.precedence -> Stdlib.Format.formatter -> 'b -> unit) ->
Type.precedence -> Stdlib.Format.formatter -> ('a, 'b) Datatype.t -> unitval mk_pretty :(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'b -> unit) ->
Stdlib.Format.formatter -> ('a, 'b) Datatype.t -> unitval mk_varname :('a -> string) -> ('b -> string) -> ('a, 'b) Datatype.t -> stringval mk_mem_project :((Project_skeleton.t -> bool) -> 'a -> bool) ->
((Project_skeleton.t -> bool) -> 'b -> bool) ->
(Project_skeleton.t -> bool) -> ('a, 'b) Datatype.t -> boolend) ->Polymorphic2with type ('a, 'b) poly = ('a, 'b) P.t
Functor for polymorphic types with 2 type variables.
module type Polymorphic3 =sig..end
Output signature of Datatype.Polymorphic3.
module Polymorphic3:functor (P:siginclude Type.Polymorphic3_inputval mk_equal :('a -> 'a -> bool) ->
('b -> 'b -> bool) ->
('c -> 'c -> bool) ->
('a, 'b, 'c) Datatype.t -> ('a, 'b, 'c) Datatype.t -> boolval mk_compare :('a -> 'a -> int) ->
('b -> 'b -> int) ->
('c -> 'c -> int) ->
('a, 'b, 'c) Datatype.t -> ('a, 'b, 'c) Datatype.t -> intval mk_hash :('a -> int) -> ('b -> int) -> ('c -> int) -> ('a, 'b, 'c) Datatype.t -> intval map :('a -> 'a) ->
('b -> 'b) ->
('c -> 'c) -> ('a, 'b, 'c) Datatype.t -> ('a, 'b, 'c) Datatype.tval mk_internal_pretty_code :(Type.precedence -> Stdlib.Format.formatter -> 'a -> unit) ->
(Type.precedence -> Stdlib.Format.formatter -> 'b -> unit) ->
(Type.precedence -> Stdlib.Format.formatter -> 'c -> unit) ->
Type.precedence -> Stdlib.Format.formatter -> ('a, 'b, 'c) Datatype.t -> unitval mk_pretty :(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'b -> unit) ->
(Stdlib.Format.formatter -> 'c -> unit) ->
Stdlib.Format.formatter -> ('a, 'b, 'c) Datatype.t -> unitval mk_varname :('a -> string) ->
('b -> string) -> ('c -> string) -> ('a, 'b, 'c) Datatype.t -> stringval mk_mem_project :((Project_skeleton.t -> bool) -> 'a -> bool) ->
((Project_skeleton.t -> bool) -> 'b -> bool) ->
((Project_skeleton.t -> bool) -> 'c -> bool) ->
(Project_skeleton.t -> bool) -> ('a, 'b, 'c) Datatype.t -> boolend) ->Polymorphic3with type ('a, 'b, 'c) poly = ('a, 'b, 'c) P.t
Functor for polymorphic types with 3 type variables.
module type Polymorphic4 =sig..end
Output signature of Datatype.Polymorphic4.
module Polymorphic4:functor (P:siginclude Type.Polymorphic4_inputval mk_equal :('a -> 'a -> bool) ->
('b -> 'b -> bool) ->
('c -> 'c -> bool) ->
('d -> 'd -> bool) ->
('a, 'b, 'c, 'd) Datatype.t -> ('a, 'b, 'c, 'd) Datatype.t -> boolval mk_compare :('a -> 'a -> int) ->
('b -> 'b -> int) ->
('c -> 'c -> int) ->
('d -> 'd -> int) ->
('a, 'b, 'c, 'd) Datatype.t -> ('a, 'b, 'c, 'd) Datatype.t -> intval mk_hash :('a -> int) ->
('b -> int) ->
('c -> int) -> ('d -> int) -> ('a, 'b, 'c, 'd) Datatype.t -> intval map :('a -> 'a) ->
('b -> 'b) ->
('c -> 'c) ->
('d -> 'd) -> ('a, 'b, 'c, 'd) Datatype.t -> ('a, 'b, 'c, 'd) Datatype.tval mk_internal_pretty_code :(Type.precedence -> Stdlib.Format.formatter -> 'a -> unit) ->
(Type.precedence -> Stdlib.Format.formatter -> 'b -> unit) ->
(Type.precedence -> Stdlib.Format.formatter -> 'c -> unit) ->
(Type.precedence -> Stdlib.Format.formatter -> 'd -> unit) ->
Type.precedence ->
Stdlib.Format.formatter -> ('a, 'b, 'c, 'd) Datatype.t -> unitval mk_pretty :(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'b -> unit) ->
(Stdlib.Format.formatter -> 'c -> unit) ->
(Stdlib.Format.formatter -> 'd -> unit) ->
Stdlib.Format.formatter -> ('a, 'b, 'c, 'd) Datatype.t -> unitval mk_varname :('a -> string) ->
('b -> string) ->
('c -> string) -> ('d -> string) -> ('a, 'b, 'c, 'd) Datatype.t -> stringval mk_mem_project :((Project_skeleton.t -> bool) -> 'a -> bool) ->
((Project_skeleton.t -> bool) -> 'b -> bool) ->
((Project_skeleton.t -> bool) -> 'c -> bool) ->
((Project_skeleton.t -> bool) -> 'd -> bool) ->
(Project_skeleton.t -> bool) -> ('a, 'b, 'c, 'd) Datatype.t -> boolend) ->Polymorphic4with type ('a, 'b, 'c, 'd) poly = ('a, 'b, 'c, 'd) P.t
Functor for polymorphic types with 4 type variables.
module Poly_pair:Polymorphic2with type ('a, 'b) poly = 'a * 'b
module Pair:
module Pair_with_collections:
val pair : 'a Type.t -> 'b Type.t -> ('a * 'b) Type.t
module Poly_ref:Polymorphicwith type 'a poly = 'a ref
module Ref:
val t_ref : 'a Type.t -> 'a Stdlib.ref Type.t
module Poly_option:Polymorphicwith type 'a poly = 'a option
module Option:
module Option_with_collections:
val option : 'a Type.t -> 'a option Type.t
module Poly_list:Polymorphicwith type 'a poly = 'a list
module List:
module List_with_collections:
val list : 'a Type.t -> 'a list Type.tmodule Poly_array:Polymorphicwith type 'a poly = 'a array
module Array:
module Array_with_collections:
val array : 'a Type.t -> 'a array Type.tmodule Poly_queue:Polymorphicwith type 'a poly = 'a Queue.t
val queue : 'a Type.t -> 'a Stdlib.Queue.t Type.t
module Queue:
module Triple:
val triple : 'a Type.t -> 'b Type.t -> 'c Type.t -> ('a * 'b * 'c) Type.tmodule Triple_with_collections:
module Quadruple:
val quadruple : 'a Type.t ->
'b Type.t -> 'c Type.t -> 'd Type.t -> ('a * 'b * 'c * 'd) Type.tmodule Quadruple_with_collections:
module Function:functor (T1:siginclude Datatype.Sval label :(string * (unit -> Datatype.t) option) optionend) ->
val func : ?label:string * (unit -> 'a) option ->
'a Type.t -> 'b Type.t -> ('a -> 'b) Type.tval optlabel_func : string -> (unit -> 'a) -> 'a Type.t -> 'b Type.t -> ('a -> 'b) Type.toptlabel_func lab dft ty1 ty2 is equivalent to
func ~label:(lab, Some dft) ty1 ty2
val func2 : ?label1:string * (unit -> 'a) option ->
'a Type.t ->
?label2:string * (unit -> 'b) option ->
'b Type.t -> 'c Type.t -> ('a -> 'b -> 'c) Type.tval func3 : ?label1:string * (unit -> 'a) option ->
'a Type.t ->
?label2:string * (unit -> 'b) option ->
'b Type.t ->
?label3:string * (unit -> 'c) option ->
'c Type.t -> 'd Type.t -> ('a -> 'b -> 'c -> 'd) Type.tval func4 : ?label1:string * (unit -> 'a) option ->
'a Type.t ->
?label2:string * (unit -> 'b) option ->
'b Type.t ->
?label3:string * (unit -> 'c) option ->
'c Type.t ->
?label4:string * (unit -> 'd) option ->
'd Type.t -> 'e Type.t -> ('a -> 'b -> 'c -> 'd -> 'e) Type.t
module Set:
module Map:functor (M:Stdlib.Map.S) ->functor (Key:Swith type t = M.key) ->functor (Info:Functor_info) ->Mapwith type 'a t = 'a M.t and type key = M.key and module Key = Key
module Hashtbl:functor (H:Hashtbl_with_descr) ->functor (Key:Swith type t = H.key) ->functor (Info:Functor_info) ->Hashtblwith type 'a t = 'a H.t and type key = H.key and module Key = Key
module type Sub_caml_weak_hashtbl =sig..end
module Caml_weak_hashtbl:
module Weak: