It's a good question.

I think the issue is that (>>) only works with a single (curried) argument - it can't look ahead to see that multiple applications on the left-hand argument will eventually yield the right return type. The code below illustrates this and suggest a solution.

1
2
3
4
5
6
7
8
let f(x,y) = x + y + 1.0
let g (x:float) (y:float) (z:float) = (x,y)

f (g 1.0 1.0 1.0) |> printfn "%f"

// (g >> f) 1.0 1.0 1.0 |> printfn "%f" // no
(g 1.0 1.0 >> f) 1.0 |> printfn "%f" // yes
(fun x y -> (g x y >> f)) 1.0 1.0 1.0 |> printfn "%f" // what you want?
By on 10/12/2008 12:15 PM ()
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