Hi,
unfortunatelly, you need to write the lambda function explicitly. There were some discussions about this topic on the hub (see: [link:cs.hubfs.net]), so this is definitely an active topic. I think it could be simplified in some future version, but probably not soon...

In the meantime you'll probably have to use lambda functions or define your utility functions. Alternatively you can use functions from PowerPack to do this:

1
2
3
#r "FSharp.PowerPack.dll" // #r in FSI or Add Reference in Visual Studio
|> ..
|> String.trim [ ',' ]

However, in this case, I'd probably just abandon pipeline and use dot-notation:

1
2
 
let s = ([1..10] |> List.fold_left (fun acc i -> acc + string i + ",") "").TrimEnd [| ',' |]

BTW: you can do similar thing as your code sample does easily using String.Join method from .NET string (you'll need to add open System).

By on 11/4/2008 9:56 AM ()

That's very helpful Tomas, thank you

By on 11/4/2008 10:06 AM ()

Yes, you need to use a lambda, as you have.

By on 11/4/2008 9:51 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper