Lesson 27. Exposing F# types and functions to C#
In this unit (and indeed throughout this book), you’ve concentrated on how to consume C# from F#. But it’s common to also go the other way, and write libraries in F# and consume them in C#. For example, you might create a data access layer in F# underneath a C# GUI, or write a general-purpose NuGet package in F# that can be consumed in both C# and F#. This lesson covers the following:
- F# data types
- Namespaces and modules
- F# functions
- Gotchas when consuming F# code from C#
Even in an existing code base that’s mostly C#, you’ll still want to work with F# in some cases. We’ll cover more of this in the coming lessons, but it’s not that unusual—particularly when working on larger projects or with ...
Get Get Programming with F# now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.