-
Notifications
You must be signed in to change notification settings - Fork 458
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
Clean list API #7290
Clean list API #7290
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05
.
Benchmark suite | Current: c20e7b1 | Previous: e1b7fb7 | Ratio |
---|---|---|---|
Parse RedBlackTree.res - time/run |
1.34950402 ms |
1.2123143266666667 ms |
1.11 |
Parse Napkinscript.res - time/run |
42.166715106666665 ms |
39.28006235333333 ms |
1.07 |
Parse HeroGraphic.res - time/run |
5.705078513333333 ms |
5.13472718 ms |
1.11 |
This comment was automatically generated by workflow using github-action-benchmark.
057bdb8
to
3be7cfe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
runtime/List.res
Outdated
let len = length(x) | ||
let arr = A.makeUninitializedUnsafe(len) | ||
fillAux(arr, 0, x) | ||
arr | ||
} | ||
|
||
let toShuffled = xs => { | ||
let shuffle = xs => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one.
On the one hand, it may be confusing that in the Array
module shuffle
mutates whereas in the List
module it does not. On the other hand, we know that list
is immutable...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I'm a bit torn on this one too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should we do about this one @cknitt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I guess either is fine with me. Any preference from your side @zth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my personal preference would be to use shuffle given list is immutable and the signature is clear, but up to you guys!
7e3e112
to
e85f510
Compare
f89dec9
to
4d092f0
Compare
c20e7b1
to
ac8dd9e
Compare
@cknitt rebased! |
Great, thanks! However, could you put the re-adding of |
e4fefe8
to
0971bc6
Compare
@cknitt done |
@tsnobip Completion tests are failing again now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
List.t
toShuffled
toshuffle
and deprecate itList.*Assoc
functionsI think this solves most issues raised in rescript-lang/rescript-core/issues/192.
I have no good idea for
List.concatMany
so I just kept it.I'd rather keep
List.has
andList.length
as it is today and maybe we could addArray.has
for consistency.