Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Curry #27

Closed
wants to merge 11 commits into from
Closed

Curry #27

wants to merge 11 commits into from

Conversation

arian
Copy link
Collaborator

@arian arian commented Jul 5, 2013

New modules:

  • function/curry
  • function/partial
  • function/partialLast


function flow(width, height, time){ return width * height * time }
var flowThroughPipe = partial(volume, 5, 6)
vol(10) // 300
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vol --> flowThroughPipe

Right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thanks 😃

@arian
Copy link
Collaborator Author

arian commented Jul 5, 2013

@ibolmo thanks, @kamicane put me under too much pressure ;)

@ibolmo
Copy link
Contributor

ibolmo commented Jul 5, 2013

lol Classic™

On Fri, Jul 5, 2013 at 9:12 AM, Arian Stolwijk notifications@github.comwrote:

@ibolmo https://github.com/ibolmo thanks, @kamicanehttps://github.com/kamicaneput me under too much pressure ;)


Reply to this email directly or view it on GitHubhttps://github.com//pull/27#issuecomment-20520798
.

@arian
Copy link
Collaborator Author

arian commented Jul 5, 2013

partialRight is probably better indeed.

@kamicane
Copy link
Owner

kamicane commented Jul 6, 2013

Wouldn't it be more useful if curry supported an optional length property (defaulting to fn.length)?

The api would be:

var curried = curry(someVariableArgsFn, 2)(someArg)
curried(secondArg) -> result

also useful:

var curried = curry(someVariableArgsFn, 2)
curried(someArg, secondArg) -> result

@kamicane kamicane closed this Mar 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants