Upgrade to Pro — share decks privately, control downloads, hide ads and more …

F# Type Providers

F# Type Providers

lightning talk presented at Milwaukee Functional Programming group in March 2018

Joel Clermont

March 06, 2018
Tweet

More Decks by Joel Clermont

Other Decks in Programming

Transcript

  1. What is a type provider? "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.” https://docs.microsoft.com/en-us/dotnet/articles/fsharp/tutorials/type-providers/index
  2. So . . . code generation? • Real-time • Only

    lives inside compiler (erased types) • Leverages power of F# type system
  3. Why use them? • Deal with external data in a

    type-safe way • Very low friction for quickly interacting with data • Not an SDK that has to be versioned, updated, etc
  4. Windows only? • Almost ready for primetime with .NET Core

    2.1 • FSharp.Data ported, many others being updated
  5. Next steps • Original paper “Types from data: Making structured

    data first-class citizens in F#”
 http://tomasp.net/academic/papers/fsharp-data/fsharp-data.pdf • Check out some type providers
 https://github.com/fsprojects/awesome-fsharp#type-providers • Build your own type provider
 https://docs.microsoft.com/en-us/dotnet/fsharp/tutorials/type- providers/creating-a-type-provider • Learn F#
 https://www.manning.com/books/get-programming-with-f-sharp