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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:34:43+00:00 2026-05-17T23:34:43+00:00

Possible Duplicate: Functional programming: currying I’m reading the free F# Wikibook here: http://en.wikibooks.org/wiki/F_Sharp_Programming There’s

  • 0

Possible Duplicate:
Functional programming: currying

I’m reading the free F# Wikibook here:

http://en.wikibooks.org/wiki/F_Sharp_Programming

There’s a section explaining what Partial Functions are. It says that using F# you can partially use a function, but I just can’t understand what’s going on. Consider the following code snippet that is used an example:

#light
open System

let addTwoNumbers x y = x + y
let add5ToNumber = addTwoNumbers 5

Console.WriteLine(add5ToNumber 6)

The ouput is 11. But I’m not following. My function ‘add5ToNumber’ doesn’t ask for a paramter so why can I invoke it and give it it one?

I really like learning about F# these days, baby steps!

  • 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-05-17T23:34:44+00:00Added an answer on May 17, 2026 at 11:34 pm

    Basically, every function in F# has one parameter and returns one value. That value can be of type unit, designated by (), which is similar in concept to void in some other languages.

    When you have a function that appears to have more than one parameter, F# treats it as several functions, each with one parameter, that are then “curried” to come up with the result you want. So, in your example, you have:

    let addTwoNumbers x y = x + y
    

    That is really two different functions. One takes x and creates a new function that will add the value of x to the value of the new function’s parameter. The new function takes the parameter y and returns an integer result.

    So, addTwoNumbers 5 6 would indeed return 11. But, addTwoNumbers 5 is also syntactically valid and would return a function that adds 5 to its parameter. That is why add5ToNumber 6 is valid.

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

Sidebar

Related Questions

Possible Duplicate: Why functional languages? I began programming with C/C++, VB, and eventually Python
Possible Duplicate: C programming : How does free know how much to free? In
Possible Duplicate: C programming : How does free know how much to free? In
Possible Duplicate: Functional programming and non-functional programming I'm afraid Wikipedia did not bring me
Possible Duplicate: Sizeof an array in the C programming language? Why is the size
Possible Duplicate: Setting variable to NULL after free … I am learning about good
Possible Duplicate: Malloc thread-safe? I am not a bit confused while I am reading
Possible Duplicate: Sizeof an array in the C programming language? Why does a C-Array
Possible Duplicate: Get path of executable I'm programming on Windows using MinGW, gcc 4.4.3.
Possible Duplicate: Counting inversions in an array This is a programming question that I

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.