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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:33:13+00:00 2026-05-22T22:33:13+00:00

The function matching is based on the definition of the file in F#: let

  • 0

The function matching is based on the definition of the file in F#:

let f2 x y = x + y
let value5 = f2 10 20
let value = f2(10, 20) <-- Error

let f3 (x, y) = x + y
let value6 = f3(10, 20)
let value = f3 10 20 <-- Error

However, I can use in both ways with one parameter with F#:

let f n = n + 10
let value3 = f 10
let value4 = f(10)

Why is this? Does F# treat parameter matching differently when there is only one input parameter?

  • 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-22T22:33:14+00:00Added an answer on May 22, 2026 at 10:33 pm

    As ashays correctly explains, the two ways of declaring functions are different. You can see that by looking at the type signature. Here is an F# interactive session:

    > let f1 (x, y) = x + y;;  
    val f1 : int * int -> int
    
    > let f2 x y = x + y;;
    val f2 : int -> int -> int
    

    The first function takes a tuple of type int * int and returns int. When calling it, you need to specify the tuple (which is just a single value):

    // Using tuple directly as the argument
    f1 (1, 2)
    
    // .. or by declaring tuple value first
    let tup = (1, 2)
    f1 tup
    

    The type of the second function is int -> int -> int, which is the same thing as int -> (int -> int). This means that it is a function that takes int and returns a function that takes int and returns int. This form is called curried form and it allows you to use partial function application as demonstrated by ashays. In fact, the call:

    f2 1 2
    
    // Could be written as:
    (f2 1) 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

the error I am given: no matching function for call to ‘SimpleRecommender::getMovieId(std::string&)’ What is
I get the error mentioned here: C++ Templates Error: no matching function for call
Duplicate of: There is a function to use pattern matching (using regular expressions) in
I have a JS file with a simple function, matching width\heights of divs. How
I'm making a turn based game, and trying to construct the matching function, when
I am making use of XSLT 2.0 to find the matching substring based on
Im using the eregi() function for matching the string but it is giving the
I have the following pattern matching case in a scala function: def someFunction(sequences: Iterable[Seq[Int]]):Seq[Int]
I am using JavaScript's replace() function to replace a regular expression matching A-Z, a-z,
I have a very simple CLR Function for doing Regex Matching public static SqlBoolean

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.