Here is an example:
open System open System.Runtime.InteropServices [<Interface>] type IPrimitiveParser = // abstract TryParseInt32 : str:string * [<Out>] value:byref<int> -> bool [<EntryPoint>] let main argv = let parser = { new IPrimitiveParser with member __.TryParseInt32 (str, value) = let success, v = System.Int32.TryParse str if success then value <- v success } match parser.TryParseInt32 "123" with | true, value -> printfn "The parsed value is %i." value | false, _ -> printfn "The string could not be parsed." 0 // Success
Here is your interface translated:
[<Interface>] type IStatisticalTests = // abstract JohansenWrapper : dat:float[,] * alpha:float * doAdfPreTests:bool * [<Out>] cointStatus:byref<float> * [<Out>] johansenModelParameters:byref<JohansenModelParameters[]> -> unit
Jack P.
source share