4 ms·
Saw a presentation on this was done awhile back. Most features are exposable to C# pretty easily - it's pretty easy to design libraries where consumers wouldn't
by akra 9y ago
Saw a presentation on this was done awhile back. Most features are exposable to C# pretty easily - it's pretty easy to design libraries where consumers wouldn't know it was a F# type at first glance if you know how things compile down. If not directly you can always do simple things to make your types consumable in C# (e.g for my DU's I put a "match" member on them and have a Func argument for each case if exposed to C#). Or provide Func<> overloads for C# compatibility rather than the faster non-delegate FSharpFunc equivalents. One feature you can't use from C# is F#'s templated method support (SRTP) which I've used as a get-out-of-jail card when working with some pretty bad APIs due to static duck typing support. I think even the most basic features (e.g. deep structural equality) make it easier to write things especially libraries quicker in F# once you get the hang of it.