When interacting with F # libraries from IronPython, it seems that the Python function object is not automatically converted to the standard F # FastFunc function object when passed to the F # interface, which takes the function as one of the parameters.
Python function objects, on the other hand, convert nicely to System.Func <> if the interface is one of them. That is, it is not easy to call from python:
let myFunc (f: float->float) = f(3.5)
and the following works fine:
let myFunc2 (f: System.Func<float, float>) = f.Invoke(3.5)
So my question is: if I want to be able to easily combine my Python function functions with F # functions, is there a way I can convert a System.Func <> object to a FastFunc object (to be able to have a thin interface to IronPython / C # etc, but be able to use the provided function as a regular F # function deeper in lib)?
Thanks Ricard
ps I donβt have enough reputation to create a new tag, maybe someone can create a FastFunc tag and flag this question if you find it appropriate
source share