Skip to content

Commit da3cb7a

Browse files
Adapt example tests to Rescript11 + uncurried + RescriptCore
1 parent e67e730 commit da3cb7a

File tree

14 files changed

+152
-49
lines changed

14 files changed

+152
-49
lines changed

compilers/package-lock.json

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compilers/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
"main": "index.js",
66
"license": "MIT",
77
"dependencies": {
8+
"@rescript/core": "^0.5.0",
89
"rescript-820": "npm:bs-platform@8.2.0",
910
"rescript-902": "npm:bs-platform@9.0.2",
1011
"rescript-912": "npm:rescript@9.1.2",
1112
"rescript-1000": "npm:rescript@10.0.0",
12-
"rescript-1010": "npm:rescript@10.1.0-rc.4"
13+
"rescript-1010": "npm:rescript@10.1.0-rc.4",
14+
"rescript-1100": "npm:rescript@11.0.0-rc.4"
1315
}
1416
}

compilers/rescript.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "dummy",
3+
"sources": {
4+
"dir": "dummy",
5+
"subdirs": true
6+
},
7+
"bs-dependencies": [
8+
"@rescript/core"
9+
],
10+
"bsc-flags": [
11+
"-open RescriptCore"
12+
]
13+
}

pages/docs/manual/latest/api/belt/hash-map.mdx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ let make: (~hintSize: int, ~id: id<'key, 'id>) => t<'key, 'value, 'id>
3131
`make(~hintSize=10, ~id)` creates a new map by taking in the comparator and `hintSize`.
3232

