Algebraic Data Types for C#
summary
Generates immutable sum and product types for C# by parsing a small DSL with F# parser combinators, mapping its AST to a Roslyn AST builder, and plugging the output into Visual Studio via the single-file generator extension. Replaces ~300 lines of handwritten boilerplate with one declarative union or record line, includes value semantics, copy-with and a match dispatcher, and outputs idiomatic C# code (open source on GitHub) that the IDE and debugger accept.
AI-written summary · about
chapters (5)
- 0:00Start
- 18:03PROBLEM OVERVIEW
- 23:19REPRESENTATION SYNTAX & SEMANTICS DESIGN
- 49:42INTEGRATION : VISUAL STUDIO INTEGRATION
- 57:29SUMMARY OF STEPS
related talks
54mAlgebraic Data Types for C#
51mThe Future of C#
01h 00mF# for the C# Developer - F#, the .NET Runtime, and Aesthetics
54mImplementing Modern Types in C#
01h 00mPattern-based C#: if it quacks like a duck…
42mF# for the curly brace developer
01h 02mUsing C#'s Type System Effectively
01h 00mLet's Code an incremental source generator with Roslyn
