> I like curry(). The others don't bring the right concept to mind for me. > I apologise if this offends the purists, but *all* of the recent attempts > to "clarify" the difference between partial application and currying have > simply confused me. Let me try an example, partly to be sure I understand it. Suppose have a function f with five arguments. Then I think you are proposing a function, which I shall call X for the moment, with the property that evaluating g = X(f, a, b) z = g(c, d, e) has the same effect as z = f(a, b, c, d, e) At least, that's how the code in the PEP seems to behave. If so, that's not currying. Currying would work like this: g = curry(f) # Note -- no other arguments g1 = g(a) g2 = g1(b) g3 = g2(c) g4 = g3(d) z = g4(e) with z having the same value as f(a, b, c, d, e) afterward. Note that curry takes only one argument, namely f. Instead of taking an argument of f directly, it returns a function that will accept f's first argument. It is that extra level of indirection that distinguishes currying from partial application.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4