Skip to content
This repository was archived by the owner on Dec 31, 2022. It is now read-only.
This repository was archived by the owner on Dec 31, 2022. It is now read-only.

interesting quirk with named currying #20

Description

@getify

Just got bitten by this quirk, but not sure if it's a bug or if we should leave it alone... thoughts?

function foo({x,y,z}) {
	console.log(x,y,z);
}

var f = FPO.curryMultiple( {fn: foo, n: 3} );

f( {x:1,y:2} )( {x:4,z:3} );

What would you expect that output to be? I expected 1,2,3 since x was already curried in the first call, but the result is that x:4 effectively overrides (re-curries?) the x:1. That was surprising to me and caused me a bug.

Should named curry(..) and curryMultiple(..) restrict each input to only being specified once, the first time?

Partially related to #19

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions