Lesson 30. Introducing type providers

 

Welcome to the world of data! The first lesson of this unit will

  • Gently introduce you to type providers
  • Get you up to speed with the most popular type provider, FSharp.Data

After this lesson, you’ll be able to work with external data sources in various formats more quickly and easily than you’ve ever done before in .NET—guaranteed!

30.1. Understanding type providers

Type providers are a language feature first introduced in F# 3.0:

An F# type provider is a component that provides types, properties, and methods for use in your program. Type providers are a significant part of F# 3.0 support for information-rich programming.

At first glance, this sounds a bit fluffy. You already know what types, properties, and methods are. And what does information-rich programming mean? The short answer is to think of type providers as T4 templates on steroids—a form of code generation, but one that lives inside the F# compiler. Confused? Read on.

30.2. Working with your first type provider

Summary