Advanced Pattern Matching in C#
summary
Walks through concrete C# pattern features added in C# 7–11 pattern features (type, property, positional/tuple, relational, list and spread patterns), shows span<T> for performance when matching lists, and ports a Haskell red‑black tree balance function into C# using pattern matches. Demonstrates a runnable library with 514 unit tests passing, explains how tuple syntax becomes positional patterns, and proves the port is concise, maintainable and functionally equivalent to the original implementation.
AI-written summary · about
chapters (13)
- 0:00Introduction to pattern matching
- 1:26Use cases and perspective
- 3:21Porting algorithms
- 6:09C# feature history
- 8:20Syntax examples and basics
- 12:37Advanced pattern matching
- 16:28Nested paths and Refactoring
- 19:43List and Span matching
- 26:00Interesting side cases
- 35:56Changing industry guidance
- 39:56Functional programming in C#
- 48:32Porting complex examples
- 52:57Live demo and conclusion
related talks
52mFunctional Patterns for the Object Oriented
01h 03mC# 7
01h 03mFunctional Programming with C#
56mChange your habits: Modern techniques for modern C#
59mLet’s catch up with C#! Exciting new features in C# 9, 10, 11, 12 and 13!
58mFunctional Programming with C#
54mImplementing Modern Types in C#
55mThe State of C# - What Have I Missed
