Hi,
just a short addition - if your primary goal is to use the library from C# then it may be worth to design it in a more "C#-friendly" way. Instead of using F# functions in the arguments, you can declare delegate type and using the functions from C# will then be straightforward:
> type FCallback = delegate of int*int -> int;;
type FCallback =
delegate of int * int -> int
> let f3 (f:FCallback) a b = f.Invoke(a,b);;
val f3 : FCallback -> int -> int -> int
The C# code could then use the usual style:
int a = Module1.f3(Module1.f2, 10, 20); // method gets converted to the delegate automatically in C#
Hope this helps!
T.
Tomas Petricek (
Blog), C# MVP
My book:
Real-world Functional Programming in .NET