Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit bb2e064

Browse files
committed
review changes
1 parent 396aee3 commit bb2e064

10 files changed

+3
-51
lines changed

belt-cppo/internal_map.cppo.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ let rec merge = (s1, s2, f) =>
193193
| _ => assert(false)
194194
}
195195

196-
197196
let rec compareAux = (e1, e2, vcmp) =>
198197
switch (e1, e2) {
199198
| (list{h1, ...t1}, list{h2, ...t2}) =>

belt-cppo/mapm.cppo.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let forEach = (d, f) => N.forEach(d.data, f)
3939
let map = (d, f) => {data: N.map(d.data, f)}
4040
let mapWithKey = (d, f) => {data: N.mapWithKey(d.data, f)}
4141
let reduce = (d, acc, f) => N.reduce(d.data, acc, f)
42-
let every= (d, f) => N.every(d.data, f)
42+
let every = (d, f) => N.every(d.data, f)
4343
let some = (d, f) => N.some(d.data, f)
4444
let size = d => N.size(d.data)
4545
let toList = d => N.toList(d.data)

belt/src/belt.res

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,6 @@ let greaterThan2UniqueAndSorted =
7777
Js.log2("result", greaterThan2UniqueAndSorted)
7878
```
7979
80-
## Curried vs. Uncurried Callbacks
81-
82-
For functions taking a callback parameter, there are usually two versions
83-
available:
84-
85-
- curried (no suffix)
86-
- uncurried (suffixed with `U`)
87-
88-
E.g.:
89-
90-
## Examples
91-
92-
```rescript
93-
let forEach: (t<'a>, 'a => unit) => unit
94-
```
95-
96-
The uncurried version will be faster in some cases, but for simplicity we recommend to stick with the curried version unless you need the extra performance.
97-
98-
The two versions can be invoked as follows:
99-
100-
## Examples
101-
102-
```rescript
103-
["a", "b", "c"]->Belt.Array.forEach(x => Js.log(x))
104-
```
105-
10680
## Specialized Collections
10781
10882
For collections types like set or map, Belt provides both a generic module as well as specialized, more efficient implementations for string and int keys.

belt/src/belt_MutableMapInt.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ let forEach = (d, f) => N.forEach(d.data, f)
3232
let map = (d, f) => {data: N.map(d.data, f)}
3333
let mapWithKey = (d, f) => {data: N.mapWithKey(d.data, f)}
3434
let reduce = (d, acc, f) => N.reduce(d.data, acc, f)
35-
let every= (d, f) => N.every(d.data, f)
35+
let every = (d, f) => N.every(d.data, f)
3636
let some = (d, f) => N.some(d.data, f)
3737
let size = d => N.size(d.data)
3838
let toList = d => N.toList(d.data)

belt/src/belt_MutableMapString.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ let forEach = (d, f) => N.forEach(d.data, f)
3232
let map = (d, f) => {data: N.map(d.data, f)}
3333
let mapWithKey = (d, f) => {data: N.mapWithKey(d.data, f)}
3434
let reduce = (d, acc, f) => N.reduce(d.data, acc, f)
35-
let every= (d, f) => N.every(d.data, f)
35+
let every = (d, f) => N.every(d.data, f)
3636
let some = (d, f) => N.some(d.data, f)
3737
let size = d => N.size(d.data)
3838
let toList = d => N.toList(d.data)

belt/src/belt_internalBuckets.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,21 +255,12 @@ function toArray(h) {
255255

256256
let C;
257257

258-
let forEachU = forEach;
259-
260-
let reduceU = reduce;
261-
262-
let keepMapInPlaceU = keepMapInPlace;
263-
264258
export {
265259
C,
266260
copy,
267-
forEachU,
268261
forEach,
269-
reduceU,
270262
reduce,
271263
logStats,
272-
keepMapInPlaceU,
273264
keepMapInPlace,
274265
fillArray,
275266
keysToArray,

belt/src/belt_internalBuckets.res

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,3 @@ let linear = (h, f) => {
217217
let keysToArray = h => linear(h, x => x.key)
218218
let valuesToArray = h => linear(h, x => x.value)
219219
let toArray = h => linear(h, x => (x.key, x.value))
220-
221-
let forEachU = forEach
222-
let keepMapInPlaceU = keepMapInPlace
223-
let reduceU = reduce

belt/src/belt_internalBuckets.resi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,12 @@ and t<'hash, 'eq, 'a, 'b> = C.container<'hash, 'eq, bucket<'a, 'b>>
3333

3434
let copy: t<'hash, 'eq, 'a, 'b> => t<'hash, 'eq, 'a, 'b>
3535

36-
@deprecated("Use `forEach` instead")
37-
let forEachU: (t<_, _, 'a, 'b>, ('a, 'b) => 'c) => unit
3836
let forEach: (t<_, _, 'a, 'b>, ('a, 'b) => 'c) => unit
3937

40-
@deprecated("Use `reduce` instead")
41-
let reduceU: (t<_, _, 'a, 'b>, 'c, ('c, 'a, 'b) => 'c) => 'c
4238
let reduce: (t<_, _, 'a, 'b>, 'c, ('c, 'a, 'b) => 'c) => 'c
4339

4440
let logStats: t<_> => unit
4541

46-
@deprecated("Use `keepMapInPlace` instead")
47-
let keepMapInPlaceU: (t<_, _, 'a, 'b>, ('a, 'b) => option<'b>) => unit
4842
let keepMapInPlace: (t<_, _, 'a, 'b>, ('a, 'b) => option<'b>) => unit
4943

5044
let fillArray: (int, array<('a, 'b)>, bucket<'a, 'b>) => int

belt/src/belt_internalMapInt.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ let rec merge = (s1, s2, f) =>
187187
| _ => assert(false)
188188
}
189189

190-
191190
let rec compareAux = (e1, e2, vcmp) =>
192191
switch (e1, e2) {
193192
| (list{h1, ...t1}, list{h2, ...t2}) =>

belt/src/belt_internalMapString.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ let rec merge = (s1, s2, f) =>
187187
| _ => assert(false)
188188
}
189189

190-
191190
let rec compareAux = (e1, e2, vcmp) =>
192191
switch (e1, e2) {
193192
| (list{h1, ...t1}, list{h2, ...t2}) =>

0 commit comments

Comments
 (0)