Algebraic Data Types for C#
summary
Explains how to get true immutable algebraic data types into C# by defining a tiny DSL files embedded in project then turning that AST into real C# via Roslyn code generation and F# parser combinators (FParsec). Demonstrates the actual generated patterns: private constructors, sealed subclasses, structural equality, a match method, and Visual Studio integration as a custom tool that emits code on save. Points to an open source repo on GitHub and C# Union extension for instant use.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:34Algebraic Data Types
- 6:30Record Types
- 8:45Sum Types
- 13:42Scala
- 16:55NewSum
- 18:42Equal
- 20:27Value Semantics
- 22:29Pattern Matching
- 26:22boilerplate code
- 27:48language
- 29:00SP approach
- 36:46Passing
- 42:56Rosalind Style Generation
- 44:11Parameterize
- 45:11Visual Studio
- 45:46Code Generator
related talks
01h 03mAlgebraic Data Types for C#
54mImplementing Modern Types in C#
01h 00mPattern-based C#: if it quacks like a duck…
01h 02mUsing C#'s Type System Effectively
51mThe Future of C#
01h 00mF# for the C# Developer - F#, the .NET Runtime, and Aesthetics
37mC# 8 and Beyond
01h 06mThe State of C# - What Have I Missed?
