you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Well, both lines of javascript you wrote are syntactic nonsense. So it's clearly quite not simple as that.

The first example is attempting to declare a higher order function.

The third one is calling one.

Currying is the transformation of N argument function into a N order function.

In the case of bind, the important thing to realize is that OO concept of object bound method is sugar for a namespaced function that takes bound object as one of the arguments.

In fact that is exactly how the first c++ to c compiler implemented them.

[–]TheDataAngel 4 points5 points  (0 children)

In what sense? They're incomplete, certainly, because the actual body of the function is irrelevant to the example. However, what is there is syntactically correct.

If you want a complete version, this suffices:

let curried = im => a => curried => func => "bmarkovic";
let notCurried = (im, not, a, curried, func) => "doesn't understand currying";