Domain Modeling Made Functional - Scott Wlaschin - KanDDDinsky 2019

Channel:KanDDDinsky · Length:50:49 · Published:2019-12-06 · Views:74199

Watch on YouTube

Summary

Scott Wlaschin shows how statically typed functional languages, using F# examples, can model a business domain so that invalid states cannot be represented. The type system acts almost like an instant unit test at compile time.

Why HN recommends it

HN treats it as the canonical, approachable example of domain-driven design with types and 'make invalid states unrepresentable'.

this talk opened my eyes to the power of f# philosophy and type system — HN, 2020

Programming language design · Functional programming · Software architecture & design

Subtitles (excerpt)

[Music] thanks everyone for coming this is the main modeling made functional and hopefully you haven't seen this before otherwise you'll know the answer to all these questions but before we get started I just actually have a little challenge for you which is here's some code this is f-sharp code which is what I'll be using the code really doesn't matter but this is some sort of record type and there's these fields and there's an email address and there's this flag called is email verified which must be true if you have proved with the own email by clicking a link in an so if you saw this code in a code of you would you be happy with it or would you want to change it and if you would want to change it why would you want to change it's using primitive types good any other yeah the state is so it's hard to understand using a boolean to represent something much more complex and yeah so I mean I bit to be honest I probably would have been fine with this a few years ago but I've sort of evolved my thinking about this kind of design and I'm going to try and explain in this talk I'm going to try to explain why you know how I've evolved and why you might want to think about changing stuff so domain modeling made functional my name's Scott volution I have a twitter handle

On Hacker News

I wouldn't say its unloved or on a side track, it's baked into .net as a first class citizen and has dedicated engineers at Microsoft working on it. When I started I was pleasantly surprised how easy it was to download .net core on a mac and not do anything else to use F#. Its less popular than C# so its there's not as much documentation from 3rd party sources, youtube videos, etc, but you can us… — devmunchies, 2020-08
You can also search for "make invalid states impossible/unrepresentable" [0] to find more info on related practices. See "domain modeling made functional" [0] as a nice example [0] [LINK] [1] [VIDEO] — rapnie, 2026-02
I can recommend "Domain Modeling Made Functional" by Scott Wlaschin presented at KanDDDinsky 2019, that offers a very appealing example for making making invalid states unrepresentable. The example code is in F# but that is a perfect language to demonstrate the general idea. Best-practice I guess boils down to finding the right balance throughout the application design. [VIDEO] — rapnie, 2025-09
For anyone looking for a smaller introduction to this book, the author Scott Wlaschin has a talk with the same name: [VIDEO] It doesn't cover a lot of good topics in the book, but it might whet your appetite. — Huggernaut, 2021-02

Related videos