Skip to content
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

Update: curryN utilize optimized _curry1, _curry2, _curry3 #3461

Closed
wants to merge 6 commits into from

Conversation

Harris-Miller
Copy link
Contributor

We got em, might as well use em

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (914ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (882ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (887ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

@Harris-Miller
Copy link
Contributor Author

I'm unclear as to why the unit tests are failing

@Harris-Miller Harris-Miller changed the title curryN utilize optimized _curry1, _curry2, _curry3 Update: curryN utilize optimized _curry1, _curry2, _curry3 May 2, 2024
Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (906ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

@kedashoe
Copy link
Contributor

kedashoe commented May 2, 2024

We keep the this context and pass along extra arguments to functions users give to us. Those internal _curry2 and _curry3 functions do not, so this would be a pretty big breaking change.

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (897ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

@Harris-Miller
Copy link
Contributor Author

Ah I see. I did not notice that in the the _curry1 and _curryN implementations. I could update _curry2 and _curry to use fn.call(this, ...) and retain that behavior. Should work. Will give it a shot later this week

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (856ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

@Harris-Miller
Copy link
Contributor Author

Tried with fn.call(), that fixed it. But those optimized _curry2 and _curry3 handles specific arity where _curry1 and _curryN work with additional args. Not worth trying to add that in. Closing

@Harris-Miller Harris-Miller deleted the curry-optimization branch May 2, 2024 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants