Implementing Modern Types in C#
summary
Demos show concrete conversions of Purescript ideas into C#: ADT-style state (lockbox) is emulated with records and inheritance, shapes and painting cost use externally applied behaviors, and primitives get wrapped into newtype wrappers so values carry meaning at compile time with no runtime cost. Result/option libraries exist but are result/option types and widely incompatible across ecosystems. C# lacks exhaustive pattern matching, forcing underscore fallbacks; builds of full Purescript domains demand lots of RAM (example: ~16 GB) and some emulations compile but lose compiler guarantees.
AI-written summary · about
chapters (8)
- 0:00Introduction and speaker background
- 6:30The problem with null in C#
- 13:37C# enums and their flaws
- 20:01Avoiding primitive obsession
- 28:52Domain modeling with ADTs
- 39:49Flexibility and the expression problem
- 48:17Type classes and advanced type safety
- 52:26Closing thoughts and Q&A
related talks
01h 03mC# 7
56mChange your habits: Modern techniques for modern C#
58mFunctional Programming with C#
54mAlgebraic Data Types for C#
59mHaskell Design Patterns for Genericity & Asynchronous Behavior
01h 02mAdvanced Pattern Matching in C#
56mFunctional Programming on .NET - The Best of Both Worlds
55mThe State of C# - What Have I Missed
