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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:39:50+00:00 2026-05-14T15:39:50+00:00

I have a piece of code: links |> Seq.map (fun x -> x.GetAttributeValue (href,

  • 0

I have a piece of code:

links
    |> Seq.map (fun x -> x.GetAttributeValue ("href", "no url"))

Which I wanted to rewrite to:

links
    |> Seq.map (fun x -> (x.GetAttributeValue "href" "no url"))

But the F# compiler doesn’t seem to like that. I was under the impression that these two function calls were interchangeable:

f (a, b)
(f a b)

The error that I get is:

The member or object constructor ‘GetAttributeValue’ taking 2 arguments are not accessible from this code location. All accessible versions of method ‘GetAttributeValue’ take 2 arguments.

Which seems amusing, as it seems to indicate that it needs what I’m giving it. What am I missing here?

  • 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-14T15:39:51+00:00Added an answer on May 14, 2026 at 3:39 pm

    A usual function call in F# is written without parentheses and parameters are separated by spaces. The simple way to define a function of several parameters is to write this:

    let add a b = a + b
    

    As Pascal noted, this way of specifying parameters is called currying – the idea is that a function takes just a single parameter and the result is a function that takes the second parameter and returns the actual result (or another function). When calling a simple function like this one, you would write add 10 5 and the compiler (in principle) interprets this as ((add 10) 5). This has some nice advantages – for example it allows you to use partial function application where you specify only a first few arguments of a function:

    let addTen = add 10 // declares function that adds 10 to any argument
    addTen 5  // returns 15
    addTen 9  // returns 19
    

    This feature is practically useful for example when processing lists:

    // The code using explicit lambda functions..
    [ 1 .. 10 ] |> List.map (fun x -> add 10 x) 
    
    // Can be rewritten using partial function application:
    [ 1 .. 10 ] |> List.map (add 10) 
    

    Now, let’s get to the confusing part – in F#, you can also work with tuples, which are simple data types that allow you to group multiple values into a single values (note that tuples aren’t related to functions in any way). You can for example write:

    let tup = (10, "ten")    // creating a tuple
    let (n, s) = tup         // extracting elements of a tuple using pattern 
    printfn "n=%d s=%s" n s  // prints "n=10 s=ten"
    

    When you write a function that takes parameters in parentheses separated by a comma, you’re actually writing a function that takes a single parameter which is a tuple:

    // The following function:
    let add (a, b) = a * b
    
    // ...means exactly the same thing as:
    let add tup = 
      let (a, b) = tup  // extract elements of a tuple
      a * b
    
    // You can call the function by creating tuple inline:
    add (10, 5)
    // .. or by creating tuple in advance
    let t = (10, 5)
    add t
    

    This is a function of a different type – it takes a single parameter which is a tuple, while the first version was a function that took two parameters (using currying).

    In F#, the situation is a bit more complicated than that – .NET methods appear as methods that take a tuple as a parameter (so you can call them with the parenthesized notation), but they are somewhat limited (e.g. you cannot create a tuple first and then call the method giving it just the tuple). Also, the compiled F# code doesn’t actually produce methods in the curried form (so you cannot use partial function application directly from C#). This is due to performance reasons – most of the times, you specify all arguments and this can be implemented more efficiently.

    However, the principle is that a function either takes multiple parameters or takes a tuple as a parameter.

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

Sidebar

Ask A Question

Stats

  • Questions 374k
  • Answers 374k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer var _href = $("a.directions-link").attr("href"); $("a.directions-link").attr("href", _href + '&saddr=50.1234567,-50.03452'); To loop… May 14, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer The licensing is as follows: Castle Project: Apache License ANTLR… May 14, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer If I remember throw has been deprecated because there is… May 14, 2026 at 7:59 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.