You can expose this function to C# using custom delegate type :
EDITED
// F#
module Lib
let tryParseArray parser (line : string) (sep : char) =
// don't know your exact implementation so again just guessing...
line.Split sep
|> Array.choose (fun el ->
match parser el with
| true, el -> Some el
| false, _ -> None
)
open System.Runtime.InteropServices
type TryParse<'R> = delegate of str : string * [<Out>] res : byref<'R> -> bool
type T =
static member TryParse(line : string, tryParse : TryParse<'R>, separator : char) : 'R[] =
tryParseArray tryParse.Invoke line separator
//C#
var r = Lib.T.TryParse<int>("1,2,3", int.TryParse, ',');
NOTE: on the C# side you'll need to specify type parameter for TryParse explicitly (Why don't anonymous delegates/lambdas infer types on out/ref parameters?)