Giter VIP home page Giter VIP logo

Comments (4)

CrossEye avatar CrossEye commented on May 18, 2024 2

I think there is a difference.

When you partially apply k arguments to a function with n formal parameters, you get back a new function that still needs n - k arguments. (Assuming k < n, of course.)

When you auto-curry a function, you get a function that has useful behavior when supplied 1, 2, ..., or n arguments. If you supply k arguments, you get back an already auto-curried function with n - k formal parameters.

const f = (a, b, c, d, e) => a + b + c + d + e;

partial(f, 1, 2)    (c, d, e) => 1 + 2 + c + 2 + e;

// But if

const g = autocurry(f)(1, 2);

// then

g  (c, d, e) => 1 + 2 + c + d + e
g   c => (d, e) =>  1 + 2 + c + d + e
g   (c, d) => e =>  1 + 2 + c + d + e
g   c => d => e =>  1 + 2 + c + d + e

So you can call this "dynamic partial application", but it's not partial application as it's usually used.

from functional-programming-jargon.

jethrolarson avatar jethrolarson commented on May 18, 2024

You're not wrong, auto-currying is essentially dynamic partial
application. The only reason to describe it as "curry" is due to libraries
like Ramda and Lodash using it for the practice

On Tue, Nov 22, 2016, 7:24 AM stereobooster [email protected]
wrote:

The simplest example for currying:

(A,B) -> C convert to (A) -> (B -> C)

So partial application is application to curried function

((A,B) -> C)(A) convert to ((A) -> (B -> C))(A)

From this definition I can not see difference between Auto-currying and
partial application. Am I wrong?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#124, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAB-4KIdu8pHnSAOcqNWITSnEPiz-D7Oks5rAwkRgaJpZM4K5kE8
.

from functional-programming-jargon.

stereobooster avatar stereobooster commented on May 18, 2024

Maybe add a bit of history nerdiness?

This replacement mechanism simplifies work in both combinatory logic and lambda calculus and would later be called currying, after Haskell Curry. While Curry attributed the concept to Schönfinkel, it had already been used by Frege.

from functional-programming-jargon.

jethrolarson avatar jethrolarson commented on May 18, 2024

I think this is addressed in the current definitions. Reopen if you disagree.

from functional-programming-jargon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.