Skip to content

Get rid of U functions #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Next version

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

## 1.0.0

Expand Down
5 changes: 1 addition & 4 deletions src/Core__Array.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,12 @@ function toShuffled(xs) {
}

function filterMap(a, f) {
var f$1 = function (a) {
return f(a);
};
var l = a.length;
var r = new Array(l);
var j = 0;
for(var i = 0; i < l; ++i){
var v = a[i];
var v$1 = f$1(v);
var v$1 = f(v);
if (v$1 !== undefined) {
r[j] = Caml_option.valFromOption(v$1);
j = j + 1 | 0;
Expand Down
4 changes: 1 addition & 3 deletions src/Core__Array.res
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ let toShuffled = xs => {
result
}

let filterMapU = (a, f) => {
let filterMap = (a, f) => {
let l = length(a)
let r = makeUninitializedUnsafe(l)
let j = ref(0)
Expand All @@ -227,8 +227,6 @@ let filterMapU = (a, f) => {
r
}

let filterMap = (a, f) => filterMapU(a, a => f(a))

let keepSome = filterMap(_, x => x)

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