Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8251803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:21:31+00:00 2026-06-08T00:21:31+00:00

I was asked what’s the relationship between partial function application and closures. I would

  • 0

I was asked what’s the relationship between partial function application and closures.
I would say there isn’t any, unless I’m missing the point.
Let’s say I’m writing in python and I have a very simple function MySum defined as follows:

MySum = lambda x, y : x + y;

Now I’m fixing one parameter to obtain a function with smaller arity which returns the same value that MySum would return if I called it with the same parameters (partial application):

MyPartialSum = lambda x : MySum(x, 0);

I could do the the very same thing with C:

int MySum(int x, int y) { return x + y; }
int MyPartialSum(int x) { return MySum(x, 0); }

So, the dumb question is: what’s the difference? Why should I need closures for partial applications? These codes are equivalent, I don’t see what’s the bound with closures and partial application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:21:33+00:00Added an answer on June 8, 2026 at 12:21 am

    Partial application is a technique whereby you take an existing function and a subset of it’s arguments, and produce a new function that accepts the remaining arguments.

    In other words, if you have function F(a, b), a function that applies partial application of a would look like B(fn, a) where F(a, b) = B(F, a)(b).

    In your example you’re simply creating new functions, rather than applying partial application to the existing one.

    Here’s an example in python:

    def curry_first(fn, arg):
        def foo(*args):
           return fn(arg, *args)
        return foo
    

    This creates a closure over the supplied function and argument. A new function is returned that calls the first function with new argument signature. The closure is important – it allows fn access to arg. Now you can do this sort of thing:

    add = lambda x, y : x + y;
    add2 = curry_first(add, 2)
    add2(4) # returns 6
    

    I’ve usually heard this referred to as currying.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Asked because of this : Default argument in c++ Say I have a function
I asked this question over Security site, and people there suggested I should have
I asked this question earlier: How to get delta between two text items But
Asked in the interview: What is the difference between HTTP servlet and SOAP over
I asked the question this way because I can imagine that there's a potentially
I asked this kind of question before, but didn't receive any good answers, perhaps
I asked a question yesterday about a little app that I would like to
Being asked to describe what a virtual function is seems to be one of
Asked this before but unfortunately there were no answers to this question. How I
Jacob asked the perfect question: give me the MERGE syntax . Every answer out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.