Skip to content

Commit 50d3937

Browse files
nikgrafryyppy
authored andcommitted
Docs (#30)
* migrate sort array int * migrate sort array string * migrate hash set int * migrate hash set string * add mutable map * add api intro * add re signature annotation
1 parent a55d419 commit 50d3937

File tree

7 files changed

+328
-189
lines changed

7 files changed

+328
-189
lines changed

pages/belt_docs/hash-set-int.mdx

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,127 @@
11
import { make as Layout } from "../../layouts/BeltDocsLayout.bs.js";
2+
import { make as ApiIntro } from "../../components/ApiIntro.bs.js";
23
export default Layout;
34

45
# HashSetInt
56

7+
<ApiIntro>
8+
9+
This module is `Belt.HashSet` specialized with key type to be a primitive type.
10+
11+
It is more efficient in general, the API is the same with `Belt.HashSet` except its key type is fixed, and identity is not needed(using the built-in one).
12+
13+
</ApiIntro>
14+
615
## key
716

8-
```
17+
```re sig
918
type key = int;
1019
```
1120

1221
## t
1322

14-
```
23+
```re sig
1524
type t;
1625
```
1726

1827
## make
1928

20-
```
29+
```re sig
2130
let make: (~hintSize: int) => t;
2231
```
2332

2433
## clear
2534

26-
```
35+
```re sig
2736
let clear: t => unit;
2837
```
2938

3039
## isEmpty
3140

32-
```
41+
```re sig
3342
let isEmpty: t => bool;
3443
```
3544

3645
## add
3746

38-
```
47+
```re sig
3948
let add: (t, key) => unit;
4049
```
4150

4251
## copy
4352

44-
```
53+
```re sig
4554
let copy: t => t;
4655
```
4756

4857
## has
4958

50-
```
59+
```re sig
5160
let has: (t, key) => bool;
5261
```
5362

5463
## remove
5564

56-
```
65+
```re sig
5766
let remove: (t, key) => unit;
5867
```
5968

6069
## forEachU
6170

62-
```
71+
```re sig
6372
let forEachU: (t, [@bs] (key => unit)) => unit;
6473
```
6574

6675
## forEach
6776

68-
```
77+
```re sig
6978
let forEach: (t, key => unit) => unit;
7079
```
7180

7281
## reduceU
7382

74-
```
83+
```re sig
7584
let reduceU: (t, 'c, [@bs] (('c, key) => 'c)) => 'c;
7685
```
7786

7887
## reduce
7988

80-
```
89+
```re sig
8190
let reduce: (t, 'c, ('c, key) => 'c) => 'c;
8291
```
8392

8493
## size
8594

86-
```
95+
```re sig
8796
let size: t => int;
8897
```
8998

9099
## logStats
91100

92-
```
101+
```re sig
93102
let logStats: t => unit;
94103
```
95104

96105
## toArray
97106

98-
```
107+
```re sig
99108
let toArray: t => array(key);
100109
```
101110
102111
## fromArray
103112
104-
```
113+
```re sig
105114
let fromArray: array(key) => t;
106115
```
107116

108117
## mergeMany
109118

110-
```
119+
```re sig
111120
let mergeMany: (t, array(key)) => unit;
112121
```
113122

114123
## getBucketHistogram
115124

116-
```
125+
```re sig
117126
let getBucketHistogram: t => array(int);
118127
```

pages/belt_docs/hash-set-string.mdx

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,127 @@
11
import { make as Layout } from "../../layouts/BeltDocsLayout.bs.js";
2+
import { make as ApiIntro } from "../../components/ApiIntro.bs.js";
23
export default Layout;
34

45
# HashSetString
56

7+
<ApiIntro>
8+
9+
This module is `Belt.HashSet` specialized with key type to be a primitive type.
10+
11+
It is more efficient in general, the API is the same with `Belt.HashSet` except its key type is fixed, and identity is not needed(using the built-in one).
12+
13+
</ApiIntro>
14+
615
## key
716

8-
```
17+
```re sig
918
type key = string;
1019
```
1120

1221
## t
1322

14-
```
23+
```re sig
1524
type t;
1625
```
1726

1827
## make
1928

20-
```
29+
```re sig
2130
let make: (~hintSize: int) => t;
2231
```
2332

2433
## clear
2534

26-
```
35+
```re sig
2736
let clear: t => unit;
2837
```
2938

3039
## isEmpty
3140

32-
```
41+
```re sig
3342
let isEmpty: t => bool;
3443
```
3544

3645
## add
3746

38-
```
47+
```re sig
3948
let add: (t, key) => unit;
4049
```
4150

4251
## copy
4352

44-
```
53+
```re sig
4554
let copy: t => t;
4655
```
4756

4857
## has
4958

50-
```
59+
```re sig
5160
let has: (t, key) => bool;
5261
```
5362

5463
## remove
5564

56-
```
65+
```re sig
5766
let remove: (t, key) => unit;
5867
```
5968

6069
## forEachU
6170

62-
```
71+
```re sig
6372
let forEachU: (t, [@bs] (key => unit)) => unit;
6473
```
6574

6675
## forEach
6776

68-
```
77+
```re sig
6978
let forEach: (t, key => unit) => unit;
7079
```
7180

7281
## reduceU
7382

74-
```
83+
```re sig
7584
let reduceU: (t, 'c, [@bs] (('c, key) => 'c)) => 'c;
7685
```
7786

7887
## reduce
7988

80-
```
89+
```re sig
8190
let reduce: (t, 'c, ('c, key) => 'c) => 'c;
8291
```
8392

8493
## size
8594

86-
```
95+
```re sig
8796
let size: t => int;
8897
```
8998

9099
## logStats
91100

92-
```
101+
```re sig
93102
let logStats: t => unit;
94103
```
95104

96105
## toArray
97106

98-
```
107+
```re sig
99108
let toArray: t => array(key);
100109
```
101110
102111
## fromArray
103112
104-
```
113+
```re sig
105114
let fromArray: array(key) => t;
106115
```
107116

108117
## mergeMany
109118

110-
```
119+
```re sig
111120
let mergeMany: (t, array(key)) => unit;
112121
```
113122

114123
## getBucketHistogram
115124

116-
```
125+
```re sig
117126
let getBucketHistogram: t => array(int);
118127
```

0 commit comments

Comments
 (0)