Skip to content

Commit 154f9f2

Browse files
authored
Get rid of U functions (#191)
* Get rid of U functions * Add changelog entry
1 parent dd05215 commit 154f9f2

File tree

5 files changed

+171
-334
lines changed

5 files changed

+171
-334
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Next version
44

55
- Add `Dict.forEach`, `Dict.forEachWithKey` and `Dict.mapValues` https://github.com/rescript-association/rescript-core/pull/181
6+
- Remove internal xxxU helper functions that are not needed anymore in uncurried mode. https://github.com/rescript-association/rescript-core/pull/191
67

78
## 1.0.0
89

src/Core__Array.mjs

+1-4
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,12 @@ function toShuffled(xs) {
127127
}
128128

129129
function filterMap(a, f) {
130-
var f$1 = function (a) {
131-
return f(a);
132-
};
133130
var l = a.length;
134131
var r = new Array(l);
135132
var j = 0;
136133
for(var i = 0; i < l; ++i){
137134
var v = a[i];
138-
var v$1 = f$1(v);
135+
var v$1 = f(v);
139136
if (v$1 !== undefined) {
140137
r[j] = Caml_option.valFromOption(v$1);
141138
j = j + 1 | 0;

src/Core__Array.res

+1-3
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ let toShuffled = xs => {
210210
result
211211
}
212212

213-
let filterMapU = (a, f) => {
213+
let filterMap = (a, f) => {
214214
let l = length(a)
215215
let r = makeUninitializedUnsafe(l)
216216
let j = ref(0)
@@ -227,8 +227,6 @@ let filterMapU = (a, f) => {
227227
r
228228
}
229229

230-
let filterMap = (a, f) => filterMapU(a, a => f(a))
231-
232230
let keepSome = filterMap(_, x => x)
233231

234232
@send external flatMap: (array<'a>, 'a => array<'b>) => array<'b> = "flatMap"

0 commit comments

Comments
 (0)