Skip to content

Add currying #32

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

Closed
DartBot opened this issue Oct 10, 2011 · 6 comments
Closed

Add currying #32

DartBot opened this issue Oct 10, 2011 · 6 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Oct 10, 2011

This issue was originally filed by [email protected]


Currying is a well-known (in functional languages) technique of transforming a function that takes multiple arguments (or an n-tuple of arguments) in such a way that it can be called as a chain of functions each with a single argument (partial application).

I propose to add its support into dart. Dart could implement them scala-way to keep both named / optional params and currying:

a = function(params1)(params2)(params3) {
  return params1 + params2 + params3
}

a(5)(6)(7)

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by [email protected]


The Function interface is empty which is silly. It should have a method on it to return a partially applied function just like Function.bind() in JS.

https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind

var addOne = function(a, b) { return a + b }.bind(1); // This should work in Dart

@dgrove
Copy link
Contributor

dgrove commented Oct 11, 2011

Removed Type-Defect label.
Added Type-Enhancement, Area-Language labels.

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by [email protected]


Added Triaged label.

@gbracha
Copy link
Contributor

gbracha commented Oct 12, 2011

Added WontFix label.

@DartBot
Copy link
Author

DartBot commented Oct 12, 2011

This comment was originally written by [email protected]


Sorry, why this is WontFix?

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Oct 12, 2011
@kevmoo kevmoo added closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug and removed resolution-wont_fix labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants