Skip to content
0:00 / 0:00

#fsharp#domain-drivendesign#typesystems

Domain Modeling Made Functional - Scott Wlaschin

NDC Conferences

230K subscribers • 68 videos on Hallway • Conference channel

YouTube
  • Recommended by 8 people: 6 on Hacker News, 1 on Lobsters and 1 in engineering communities.
  • A classic. People kept recommending it from 2018 to 2024.
  • Presented by Scott Wlaschin, author of F# for Fun and Profit

Intermediate. Assumes working knowledge.

71K views9 years ago8 recommendations

Software designProgramming languagesDomain-driven designFunctional programmingSoftware architecture

Scott Wlaschin explains how to use statically typed functional programming in F# to model business domains and enforce business rules at compile time.

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. NDC Conferences ndcoslo.com ndcconferences.com

Why it's here

8 people recommend this

What people say. Engineers frequently recommend this talk as a mind-blowing and highly practical introduction to domain-driven design using functional types.

Moments people linked to

u/tehnologiein r/functionalprogramming • Recommends

Domain Modeling Made Functional (Scott Wlaschin)

markdoubleyouon Hacker News • Recommends

On “Try OCaml”

The "F# for fun and profit" site by Scott Wlaschin is a great jumping-off point: link I discovered it when I was reading a lot about domain driven design, and I stumbled upon a talk by the author that kind of blew my mind: "Domain Modeling Made Functional" link to this video

BoiledCabbageon Hacker News • Recommends

On “Why functional programming matters (1990) [pdf]”

…se line of business apps in F#. The author argues why it's so much simpler, and simply walks through an example with cases. It's hard not to be persuaded. It leaves behind all of the lofty crazy maths you see in a lot of presentations of FP, and just shows how it's a simpler technique to solve real world problems. Domain Modeling Made Functional - link to this video (Watch on 1.25x speed) It's really impressive, and also surprising why more people promoting FP don't show it's tangible benefits and simplicity vs. the theoretical/abstract way it's usually presented. It's also a great introduction to 'Domain Driven Design' and data modeling regardless of the language you use.…

dbremneron Lobsters • Recommends

Domain Modeling Made Functional (2017)

KurtMuelleron Hacker News • Recommends

On “Math is an insurance policy”

Scott Wlaschin, author of F# for Fun and Profit, has an excellent talk on using F# (an ML language) for domain driven design and business development: link to this video

rashkovon Hacker News • Recommends

On “BuckleScript Is Rebranding”

Yep! This talk captures it pretty darn well: link to this video Besides that, the compiler becomes a partner in coding. - Refactoring things is no longer something I avoid, because the compiler will point out any unexpected places that interact with a given piece of code. - I can code for an hour without loading the app, and be reasonably certain that the code I'm writing will be more or less be correct. Overall, I feel like the compiler does the double-checking and second-guessing that I was always doing in the back of my head, which gives some peace of mind and frees me up to focus on the actual task.

carapaceon Hacker News • Recommends

On “Write code. Not too much. Mostly functions.”

I like this talk: "Domain Modeling Made Functional" by Scott Wlaschin link to this video He's working in F# but the concepts map. There's a fascinating book "Data Model Patterns: A Metadata Map" by David C. Hay that's pretty much a Pattern Language or catalog for data models. You can just implement the subset of Hay's patterns that make sense for your application.

carapaceon Hacker News • Recommends

On “Haskell is a Bad Programming Language (2020)”

In re: Haskell's goodness or badness, compare and contrast with, say, PHP (crap language with wild success.) Or Prolog (a stately Elven language with deep but obscure success.) Haskell is what it is. In re: types and data, FP is good for that. See e.g. "Domain Modeling Made Functional" by Scott Wlaschin ( link to this video ) it's about F# but the concepts apply cross-language. In re: FP PLs "done right" I submit Elm lang. I've been using Elm recently and it gets the job done. It's weird though: on the one hand, as a experienced professional it feels like a toy. The error messages feel almost insulting, like I'm being patronized. On the other hand, once I got over that (silly) reaction, they're awesome…

agentultraon Hacker News • Recommends

On “Why Haskell?”

I adore Scott Wlaschin's work 0 -- that's where I picked up on the acronym, BLOBS! F# is super cool, I agree. 0 link to this video

u/ws-ilazkiin r/functionalprogramming • Mentions

On “Question about the naming of ADTs (Abstract Data Types) in functional programming”

This segment of a Scott Wlaschin talk explains it well. (timestamped to the relevant portion of a longer video.) But the TL;DR is that the name makes sense if you think about the total possible states a type can be in. The sum/product isn't about the relationship of the individual parts, it's about how those pieces combine to define the type. Like if you have a tuple of form `bool * bool * bool`, how many possible states are there for this type? Eight, because 2 states for each boolean and order matters, so 2 * 2 * 2. Meaning it's the *product* of its types. Sum types, on the other hand, are the *sum* of their possible states: if you have `A of bool | B of bool | C of bool` the total…
21View on Reddit

u/captainnoyauxin r/softwarearchitecture • Mentions

On “How to create a good Domain Model?”

I don't know what level of expertise is required for your college project but you can start with isolating business rules from technical details. It might be a bit too hard for you I don't know where you are at but I really like functional programming modeling. There is an excellent talk on that : link to this video If I take an example in his talk for a card game you could have been using a List of cards as your deck, but if I were a client ordering a card game I wouldn't care about the deck being a **list of card** or a set I would like to talk about a **Deck** of **Cards** , those would be part of your domain

carapaceon Hacker News • Mentions

On “One Way to Represent Things”

Take something like the design discipline Scott Wlaschin describes in this talk "Domain Modeling Made Functional"1. Combine it with a catalog of standard models like David Hay's "Data Model Patterns: A Metadata Map"2 which is like a Pattern Language for data models combined with a catalog covering most (enterprise) needs. Specify the binary formats with Erlang "bit syntax"3. Eh? 1 link to this video 2 link 3 link

valandon Hacker News • Mentions

On “The new wave of React state management”

I haven't worked with Qt so I don't know how the API looks, But on a complex app, to see "dirty bitflags", "intermediate values", "redrew the UI in the middle of mutating document state", I feel what you feel, and I want to share what helps me and my team overcome this kind of complexity. This happened a few years ago to my team. We alleviated this with several solutions. The most effective solutions is to 1.) separate UI logic/compositive component from UI visual/appearance component, 2.) separate UI component from actors. 1.) Separating logic from visual helps developers define problems separately, especially those around the required states, step-functions, and lifecycle. We made this sep…

u/v-alan-din r/typescript • Mentions

On “Proper typing between frontend and backend in a monorepo”

>sometimes I get unwanted fields despite the casting due to javascript shenanigans, and I still have no strong guarantee of how objects I get actually look like I would invest in runtime-type validation such as https://github.com/gcanti/io-ts or https://zod.dev/ >Some stuff in the db is not present in my User type, such as password hashes, which are only used in the backend when authenticating. If this is the result of a bunch of manual casting, I suggest looking at this [video That is not quite typescript, but it is a great strategy to model your objects. Combine it with runtime type validation and then you will eliminate a lot of \`as unknown as T\` in your code.