let sub (a:float[]) (b:float[])=
[| for i = 0 to Array.length a - 1 do yield a.[i]-b.[i] |]
let fx t = [0..t]
let x=sub (fx t) (fx t)
Above compiles OK.
But the same causes an error when I replace the function call with a method invocation:
type type_f = delegate of float -> float[]
let mutable f =new type_f(fun t->[|0..t|])
let m=f.Invoke(5) //float[]
let y=sub m f.Invoke(5)//error
How do I pass the result of a method invocation as a parameter to a function?