-
Notifications
You must be signed in to change notification settings - Fork 236
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
Partial Application #26
Comments
So that when you call a function with missing arguments, it returns another function that takes the rest of those arguments. That would be great for streem because then we can use functions lake transformations and filters, passing in one argument, and letting the stream fill in the rest! Otherwise, we would have to do this:
|
That seems pretty awesome, I agree that currying would be pretty useful in this situation. However, how would this affect calling syntax? For example, what if there are optional parameters? Also, if there is not a lot of type checking going on, this could confuse people if they curry by accident. |
I was thinking using an underscore for a missing parameter. That way function calls, optionals, and so-on wouldn't be confused:
|
depending on data type support within the language, how would tuple/set access work?
|
+1 for the currying. Also take a look at this pretty awesome gem https://cirw.in/blog/ampex, which enables you to do more complex shorthand operations like |
@ChristopherDumas That's kinda like what you can do in Scala's anonymous functions... I don't know what is this syntax's name. |
Would |
|
Currying is good idea, and I'd like to add +1. But, if Streem supports bit operation, I'm afraid:
hmm, too many bars... The proposed syntax looks good to me, but users shouldn't use complex operations in currying! |
Agreed, but that is more of a stylistic issue. |
Shouldn't
That function also doesn't have the same "output integer" ( |
Also, this isn't called currying, this is called partial application. I suggest you change your wording. |
Got it. Changing issue name.... |
I think that currying would be highly convenient in a stream-based programming language! Check this out:
or
The text was updated successfully, but these errors were encountered: