When a fn doesnt' have all it's args, it gets curried - the pipe puts it at the end, as you say, to take advantage of this fact.

If you want the arg to go in first, then use a lambda or a local named fn to re-arrange things. E.g.:

let inline fn' a b c = fn c b a

let y = x |> foo |> fn' 1 2 |> bar

Of course, you can use the same name as the orig fn. if you want, in the scope of the let.

By on 9/26/2009 6:02 PM ()

Thanks. Also I have found succinct way of doing this,- it involves currying :-)

(firstArg |> func) secondArg

By on 9/27/2009 1:53 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