Thursday, May 26, 2016

Using F# modules and types from C#

It's simple to use FSharp modules from C#, but for some reason I always forget exactly how the system works
(maybe too much switching back and forth between Scala/C#/F#/Java...).

Here's some F# snippets and a C# example of how to pull them together. The weird one is C#'s "using static", since the name seems to indicate that it's just pulling in static methods. In addition to pulling in static methods, though, it also pulls in nested types.







Consuming from F# is slightly simpler:



Here's the F# specification for more details.