3333
```res example
34-
module IntHash = Belt.Id.MakeHashable({
34+
module IntHash = Belt.Id.MakeHashableU({
3535
type t = int
3636
let hash = a => a
3737
let eq = (a, b) => a == b
@@ -51,7 +51,7 @@ let clear: t<'key, 'value, 'id> => unit
5151
Clears a hash table.
5252

5353
```res example
54-
module IntHash = Belt.Id.MakeHashable({
54+
module IntHash = Belt.Id.MakeHashableU({
5555
type t = int
5656
let hash = a => a
5757
let eq = (a, b) => a == b
@@ -71,7 +71,7 @@ let isEmpty: t<'a, 'b, 'c> => bool
7171
`isEmpty(m)` checks whether a hash map is empty.
7272

7373
```res example
74-
module IntHash = Belt.Id.MakeHashable({
74+
module IntHash = Belt.Id.MakeHashableU({
7575
type t = int
7676
let hash = a => a
7777
let eq = (a, b) => a == b
@@ -89,7 +89,7 @@ let set: (t<'key, 'value, 'id>, 'key, 'value) => unit
8989
`set(hMap, k, v)` if `k` does not exist, add the binding `k,v`, otherwise, update the old value with the new `v`.
9090

9191
```res example
92-
module IntHash = Belt.Id.MakeHashable({
92+
module IntHash = Belt.Id.MakeHashableU({
9393
type t = int
9494
let hash = a => a
9595
let eq = (a, b) => a == b
@@ -111,7 +111,7 @@ let copy: t<'key, 'value, 'id> => t<'key, 'value, 'id>
111111
Creates copy of a hash map.
112112

113113
```res example
114-
module IntHash = Belt.Id.MakeHashable({
114+
module IntHash = Belt.Id.MakeHashableU({
115115
type t = int
116116
let hash = a => a
117117
let eq = (a, b) => a == b
@@ -134,7 +134,7 @@ let get: (t<'key, 'value, 'id>, 'key) => option<'value>
134134
Returns value bound under specific key. If values not exist returns `None`.
135135

136136
```res example
137-
module IntHash = Belt.Id.MakeHashable({
137+
module IntHash = Belt.Id.MakeHashableU({
138138
type t = int
139139
let hash = a => a
140140
let eq = (a, b) => a == b
@@ -156,7 +156,7 @@ let has: (t<'key, 'value, 'id>, 'key) => bool
156156
Checks if `x` is bound in `tbl`.
157157

158158
```res example
159-
module IntHash = Belt.Id.MakeHashable({
159+
module IntHash = Belt.Id.MakeHashableU({
160160
type t = int
161161
let hash = a => a
162162
let eq = (a, b) => a == b
@@ -178,7 +178,7 @@ let remove: (t<'key, 'value, 'id>, 'key) => unit
178178
If bound exists, removes it from the hash map.
179179

180180
```res example
181-
module IntHash = Belt.Id.MakeHashable({
181+
module IntHash = Belt.Id.MakeHashableU({
182182
type t = int
183183
let hash = a => a
184184
let eq = (a, b) => a == b
@@ -207,7 +207,7 @@ let forEach: (t<'key, 'value, 'id>, ('key, 'value) => unit) => unit
207207
`forEach(tbl, f)` applies `f` to all bindings in table `tbl`. `f` receives the key as first argument, and the associated value as second argument. Each binding is presented exactly once to `f`.
208208

209209
```res example
210-
module IntHash = Belt.Id.MakeHashable({
210+
module IntHash = Belt.Id.MakeHashableU({
211211
type t = int
212212
let hash = a => a
213213
let eq = (a, b) => a == b
@@ -238,7 +238,7 @@ let reduce: (t<'key, 'value, 'id>, 'c, ('c, 'key, 'value) => 'c) => 'c
238238
The order in which the bindings are passed to `f` is unspecified. However, if the table contains several bindings for the same key, they are passed to `f` in reverse order of introduction, that is, the most recent binding is passed first.
239239

240240
```res example
241-
module IntHash = Belt.Id.MakeHashable({
241+
module IntHash = Belt.Id.MakeHashableU({
242242
type t = int
243243
let hash = a => a
244244
let eq = (a, b) => a == b
@@ -268,7 +268,7 @@ let keepMapInPlace: (t<'key, 'value, 'id>, ('key, 'value) => option<'value>) =>
268268
Filters out values for which function `f` returned `None`.
269269

270270
```res example
271-
module IntHash = Belt.Id.MakeHashable({
271+
module IntHash = Belt.Id.MakeHashableU({
272272
type t = int
273273
let hash = a => a
274274
let eq = (a, b) => a == b
@@ -290,7 +290,7 @@ let size: t<'a, 'b, 'c> => int
290290
`size(tbl)` returns the number of bindings in `tbl`. It takes constant time.
291291

292292
```res example
293-
module IntHash = Belt.Id.MakeHashable({
293+
module IntHash = Belt.Id.MakeHashableU({
294294
type t = int
295295
let hash = a => a
296296
let eq = (a, b) => a == b
@@ -312,7 +312,7 @@ let toArray: t<'key, 'value, 'id> => array<('key, 'value)>
312312
Returns array of key value pairs.
313313

314314
```res example
315-
module IntHash = Belt.Id.MakeHashable({
315+
module IntHash = Belt.Id.MakeHashableU({
316316
type t = int
317317
let hash = a => a
318318
let eq = (a, b) => a == b
@@ -334,7 +334,7 @@ let keysToArray: t<'key, 'a, 'b> => array<'key>
334334
Returns array of keys.
335335

336336
```res example
337-
module IntHash = Belt.Id.MakeHashable({
337+
module IntHash = Belt.Id.MakeHashableU({
338338
type t = int
339339
let hash = a => a
340340
let eq = (a, b) => a == b
@@ -356,7 +356,7 @@ let valuesToArray: t<'a, 'value, 'b> => array<'value>
356356
Returns array of values.
357357

358358
```res example
359-
module IntHash = Belt.Id.MakeHashable({
359+
module IntHash = Belt.Id.MakeHashableU({
360360
type t = int
361361
let hash = a => a
362362
let eq = (a, b) => a == b
@@ -380,7 +380,7 @@ Creates new hash map from array of pairs.
380380
Returns array of values.
381381

382382
```res example
383-
module IntHash = Belt.Id.MakeHashable({
383+
module IntHash = Belt.Id.MakeHashableU({
384384
type t = int
385385
let hash = a => a
386386
let eq = (a, b) => a == b
@@ -397,7 +397,7 @@ let mergeMany: (t<'key, 'value, 'id>, array<('key, 'value)>) => unit
397397
```
398398

399399
```res example
400-
module IntHash = Belt.Id.MakeHashable({
400+
module IntHash = Belt.Id.MakeHashableU({
401401
type t = int
402402
let hash = a => a
403403
let eq = (a, b) => a == b
@@ -414,7 +414,7 @@ let getBucketHistogram: t<'a, 'b, 'c> => array<int>
414414
```
415415

416416
```res example
417-
module IntHash = Belt.Id.MakeHashable({
417+
module IntHash = Belt.Id.MakeHashableU({
418418
type t = int
419419
let hash = a => a
420420
let eq = (a, b) => a == b
@@ -432,7 +432,7 @@ let logStats: t<'a, 'b, 'c> => unit
432432
```
433433

434434
```res example
435-
module IntHash = Belt.Id.MakeHashable({
435+
module IntHash = Belt.Id.MakeHashableU({
436436
type t = int
437437
let hash = a => a
438438
let eq = (a, b) => a == b

0 commit comments

Comments
 (0)