19
19
(* for more details (enclosed in the file LICENSE). *)
20
20
(* *************************************************************************)
21
21
22
- open Sigs
22
+ open Signatures
23
23
24
24
(* * This section presents the functors which can be used to build patricia tree
25
25
maps and sets. *)
@@ -67,9 +67,9 @@ module MakeHeterogeneousMap(Key: HETEROGENEOUS_KEY)(Value: HETEROGENEOUS_VALUE)
67
67
disk, lazy evaluation and/or caching, adding size information for
68
68
constant time [cardinal] functions, etc.
69
69
70
- See {!node_impl} for the provided implementations of {!Sigs. NODE}, or create your own. *)
70
+ See {!node_impl} for the provided implementations of {!NODE}, or create your own. *)
71
71
72
- (* * Create a homogeneous map with a custom {!Sigs. NODE}. Also allows
72
+ (* * Create a homogeneous map with a custom {!NODE}. Also allows
73
73
customizing the map values *)
74
74
module MakeCustomMap
75
75
(Key : KEY )
@@ -81,7 +81,7 @@ module MakeCustomMap
81
81
and type 'm t = 'm Node. t
82
82
83
83
84
- (* * Create a homogeneous set with a custom {!Sigs. NODE}.
84
+ (* * Create a homogeneous set with a custom {!NODE}.
85
85
@since v0.10.0 *)
86
86
module MakeCustomSet
87
87
(Key : KEY )
@@ -90,7 +90,7 @@ module MakeCustomSet
90
90
with type elt = Key. t
91
91
and type 'a BaseMap. t = 'a Node. t
92
92
93
- (* * Create an heterogeneous map with a custom {!Sigs. NODE}. *)
93
+ (* * Create an heterogeneous map with a custom {!NODE}. *)
94
94
module MakeCustomHeterogeneousMap
95
95
(Key : HETEROGENEOUS_KEY )
96
96
(Value : HETEROGENEOUS_VALUE )
@@ -100,7 +100,7 @@ module MakeCustomHeterogeneousMap
100
100
and type ('k ,'m ) value = ('k,'m) Value. t
101
101
and type 'm t = 'm Node. t
102
102
103
- (* * Create an heterogeneous set with a custom {!Sigs. NODE}.
103
+ (* * Create an heterogeneous set with a custom {!NODE}.
104
104
@since v0.10.0 *)
105
105
module MakeCustomHeterogeneousSet
106
106
(Key : HETEROGENEOUS_KEY )
@@ -115,20 +115,20 @@ module MakeCustomHeterogeneousSet
115
115
if so they return it, else they return a new node with a new number.
116
116
With this unique numbering:
117
117
- [equal] and [compare] become constant time operations;
118
- - two maps with the same bindings (where keys are compared by {!Sigs. KEY.to_int} and
119
- values by {!Sigs. HASHED_VALUE.polyeq}) will always be physically equal;
120
- - functions that benefit from sharing, like {!Sigs. BASE_MAP.idempotent_union} and
121
- {!Sigs. BASE_MAP.idempotent_inter} will see improved performance;
118
+ - two maps with the same bindings (where keys are compared by {!KEY.to_int} and
119
+ values by {!HASHED_VALUE.polyeq}) will always be physically equal;
120
+ - functions that benefit from sharing, like {!BASE_MAP.idempotent_union} and
121
+ {!BASE_MAP.idempotent_inter} will see improved performance;
122
122
- constructors are slightly slower, as they now require a hash-table lookup;
123
123
- memory usage is increased: nodes store their tags inside themselves, and
124
124
a global hash-table of all built nodes must be maintained.
125
125
This is quickly amortized if multiple identical nodes are built,
126
126
as only one will be kept in memory.
127
127
- hash-consed maps assume their keys and values are immutable, where regular
128
128
maps can mutate values freely;
129
- - {b WARNING:} when using physical equality as {!Sigs. HASHED_VALUE.polyeq}, some
129
+ - {b WARNING:} when using physical equality as {!HASHED_VALUE.polyeq}, some
130
130
{b maps of different types may be given the same identifier}. See the end of
131
- the documentation of {!Sigs. HASHED_VALUE.polyeq} for details.
131
+ the documentation of {!HASHED_VALUE.polyeq} for details.
132
132
Note that this is the case in the default implementations {!HashedValue}
133
133
and {!HeterogeneousHashedValue}.
134
134
@@ -137,7 +137,7 @@ module MakeCustomHeterogeneousSet
137
137
twice with same arguments will lead to two numbering systems for identifiers,
138
138
and thus the types should not be considered compatible. *)
139
139
140
- (* * Hash-consed version of {!Sigs. MAP}. See {!hash_consed} for the differences between
140
+ (* * Hash-consed version of {!MAP}. See {!hash_consed} for the differences between
141
141
hash-consed and non hash-consed maps.
142
142
143
143
This is a generative functor, as calling it creates a new hash-table to store
@@ -153,7 +153,7 @@ module MakeHashconsedMap(Key: KEY)(Value: HASHED_VALUE)() : sig
153
153
include HASH_CONSED_OPERATIONS with type 'a t := 'a t (* * @inline *)
154
154
end
155
155
156
- (* * Hash-consed version of {!Sigs. SET}. See {!hash_consed} for the differences between
156
+ (* * Hash-consed version of {!SET}. See {!hash_consed} for the differences between
157
157
hash-consed and non hash-consed sets.
158
158
159
159
This is a generative functor, as calling it creates a new hash-table to store
@@ -169,7 +169,7 @@ module MakeHashconsedSet(Key: KEY)() : sig
169
169
include HASH_CONSED_OPERATIONS with type 'a t := t (* * @inline *)
170
170
end
171
171
172
- (* * Hash-consed version of {!Sigs. HETEROGENEOUS_SET}. See {!hash_consed} for the differences between
172
+ (* * Hash-consed version of {!HETEROGENEOUS_SET}. See {!hash_consed} for the differences between
173
173
hash-consed and non hash-consed sets.
174
174
175
175
This is a generative functor, as calling it creates a new hash-table to store
@@ -185,7 +185,7 @@ module MakeHashconsedHeterogeneousSet(Key: HETEROGENEOUS_KEY)() : sig
185
185
include HASH_CONSED_OPERATIONS with type 'a t := t (* * @inline *)
186
186
end
187
187
188
- (* * Hash-consed version of {!Sigs. HETEROGENEOUS_MAP}. See {!hash_consed} for the differences between
188
+ (* * Hash-consed version of {!HETEROGENEOUS_MAP}. See {!hash_consed} for the differences between
189
189
hash-consed and non hash-consed maps.
190
190
191
191
This is a generative functor, as calling it creates a new hash-table to store
0 commit comments