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 8684105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:13:02+00:00 2026-06-12T22:13:02+00:00

Could someone please explain the concept of currying to me. I am primarily learning

  • 0

Could someone please explain the concept of currying to me. I am primarily learning it because we are learning ML in my ‘modern programming language’ class for a functional language introduction.

In particular you can use this example:

    -fun g a = fn b => a+b;
      val g = fn: int -> int -> int
    -g 2 3;
      val it = 5 : int

I’m confused how these parameters are passed or how to even think about it in the first place.

Thank you for any help.

  • 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-12T22:13:03+00:00Added an answer on June 12, 2026 at 10:13 pm

    In this case, you make the currying explicit, so it should be easier to understand.

    If we read the function definition, it says (paraphrased): “Create a function g, which when given an a returns fn b => a+b.”

    That is, if we call g 2, we get back the function fn b => 2+b. As such, when we call g 2 3, we actually call (g 2) 3; that is we first get the function stated above back, and then use this function on the value 3, yielding 5.

    Currying is simply the concept of making a function in several “stages”, each taking an input and producing a new function. SML has syntactic sugar for this, making g equivalent to the following:

    fun g a b = a + b;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The concept of narrowing seems pretty straight-forward. However, could someone please explain why some
Could someone please explain clearly and succinctly the concepts of language type systems? I've
Could someone please explain, I do not exactly get the concept. What is a
Could someone please explain the behavior of this class testCompile { /* * Sample
Could someone please explain what the difference is between these two examples? Class A
could someone please explain why the first unit test class works whereas the second
Could someone please explain why this is happening? var y = new int[]{1,2}; Console.WriteLine(y
Could someone please explain this weird phenomenon: http://jsfiddle.net/sPA2V/ For some reason, the box footer
Could someone please explain when would I want to use delegation instead of inheritance?
Could someone please explain to me how to properly use the Anchors when creating

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.