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 >
15
+ < li > < a href ="Belt_Debug.html "> Belt_Debug</ a > </ li >
15
16
< li > < a href ="Belt_HashMap.html "> Belt_HashMap</ a > </ li >
16
17
< li > < a href ="Belt_HashMapInt.html "> Belt_HashMapInt</ a > </ li >
17
18
< li > < a href ="Belt_HashMapString.html "> Belt_HashMapString</ a > </ li >
34
35
< li > < a href ="Belt_MutableStack.html "> Belt_MutableStack</ a > </ li >
35
36
< li > < a href ="Belt_Option.html "> Belt_Option</ a > </ li >
36
37
< li > < a href ="Belt_Range.html "> Belt_Range</ a > </ li >
38
+ < li > < a href ="Belt_Result.html "> Belt_Result</ a > </ li >
37
39
< li > < a href ="Belt_Set.html "> Belt_Set</ a > </ li >
38
40
< li > < a href ="Belt_SetDict.html "> Belt_SetDict</ a > </ li >
39
41
< li > < a href ="Belt_SetInt.html "> Belt_SetInt</ a > </ li >
@@ -108,38 +110,38 @@ <h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
108
110
109
111
It also has two specialized inner modules
110
112
< code class ="code "> Belt.HashMap.Int</ code > and < code class ="code "> Belt.HashMap.String</ code > < br >
111
-
113
+
112
114
</ div >
113
-
115
+
114
116
</ div >
115
117
116
118
< hr width ="100% ">
117
119
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 ">
120
+ < 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
121
< div class ="not-examples ">
120
122
Specalized when key type is < code class ="code "> int</ code > , more efficient
121
123
than the generic type< br >
122
-
123
- </ div >
124
+
124
125
</ 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 ">
126
+ </ div >
127
+ < 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
128
< div class ="not-examples ">
127
129
Specalized when key type is < code class ="code "> string</ code > , more efficient
128
130
than the generic type< br >
129
-
131
+
130
132
</ div >
131
133
</ div > < div class ="type-declaration ">
132
134
< pre > < span id ="TYPEt "> < span class ="keyword "> type</ span > < code class ="type "> ('key, 'value, 'id)</ code > t</ span > </ pre >
133
135
</ div >
134
136
< div class ="info ">
135
137
< div class ="not-examples ">
136
138
The type of hash tables from type < code class ="code "> 'key</ code > to type < code class ="code "> 'value</ code > .< br >
137
-
139
+
138
140
</ div >
139
-
141
+
140
142
</ div >
141
143
142
-
144
+
143
145
< div class ="type-declaration ">
144
146
< 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
147
</ div >
@@ -149,48 +151,48 @@ <h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
149
151
< 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
152
< div class ="not-examples ">
151
153
Empty a hash table.< br >
152
-
154
+
153
155
</ div >
154
-
156
+
155
157
</ div >
156
158
157
-
159
+
158
160
< 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
161
< 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
162
< div class ="not-examples ">
161
163
< code class ="code "> set tbl k v</ code > if < code class ="code "> k</ code > does not exist,
162
164
add the binding < code class ="code "> k,v</ code > , otherwise, update the old value with the new
163
165
< code class ="code "> v</ code > < br >
164
-
166
+
165
167
</ div >
166
-
168
+
167
169
</ div >
168
170
169
-
171
+
170
172
< 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
173
< 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
174
< 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
175
< div class ="not-examples ">
174
176
< code class ="code "> has tbl x</ code > checks if < code class ="code "> x</ code > is bound in < code class ="code "> tbl</ code > .< br >
175
-
177
+
176
178
</ div >
177
-
179
+
178
180
</ div >
179
181
180
-
182
+
181
183
< 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
184
< 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
185
< 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
186
< div class ="not-examples ">
185
187
< code class ="code "> forEach tbl f</ code > applies < code class ="code "> f</ code > to all bindings in table < code class ="code "> tbl</ code > .
186
188
< code class ="code "> f</ code > receives the key as first argument, and the associated value
187
189
as second argument. Each binding is presented exactly once to < code class ="code "> f</ code > .< br >
188
-
190
+
189
191
</ div >
190
-
192
+
191
193
</ div >
192
194
193
-
195
+
194
196
< 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
197
< 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
198
< div class ="not-examples ">
@@ -205,29 +207,28 @@ <h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
205
207
However, if the table contains several bindings for the same key,
206
208
they are passed to < code class ="code "> f</ code > in reverse order of introduction, that is,
207
209
the most recent binding is passed first.< br >
208
-
210
+
209
211
</ div >
210
-
212
+
211
213
</ div >
212
214
213
-
215
+
214
216
< 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
217
< 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
218
< 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
219
< div class ="not-examples ">
218
220
< code class ="code "> size tbl</ code > returns the number of bindings in < code class ="code "> tbl</ code > .
219
221
It takes constant time.< br >
220
-
222
+
221
223
</ div >
222
-
224
+
223
225
</ div >
224
226
225
-
227
+
226
228
< 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
229
< 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
230
< 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
231
< 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
232
< 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
233
< 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
- < 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 >
234
+ < 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 > </ body > </ html >
0 commit comments