5
5
< link rel ="stylesheet " href ="../api_static/style.css " type ="text/css ">
6
6
< script src ="../api_static//highlight.pack.js "> </ script >
7
7
< script src ="../api_static//script.js "> </ script >
8
- < script > hljs . initHighlightingOnLoad ( ) ; </ script >
8
+ < script > hljs . initHighlightingOnLoad ( ) ; </ script >
9
9
< meta charset ="utf8 ">
10
10
< link rel ="previous " href ="Belt.HashSet.html "> < link rel ="next " href ="Belt.Option.html ">
11
- < title > Belt.HashMap </ title > </ head >
11
+ < title > Belt.HashMap </ title > </ head >
12
12
< body >
13
13
< nav class ="module-index "> < ul > < li > < a href ="Belt.html "> Belt</ a > </ li >
14
14
< li > < a href ="Belt_Array.html "> Belt_Array</ a > </ li >
@@ -108,38 +108,38 @@ <h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
108
108
109
109
It also has two specialized inner modules
110
110
< code class ="code "> Belt.HashMap.Int</ code > and < code class ="code "> Belt.HashMap.String</ code > < br >
111
-
111
+
112
112
</ div >
113
-
113
+
114
114
</ div >
115
115
116
116
< hr width ="100% ">
117
117
118
- < pre > < span class ="keyword "> module</ span > < a href ="Belt_HashMap.Int.html "> Int</ a > : < code class ="type "> < a href ="Belt_HashMapInt.html "> Belt_HashMapInt</ a > </ code > </ pre > < div class ="info ">
118
+ < pre > < span class ="keyword "> module</ span > < a href ="Belt_HashMap.Int.html "> Int</ a > : < code class ="type "> < a href ="Belt_HashMapInt.html "> Belt_HashMapInt</ a > </ code > </ pre > < div class ="info ">
119
119
< div class ="not-examples ">
120
120
Specalized when key type is < code class ="code "> int</ code > , more efficient
121
- than the gerneic type< br >
122
-
121
+ than the generic type< br >
122
+
123
+ </ div >
123
124
</ div >
124
- </ div >
125
- < pre > < span class ="keyword "> module</ span > < a href ="Belt_HashMap.String.html "> String</ a > : < code class ="type "> < a href ="Belt_HashMapString.html "> Belt_HashMapString</ a > </ code > </ pre > < div class ="info ">
125
+ < pre > < span class ="keyword "> module</ span > < a href ="Belt_HashMap.String.html "> String</ a > : < code class ="type "> < a href ="Belt_HashMapString.html "> Belt_HashMapString</ a > </ code > </ pre > < div class ="info ">
126
126
< div class ="not-examples ">
127
127
Specalized when key type is < code class ="code "> string</ code > , more efficient
128
- than the gerneic type< br >
129
-
128
+ than the generic type< br >
129
+
130
130
</ div >
131
131
</ div > < div class ="type-declaration ">
132
132
< pre > < span id ="TYPEt "> < span class ="keyword "> type</ span > < code class ="type "> ('key, 'value, 'id)</ code > t</ span > </ pre >
133
133
</ div >
134
134
< div class ="info ">
135
135
< div class ="not-examples ">
136
136
The type of hash tables from type < code class ="code "> 'key</ code > to type < code class ="code "> 'value</ code > .< br >
137
-
137
+
138
138
</ div >
139
-
139
+
140
140
</ div >
141
141
142
-
142
+
143
143
< div class ="type-declaration ">
144
144
< pre > < span id ="TYPEid "> < span class ="keyword "> type</ span > < code class ="type "> ('a, 'id)</ code > id</ span > = < code class ="type "> ('a, 'id) < a href ="Belt_Id.html#TYPEhashable "> Belt_Id.hashable</ a > </ code > </ pre >
145
145
</ div >
@@ -149,48 +149,48 @@ <h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
149
149
< pre > < span id ="VALclear "> < span class ="keyword "> val</ span > clear</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> unit</ code > </ pre > < div class ="info ">
150
150
< div class ="not-examples ">
151
151
Empty a hash table.< br >
152
-
152
+
153
153
</ div >
154
-
154
+
155
155
</ div >
156
156
157
-
157
+
158
158
< pre > < span id ="VALisEmpty "> < span class ="keyword "> val</ span > isEmpty</ span > : < code class ="type "> ('a, 'b, 'c) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> bool</ code > </ pre >
159
159
< pre > < span id ="VALset "> < span class ="keyword "> val</ span > set</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> 'key -> 'value -> unit</ code > </ pre > < div class ="info ">
160
160
< div class ="not-examples ">
161
161
< code class ="code "> set tbl k v</ code > if < code class ="code "> k</ code > does not exist,
162
162
add the binding < code class ="code "> k,v</ code > , otherwise, update the old value with the new
163
163
< code class ="code "> v</ code > < br >
164
-
164
+
165
165
</ div >
166
-
166
+
167
167
</ div >
168
168
169
-
169
+
170
170
< pre > < span id ="VALcopy "> < span class ="keyword "> val</ span > copy</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > </ code > </ pre >
171
171
< pre > < span id ="VALget "> < span class ="keyword "> val</ span > get</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> 'key -> 'value option</ code > </ pre >
172
172
< pre > < span id ="VALhas "> < span class ="keyword "> val</ span > has</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> 'key -> bool</ code > </ pre > < div class ="info ">
173
173
< div class ="not-examples ">
174
174
< code class ="code "> has tbl x</ code > checks if < code class ="code "> x</ code > is bound in < code class ="code "> tbl</ code > .< br >
175
-
175
+
176
176
</ div >
177
-
177
+
178
178
</ div >
179
179
180
-
180
+
181
181
< pre > < span id ="VALremove "> < span class ="keyword "> val</ span > remove</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> 'key -> unit</ code > </ pre >
182
182
< pre > < span id ="VALforEachU "> < span class ="keyword "> val</ span > forEachU</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> ('key -> 'value -> unit [@bs]) -> unit</ code > </ pre >
183
183
< pre > < span id ="VALforEach "> < span class ="keyword "> val</ span > forEach</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> ('key -> 'value -> unit) -> unit</ code > </ pre > < div class ="info ">
184
184
< div class ="not-examples ">
185
185
< code class ="code "> forEach tbl f</ code > applies < code class ="code "> f</ code > to all bindings in table < code class ="code "> tbl</ code > .
186
186
< code class ="code "> f</ code > receives the key as first argument, and the associated value
187
187
as second argument. Each binding is presented exactly once to < code class ="code "> f</ code > .< br >
188
-
188
+
189
189
</ div >
190
-
190
+
191
191
</ div >
192
192
193
-
193
+
194
194
< pre > < span id ="VALreduceU "> < span class ="keyword "> val</ span > reduceU</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> < br > 'c -> ('c -> 'key -> 'value -> 'c [@bs]) -> 'c</ code > </ pre >
195
195
< pre > < span id ="VALreduce "> < span class ="keyword "> val</ span > reduce</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> < br > 'c -> ('c -> 'key -> 'value -> 'c) -> 'c</ code > </ pre > < div class ="info ">
196
196
< div class ="not-examples ">
@@ -205,29 +205,29 @@ <h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
205
205
However, if the table contains several bindings for the same key,
206
206
they are passed to < code class ="code "> f</ code > in reverse order of introduction, that is,
207
207
the most recent binding is passed first.< br >
208
-
208
+
209
209
</ div >
210
-
210
+
211
211
</ div >
212
212
213
-
213
+
214
214
< pre > < span id ="VALkeepMapInPlaceU "> < span class ="keyword "> val</ span > keepMapInPlaceU</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> < br > ('key -> 'value -> 'value option [@bs]) -> unit</ code > </ pre >
215
215
< pre > < span id ="VALkeepMapInPlace "> < span class ="keyword "> val</ span > keepMapInPlace</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> < br > ('key -> 'value -> 'value option) -> unit</ code > </ pre >
216
216
< pre > < span id ="VALsize "> < span class ="keyword "> val</ span > size</ span > : < code class ="type "> ('a, 'b, 'c) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> int</ code > </ pre > < div class ="info ">
217
217
< div class ="not-examples ">
218
218
< code class ="code "> size tbl</ code > returns the number of bindings in < code class ="code "> tbl</ code > .
219
219
It takes constant time.< br >
220
-
220
+
221
221
</ div >
222
-
222
+
223
223
</ div >
224
224
225
-
225
+
226
226
< pre > < span id ="VALtoArray "> < span class ="keyword "> val</ span > toArray</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> ('key * 'value) array</ code > </ pre >
227
227
< pre > < span id ="VALkeysToArray "> < span class ="keyword "> val</ span > keysToArray</ span > : < code class ="type "> ('key, 'a, 'b) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> 'key array</ code > </ pre >
228
228
< pre > < span id ="VALvaluesToArray "> < span class ="keyword "> val</ span > valuesToArray</ span > : < code class ="type "> ('a, 'value, 'b) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> 'value array</ code > </ pre >
229
229
< pre > < span id ="VALfromArray "> < span class ="keyword "> val</ span > fromArray</ span > : < code class ="type "> ('key * 'value) array -> < br > id:('key, 'id) < a href ="Belt_HashMap.html#TYPEid "> id</ a > -> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > </ code > </ pre >
230
230
< pre > < span id ="VALmergeMany "> < span class ="keyword "> val</ span > mergeMany</ span > : < code class ="type "> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> ('key * 'value) array -> unit</ code > </ pre >
231
231
< pre > < span id ="VALgetBucketHistogram "> < span class ="keyword "> val</ span > getBucketHistogram</ span > : < code class ="type "> ('a, 'b, 'c) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> int array</ code > </ pre >
232
232
< pre > < span id ="VALlogStats "> < span class ="keyword "> val</ span > logStats</ span > : < code class ="type "> ('a, 'b, 'c) < a href ="Belt_HashMap.html#TYPEt "> t</ a > -> unit</ code > </ pre >
233
- < pre > < span id ="VALofArray "> < span class ="keyword "> val</ span > ofArray</ span > : < code class ="type "> ('key * 'value) array -> < br > id:('key, 'id) < a href ="Belt_HashMap.html#TYPEid "> id</ a > -> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > </ code > </ pre > </ body > </ html >
233
+ < pre > < span id ="VALofArray "> < span class ="keyword "> val</ span > ofArray</ span > : < code class ="type "> ('key * 'value) array -> < br > id:('key, 'id) < a href ="Belt_HashMap.html#TYPEid "> id</ a > -> ('key, 'value, 'id) < a href ="Belt_HashMap.html#TYPEt "> t</ a > </ code > </ pre > </ body > </ html >
0 commit comments