Skip to content
0:00 / 0:00

#f##monads#monoids

Functional Design Patterns - Scott Wlaschin

NDC Conferences

230K subscribers • 107 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 1 in engineering communities and 1 on Stack Overflow and its sister sites.
  • A classic. People kept recommending it from 2019 to 2023.
  • Presented by Scott Wlaschin

Beginner. No background in the topic needed.

324K views9 years ago2 recommendations

Software designProgramming languagesDesign patternsFunctional programming

Scott Wlaschin explains how functional programming concepts like partial application, monoids, and monads serve as powerful design patterns.

In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID. The functional programming community has design patterns and principles as well. This talk provides an overview of some common FP patterns, from the basics of partial application and currying all the way to monads and monoids. NDC Conferences ndcsydney.com ndcconferences.com

Why it's here

2 people recommend this

What people say. Highly recommended as one of the best introductions to functional programming design patterns and composition.

Moments people linked to

u/scalausrin r/scala • Recommends

…know if any recommended resources (doc, links, videos, and so on) of such topics that fill in this gap? Or diving the library such as cats is the only way to go? I appreciate any suggestions, and commentary. \1\. Functional Design Patterns - Scott Wlaschin \2\. \[Scala Central\ - Richard Ashworth - Functional Design Patterns with Scala](link to this video \3\. Patterns in Functional Programming \4\. Functional Design Patterns…

Petras Purlyson Software Engineering Stack Exchange • Recommends

On “Design - What is the best way to separate functionalities?”

…quickly become apparent what can be grouped how. This will enable you to assemble these basic building blocks into bigger things you might call operations. Operations, then, can be composed into services and so on. It's very tempting to use inheritance in an OO world, but composition goes a much longer way. This is a great video about the topic link to this video and worth every second of it. It's about how F# solves all of these problems and more. I sincerely encourage you to try it (or Haskell, though it's a little harder).…

u/luhsyain r/functionalprogramming • Mentions

On “Gang of four "Design Patterns" equivalent in functional programming”

watch this link to this video

u/Mishkunin r/functionalprogramming • Mentions

On “How to implement something simmilar to a factory in functional programming.”

You should watch an awesome talk by Scott Wlaschin on this topic of transitioning from oop patterns to functional ones link to this video

u/ScientificBeastModein r/functionalprogramming • Mentions

On “Are there typical patterns used in production functional programming that aren't generally taught explicitly?”

There are already some good answers here, but I just want to direct you to this video: Functional Design Patterns - Scott Wlaschin (YouTube) It’s an hour-long talk, but worth it, and it speaks precisely to your question. The gist of it is that there are functions for everything you can imagine. And some of the higher-order functions (functor, monad, etc.) are essentially composable procedures that are completely abstracted away from the data you want to work with. That’s getting a bit abstract, so I’ll leave it there. The video is really good, and helps clarify why we need “design patterns” and what those look like in more *fundamental* terms. Edit: @ /u/RealPiper Just wanted to ad…

u/lingdocsin r/functionalprogramming • Mentions

On “What is a good point to start learning FP ?”

This might help. link to this video And also Barsotz Milewski's YouTube lectures on Category Theory for Programmers. And yes it still is just passing around data through functions in a single flow, it's not like some kind of global mutable state in FP. (Scott Wlaschin talks about it as railway tracks). Monads just allow you to have types of data with extra stuff wrapped around it, so you can mess with that wrapper as it gets passed around, and the wrapper can hold something that you can use like state, but it's never like state in other programming styles. Working through https://htdp.org helped me rethink the whole concept of state. (Or howntk program without it 😁)

u/peripateticman2026in r/functionalprogramming • Mentions

On “Looking for books”

link to this video and the author has a book as well. Much better than working through exercises. Learn patterns instead.

u/circleglyphin r/haskell • Mentions

On “Are there books for code smell / refactoring for functional programming languages?”

…e doesn't mean we weakened our opinions and claims. My personal opinion is that the rot set in with thinking that programming languages have grammatical constructs similar to human languages, composed from things like nouns and verbs (objects and methods, say). It used to be the case that we just dismiss each design principle as just functions: [video But some of us think that functions are problematic: [video The search for perfection continues! \> replacing a loop with a monad (or vica verca). We traverse applicative functors: http://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf…
3View on Reddit

u/PikachuKiiroin r/haskell • Mentions

On “Looking for books”

link to this video is a good watch

u/Menaus42in r/compsci • Mentions

On “what is the alternative to object-orientation?”

ultimately, OOP is a method for problem solving that implements certain patterns in a certain way. Functional programming can implement those patterns too, but it does it in a different way that has different pros and cons. You may have learned those patterns by learning OOP, but they do not make something object-oriented. I recommend this talk related to this question/theme: link to this video

u/tylerayoungin r/elixir • Mentions

On “Architecting GenServers for Testability in Elixir”

My impression of the Elixir community, and the FP community more broadly, is that they tend to resist using the labels that an OOP programmer would use to describe something. (E.g., Scott Wlaschin, of DDD fame, put up this slide where he listed a bunch of OO design patterns and gave their FP equivalent: in all cases, just "functions.") Thus, while folks are _doing_ dependency injection, they don't necessarily call it that, they call it "just passing a function to a higher-order function" and so on. (That's not intended as a criticism of Elixir/FP people... just a different way of looking at it. Having a big OO background, there's value to me in putting these things in the same terms. 🤷‍…
2View on Reddit