Skip to content
0:00 / 0:00

#f##domain-drivendesign#algebraicdatatypes

Domain Modeling Made Functional - Scott Wlaschin - KanDDDinsky 2019

KanDDDinsky

4.3K subscribers • 1 video on Hallway

YouTube
  • Recommended by 6 people: 3 on Hacker News and 3 in engineering communities.
  • A classic. People kept recommending it from 2020 to 2026.
  • Presented by Scott Wlaschin, author of Domain Modeling Made Functional

Intermediate. Assumes working knowledge.

73K views6 years ago6 recommendations

Software designProgramming languagesDomain-driven designSoftware architectureFunctional programming

Scott Wlaschin demonstrates how to use statically typed functional programming in F# to model business domains and make invalid states unrepresentable.

Statically typed functional programming languages encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers. Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time. In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.

Why it's here

6 people recommend this

What people say. Recommended as an eye-opening introduction to using static type systems for domain-driven design and making invalid states unrepresentable.

u/TechnoEmpressin r/functionalprogramming • Recommends

Domain Modeling Made Functional - Scott Wlaschin - KanDDDinsky 2019

u/notfromkentohioin r/functionalprogramming • Recommends

If you HAD to work on a project that primarily used object-oriented design, what functional programming patterns (if any) would you keep in your tool box? I was introduced to functional programming recently through Rich Hickey's Simple Made Easy talk and subsequently watched a few more of his videos, as well as Scott Wlaschin's talk on Domain Modeling Made Functional. In general it's fun to learn new paradigms, but I'm also very drawn to the concepts of reducing complexity, using composable types, and idempotency. That said, I can't (and shouldn't, given how inexperienced with it I am) impose purely functional design on a team that currently uses and understands an object-oriented app…

u/Altruistic_Cable_163in r/dotnet • Recommends

Domain modeling made functional

devmunchieson Hacker News • Recommends

On “Draft of OCaml Scientific Computing book”

…ces, youtube videos, etc, but you can use any C# modules in F# so you'll get used to reading C# docs. I would highly recommend this overview of the .Net ecosystem: link I really like how it showed a preview of "modern C#" at 12:20 which is being influenced by F#. After that, this talk opened my eyes to the power of f# philosophy and type system: link to this video…

Huggernauton Hacker News • Recommends

On “Learn Functional Programming Visually”

For anyone looking for a smaller introduction to this book, the author Scott Wlaschin has a talk with the same name: link to this video It doesn't cover a lot of good topics in the book, but it might whet your appetite.

rapnieon Hacker News • Recommends

On “'Make invalid states unrepresentable' considered harmful”

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. link to this video

rapnieon Hacker News • Recommends

On “Parse, Don't Validate and Type-Driven Design in Rust”

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 link to this video

u/TheSilverNimbusin r/functionalprogramming • Mentions

On “Which Functional Language with strong typing to learn?”

…e before getting into this site. In the talks and on this site, he talks about the functional programming topics with a very humorous and easy-to-understand language. You should really check these out! Here are a few talks of his I highly recommend (with little to no knowledge of functional programming or F# required): * *F# for C# Programmers* | link to this video * *The Functional Programmer's Toolkit* | link to this video * *The Power of Composition* | link to this video * *The Lazy Programmer's Guide to Writing Thousands of Tests* | link to this video * *Domain Modeling Made Functional* | link to this video * *Functional Design Patterns* | link to this video You can also check out this talk that I found interesting, which includes some F#, functional…

u/syedajafri1992in r/haskell • Mentions

On “Haskell for XP style discussions”

The author also has a video where we talks about that: link to this video I really like the idea of being able to "pair program" types that model your domain with subject matter experts.

u/SIRHAMYin r/functionalprogramming • Mentions

On “Scott Wlaschin: Functional Core, Imperative Shell ”

Big fan of Scott Wlaschin's programming talks. Some other domains I think he has great ideas in: \* Domain Driven Design (made functional): [video \* Railway Oriented Programming (value-based control flows): [video \* His F# guides: https://fsharpforfunandprofit.com/why-use-fsharp/ Also I his book on DDD is my favorite on the subject - simple and powerful: https://hamy.xyz/labs/2024-01\_best-book-ddd

u/aarkerioin r/Clojure • Mentions

On “What's the idiomatic way to think about type safety/domain modeling in Clojure?”

…elieve the real challenge doing the "translation" from the Domain to the Models is in the "Abstraction of the components" level, and in that point, there is few differences between strong typed and dynamic languages. Other aspect is that in FP, the Models are created following a "Data Structure Oriented Design" philosophy, rather than objects: link to this video I don't like objects. They are just glorified and untidy name spaces.…

u/CATo5ain r/typescript • Mentions

On “How can I get my coworkers to start "thinking with types"?”

I found this video quite useful before: link to this video Although it’s F#, it looks a bit like typescript and this guy presents functional/type-driven programming in a way that shows all the benefits without any jargon or frills. I was already familiar with domain driven design in an OOP sense before someone sense me this, and it helped me fill that mental gap to FP. Once you’re an FP aficionado, it’s easy to want to show off the cool or flashy elements of functional programming instead how you improve boring programs ;)

u/syedajafri1992in r/haskell • Mentions

On “What is Haskell good for?”

This video is a pretty good primer: [video Conceptually you have some event log that is your source of truth, and your state is derived from it by folding over that log. Now you might not actually do a fold for every query but conceptually that's it. Now coming from an imperative language that's quite a shift in terms of thinking about state. However coming from a functional language, while still a mindset change, it feels much more natural. I've done event sourcing in Typescript and a bit in Scala, and it's been much more pleasant to write in this style using Haskell. I think my team has an easier time groking the concepts than in past experiences. Maybe that's just the Python paradox b…

u/TechnoEmpressin r/ProgrammingLanguages • Mentions

On “Static vs dynamic typing, would love to hear your opinions”

To help with doing domain modeling

u/nadameuin r/functionalprogramming • Mentions

On “If FP can't use UML Class Diagram, then how do you represent your systems?”

link to this video