Dungeons, Dragons and Functions
summary
Tells how the 300‑page D&D rules get encoded into concrete types and functions in F# over four months, with discriminated unions and records for stats, a composable dice DSL (operator overloads for roll expressions), and a browser UI built with fable + Elmish that hot‑reloads. Delivers a working combat simulator that can run automated fights (shows goblins vs wolves), stores code on GitHub, and currently lacks buffs/debuffs and smarter AI but plans reinforcement learning to tune encounter survival probabilities.
AI-written summary · about
chapters (19)
- 0:00Start
- 1:39Origin Story
- 6:39Player's Handbook (PHB)
- 9:16Ogres, Goblins, & Company
- 10:30Discriminated Union
- 10:53Abilities
- 11:42Pattern Matching
- 12:36Pipe forward
- 13:29Function
- 16:44Goblin attacks
- 17:36Different structure: OR
- 18:28Melee & Ranged
- 19:08Attack: a sketch
- 20:13Pattern Match to extract data
- 24:45Wyvern attacks
- 27:40The truth...
- 41:57Evaluation
- 48:13Fable Elmish
- 55:08Representing decisions
related talks
56mDesigners, Dungeons and Dragons
43mVisual functional programming with DRAKON-Erlang
44mTyped Design Patterns for the Functional Era
48mLevel up: playing the automation game
25mUnexpected places: Figma as a space for anything and everything
37mThe Laws of Magic
49mKeeping Teams Aligned Through Minimal Documentation
01h 03mTactical Design
