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

  • Home
  • SEARCH
  • 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 4551180
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:35:59+00:00 2026-05-21T16:35:59+00:00

Is it possible to somehow use a pipeline to pass in the last argument

  • 0

Is it possible to somehow use a pipeline to pass in the last argument of a method with tupled parameters?

An example:

// Member to call

static member Property (expr:Expr<'a -> string>, cfg:EntityInfo<'a>) = cfg.Property expr

// My curry function

let curry f x y = f (x,y)

// My EntityInfo<FileUpload>

let entityInfo = EF.Entity<FileUpload> modelBuilder

I want to be able to call it like:

entityInfo |> curry EF.Property <@ fun z -> z.Path @>

instead of

EF.Property(<@ fun z -> z.Path @>, entityInfo)
  • 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-21T16:36:00+00:00Added an answer on May 21, 2026 at 4:36 pm

    I believe that this is a simplified version of your problem (although you’re excluding too much code to be sure):

    type T() = class end
    
    type S =
        static member Method(_:int, T) = 'c'
        static member Method(_:string, T) = false
    
    let curry f x y = f(x,y)
    
    // won't work
    T() |> curry S.Method 1
    

    As Brian mentions, overloading doesn’t play nicely with type inference. In particular, since F#’s type inference works left-to-right, the compiler does not use the fact that 1 is an int when trying to do the member lookup for S.Method, which means that it can’t identify the correct overload. As I see it, you have a few options:

    1. Use distinct method names. Is there a reason that you have to use Property to refer to multiple different operations? Would it be much worse to use StringProperty, IntProperty, etc. for each overload? In general, overloading makes life harder for the compiler (and often for human maintainers, too). As an aside, I don’t like the idea of naming a method Property, anyway…
    2. Use explicit type parameters on curry, and specify them. E.g.

      let curry<'a,'b,'c> f (x:'a) (y:'b) : 'c = f(x,y)
      entityInfo |> curry<Expr<_ -> string>,_,_> EF.Property <@ fun z -> z.Path @>
      
    3. Explicitly indicate the type of EF.Property:

      entityInfo |> curry (EF.Property: Expr<_ -> string> * _ -> _) <@ fun z -> z.Path @>
      

    Of course, these last two options aren’t very concise, so they may defeat the purpose of using the pipelined style.

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

Sidebar

Related Questions

is it somehow possible to use a lambda within a call to assert() ?
Is it somehow possible to use the 'With' keyword on an existing object? I
UDK uses .NET. So maybe it is possible somehow to use .NET from UnrealScript?
is it somehow possible to use {{var invoice.increment_id}} in the creditmemo e-mails? It don't
Is it somehow possible to use boost::object_pool<>::construct with non const references? The following snippet
Is it possible somehow to define a constant that says what datatype to use
I wonder if it's somehow possible to use the stop() function (I normally use
is it possible somehow to use the NOW() function or something similar in MYSQL
Is it possible, using SQL Server Reporting Services (SSRS) 2008 R2, to somehow use the
Is is possible to somehow use ngTransclude for an attribute value, instead of replacing

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.