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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:18:17+00:00 2026-05-18T08:18:17+00:00

Some apis like Ninject use fluent style apis, example: Bind<ISomething>() .To<Something>() .WithConstructorArgument(arg1, somevalue) .OnActivation(x

  • 0

Some apis like Ninject use fluent style apis, example:

Bind<ISomething>()
.To<Something>()
.WithConstructorArgument("arg1", "somevalue")
.OnActivation(x => x.DoSomething())

When I try format the code like this in F# the compiler complains at the whitespace between method calls.

Is it possible to put the method calls on seperate lines? I was thinking something like the pipelining operator |> but not exactly sure how in this case.

How should this be formatted in F#?

  • 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-18T08:18:17+00:00Added an answer on May 18, 2026 at 8:18 am

    Are you sure this doesn’t work?

    Bind<ISomething>() 
     .To<Something>() 
     .WithConstructorArgument("arg1", "somevalue") 
     .OnActivation(fun x -> x.DoSomething()) 
    

    (note one space before the .s)

    Yeah, it’s fine:

    type ISomething = interface end
    type Something = class end
    
    type Foo() =
        member this.To<'a>() = this   //'
        member this.WithConstructorArgument(s1,s2) = this
        member this.OnActivation(x:Foo->unit) = this
        member this.DoSomething() = ()
    
    let Bind<'a>() = new Foo() //'
    
    let r = 
        Bind<ISomething>() 
            .To<Something>() 
            .WithConstructorArgument("arg1", "somevalue") 
            .OnActivation(fun x -> x.DoSomething()) 
    

    So long as you have some leading whitespace when you try to continue a single expression onto multiple lines, you’re ok.

    (Note that pipelining in general won’t work unless you have APIs designed for it with curried method parameters.)

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

Sidebar

Related Questions

I'm currently experimenting with some APIs, and I'll like to know how to use
Some APIs, like the WebClient, use the Event-based Async pattern . While this looks
I'd like to use various APIs that are listed on this Unsupported APIs for
I found some private (undocumented) APIs but Apple does not allow apps to use
I am creating an address control which would use some address validation APIs( google/bing
I'm a little confused by this. I notice that some web APIs use the
i would like to implement some kind of service my customers can use to
I'm playing around, trying to write some code to use the tr.im APIs to
I'd like to use a color picker when I edit some cells in a
The documentation of some JavaScript APIs shows the following snippets as an example of

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.