O'Reilly logo

Get Programming with F#: A guide for .NET developers by Isaac Abraham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required