The Functional Programmer's Toolkit - Scott Wlaschin

  Рет қаралды 69,352

NDC Conferences

NDC Conferences

Күн бұрын

The functional programming community has a number of patterns with strange names such as monads, monoids, functors, and catamorphisms.
In this beginner-friendly talk, we'll demystify these techniques and see how they all fit together into a small but versatile "tool kit".
We'll then see how the tools in this tool kit can be applied to a wide variety of programming problems, such as handling missing data, working with lists, and implementing the functional equivalent of dependency injection.
NDC Conferences
www.ndcconferences.com/
ndc-london.com/

Пікірлер: 62
@MarkusBurrer
@MarkusBurrer Жыл бұрын
In my opinion this is the most important talk about Functional Programming
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
It doesn't seem to contain any less bullshit than any other talk on FP. ;-)
@qewolf
@qewolf 5 жыл бұрын
Tool #1 - Combining things with Monoids - 13:12 Effects - 27:04 Tool #2 - Moving functions between worlds with "map" - 32:50 Tool #3 - Moving values between worlds with "return" - 37:15 Tool #4 - Chaining world-crossing functions with "bind" - 38:12 Tool #5 - Combining effects in parallel with applicatives - 54:28 Example - Using all the tools together - 59:45
@anupjoseph7368
@anupjoseph7368 3 жыл бұрын
Good Human
@MrTruthAndFacts
@MrTruthAndFacts 5 жыл бұрын
Scott Wlaschin is the best. Excellent ability to simplify complex ideas. His blog is one of the best resources on learning proper programming; i.e. FP
@timz4183
@timz4183 5 жыл бұрын
Scott Wlaschin is so awesome! He made me a better software developer.
@tullochgorum6323
@tullochgorum6323 Жыл бұрын
I've been dipping my toe into FP for decades, but most of the teaching material is opaque for anyone who isn't mathematically literate. Scott is the first FP teacher I've found who can explain the value of FP for regular line-of-business type work. This talk is pure gold - along with his website and his outstanding book on functional DDD. If anyone is struggling to understand the essence of functional thinking, direct them here!
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
The essence of FP thinking seems to be mostly bullshit. ;-)
@EldronGah
@EldronGah Жыл бұрын
One of the best video I have seen on FP, truly a gem
@inversebrah
@inversebrah 2 жыл бұрын
this lecture should have more views
@jbrains
@jbrains 4 жыл бұрын
I always enjoy a speaker who distinguishes "unfamiliar" from "complicated".
@brettkoenig9897
@brettkoenig9897 4 жыл бұрын
This is so awesome! I’ve been working on learning FP for a couple months now and this cleared a lot of things up.
@Archon-Zero
@Archon-Zero 5 жыл бұрын
Wonderful! Thanks Scott.
@dcuccia
@dcuccia 3 жыл бұрын
A timeless talk!
@gzoechi
@gzoechi 4 жыл бұрын
Beautiful explanation!
@ycombine1053
@ycombine1053 3 жыл бұрын
I always really enjoy Scotts presentations. He's had a great blend of theoretical and practical knowledge that really make some of the more abstract parts of functional programming accessible to mere mortals. I enjoy watching others like Briam Beckman too, but his genius often takes for granted his audience, and I have to pause the video to look up term from category theory that he assumes you're initmately aware of.
@raymondyoo5461
@raymondyoo5461 9 ай бұрын
Great talk 👍 You’re handling well almost every topic of FP only in an hour Impressive 👏👏
@hieuvhla12
@hieuvhla12 4 жыл бұрын
Love your talk
@wuzixiao1
@wuzixiao1 Жыл бұрын
The best talk about FP. It really turns my head around.
@MarkusBurrer
@MarkusBurrer 3 жыл бұрын
I rarely thumb up videos on KZfaq. But for this talk I have to.
@reflechant
@reflechant 5 жыл бұрын
Well, thank you Scott - now I just can't use Go anymore. I knew it's error handling is ugly but knowing how elegant the solution can be is even more painful.
@RohitSingh-tu5kd
@RohitSingh-tu5kd 4 жыл бұрын
I really find Go very bad, rust is far better
@tullochgorum6323
@tullochgorum6323 Жыл бұрын
My sentiments exactly. I started porting a complex C# app to Go in the hope of achieving greater simplicity and ran into a wall. Go seems designed to enable inexpensive drones in cubicles to churn out out basic but ugly code. I found myself increasing hating everything I was writing - it worked, but it was hideous. Then I found F# and haven't looked back. Porting my C# to F# - it's shorter, cleaner, more elegant, easier to test and easier to change. I'm not saying that you can't write good code in C# or Go - but the language is fighting you rather than helping you. F# almost forces you to write good code. Developing has become fun again.
@CrapE_DM
@CrapE_DM 5 жыл бұрын
turn up the volume...
@roysmith5711
@roysmith5711 4 жыл бұрын
I would like to suggest everyone to learn LISP or even better Clojure. FP concepts are much easier to understand in LISP.
@gerardbosch
@gerardbosch 3 жыл бұрын
What does a "points function" mean? Scott is using that term several times along the talk, especially in 53:48 when he presents Kleisli.
@giarc1988
@giarc1988 2 жыл бұрын
I loved this video but so disappointed that you didn't spend more time on applicatives. It's a concept I don't understand and you made me more interested in it but I still don't really understand how to use it lol
@alk99875
@alk99875 2 жыл бұрын
The best 1hour spent in FP
@cat-.-
@cat-.- 2 жыл бұрын
Exactly my thoughts at the 50 minute mark
@VitalyBrusentsev
@VitalyBrusentsev 5 жыл бұрын
There seems to be a mistake in the monoids section: A composition of two functions cannot be a monoid, even if they return the same type. Example: a function "inc" that increments its parameter by 1, and a function "sqr" that returns the square of its parameter. "inc >> sqr" is not the same as "sqr >> inc".
@AntonBurger
@AntonBurger 5 жыл бұрын
What you're describing is commutativity, not associativity. The latter would require the function inc >> (sqr >> double) to be the same as the function (inc >> sqr) >> double. The order of application is the same, but the order of composition can vary.
@VitalyBrusentsev
@VitalyBrusentsev 5 жыл бұрын
@@AntonBurger Thank you, this makes sense to me now.
@Jopie65
@Jopie65 4 жыл бұрын
I watched it again and want to like it again, but I can't! Nr of likes might be monoids cause they are reducible, they turn out not to be repeatable 😣 Isn't there a functional pattern to make it repeatable too? 😁
@omarkhan1491
@omarkhan1491 4 жыл бұрын
1:02:52 final code
@gregbell2117
@gregbell2117 4 жыл бұрын
Can we think of map/lift as wrapping a type in another type? Since plain map takes a function f, and say a list [1,2,3], then map(f, [1,2,3]) returns [f(1), f(2), f(3)]. If types are functions in pure FP, then the result looks to me like a list of a new type. I'm excited if this is true, because that'd be the first cogent sentence about FP I've written :)
@drewsclues8625
@drewsclues8625 2 жыл бұрын
it's been a year but yes that is true! a map is what is called a "Higher-kinded type".
@ecosta
@ecosta 2 жыл бұрын
I always noticed how non-FP languages seems bad at FP. Now I know how to explain it: all of non-FP languages brings some form of "lambda syntax" to pass functions as parameters, but they couldn't bring the whole "FP toolbox" as elegantly as a truly-FP language.
@cat-.-
@cat-.- 2 жыл бұрын
Yeah! When JS started to have arrow functions and flatMap I thought wow isn't that pinnacle FP, but no, Js doesn't have a Maybe type, If you create a maybe type on your own then you need to implement the Functor, Monad and Applicative classes too. You'll also need a Either, and implement the classes on Either, etc. Simply put it's missing the entire GHC.Base lol
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
You can do absolutely everything in every Turing-complete language. :-)
@jumpjumpdiegaming
@jumpjumpdiegaming 2 жыл бұрын
The coughing in public is so 2019!!!
@zaidamascorro5426
@zaidamascorro5426 3 жыл бұрын
listening a talk with someone in the audience coughing a lot, in 2021.
@scotttang6229
@scotttang6229 2 жыл бұрын
Right? not sure why that guy didnt just step out... LOL
@pepineros4681
@pepineros4681 2 жыл бұрын
Still listening in 2022!
@myusernameisrighther
@myusernameisrighther 2 жыл бұрын
@@pepineros4681 the video is just over an hour long… how long is it going to take you to finish it?
@raptoress6131
@raptoress6131 Жыл бұрын
"Chainable". This guy just explained monads with a single word.
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
How does that differ from an ordinary function, except that you just gave it a fancy new name. ;-)
@dougdigdag5680
@dougdigdag5680 Жыл бұрын
I didn't understand everything completely, but this seems like the best introduction to functional programming concepts for object-oriented programmers that I've seen yet. Scott starts by noting that outsiders often ask, "why do functional programmers use so many strange words," like monoid, functor, monad, etc. That's definitely a concern I had, and he does a good job explaining those terms, and even to justify their widespread use by saying that they're just jargon, which practitioners of every discipline use to save time, and that the main reason people don't like functional programming jargon is that it's simply not the jargon that they're familiar with. However, one of the things he doesn't explain, but which seems even more confusing to me personally, is why functional programmers use so many strange, unpronounceable, and unsearchable symbols. That seems far less justifiable to me.
@tullochgorum6323
@tullochgorum6323 Жыл бұрын
Once you get used to the symbols, they become intuitive and readable. Mathematicians do exactly the same thing, for the same reasons. Which is easier to grok: Add two hundred and twenty two to one hundred and fourteen. Then divide the result by one hundred and thirty six. Then multiply the result by three hundred and two. ((222 + 114) / 136) * 302 In functional pseudocode this might look like: add 222 114 |> divide 136 |> multiply 302 which is even easier to read. In another talk, Scott cites a quote which basically says that it's a major error to design a language that's easy to read for the first half-hour and more difficult to read ever after. You simply have to trust that the notation makes sense and get over the initial discomfort. Languages like OCaml and F# and Haskell are designed by people who are a lot smarter than us, and we simply have to trust their judgement till we master the basics and build some fluency.
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
Because they want you to think that they are more intelligent than you. Every bullshitter in the world does that all the time. Just ask your local priest about the meaning of "doxology". ;-)
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
@@tullochgorum6323 Your boss doesn't pay you to be a mathematician-wannabe. He pays you to get the damn software finished. ;-)
@tullochgorum6323
@tullochgorum6323 Жыл бұрын
@@lepidoptera9337 Have you ever actually used an ML-style language? The notation takes about a day to learn. It cuts out substantial amounts of boilerplate and makes the intent of the code much easier to grok. Personally, I find I can churn out reliable and readable code significantly more quickly in F# vs C#. This is a pretty typical reaction from people who make the switch. The idea that functional languages are only for mathematical programming is a myth. I'd recommend you read Scott Wlaschin's Domain Modelling Made Functional - one of the best programming books I've read in decades of coding. He shows how an ML-style language can create robust, concise and maintainable line-of-business code.
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
@@tullochgorum6323 If you have boilerplate in your code, then you are doing something wrong, already. Your boss doesn't pay you to write software systems that need a lot of boilerplate. He pays you to get the damn software finished. :-) I can also churn out a lot of code very quickly in Python. But when I need something that has 100% uptime and zero bugs, then I use C. C does exactly what you ask it to do. Every bug is on YOU. I guess you just can't stomach that kind of responsibility. ;-)
@bebop6544
@bebop6544 2 жыл бұрын
I love the content, but the coughing is seriously driving me crazy.
@brianedwards30
@brianedwards30 4 жыл бұрын
Volume is a problem
@Asdayasman
@Asdayasman 3 жыл бұрын
Yeah and its relation to surface area is baffling.
@TomasSandven
@TomasSandven 3 жыл бұрын
Is this guy seriously going to be coughing constantly the entire talk!? It’s driving me insane!
@AlligatorTower
@AlligatorTower 2 жыл бұрын
I'm going to have to stop watching if this keeps up. it's too much
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
OMG, just how much bullshit is he talking here? A member function of a class can't be used on its own??? He must be the only person on Earth who thinks that. That's like saying "a function of a library can't be used without using absolutely everything else in that library". Does he even know how his linker works? I think not. ;-)
@soonshin-sam-kwon
@soonshin-sam-kwon 9 ай бұрын
Be humble even in the web space. Everybody knows a member function of a class thing. But that's not general high level approach of OO world. Possibility is different from Generality anyway. I think it's better to learn the skill to extract good and something useful from giants not to boast contextless snippets of exceptions.
@lepidoptera9337
@lepidoptera9337 9 ай бұрын
@@soonshin-sam-kwon I don't see giants here, only dwarves and trolls. :-)
@gzoechi
@gzoechi 4 жыл бұрын
Beautiful explanation!
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 11 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 25 МЛН
Они так быстро убрались!
01:00
Аришнев
Рет қаралды 2,3 МЛН
Okay but WTF is a MONAD?????? #SoME2
18:18
TheSTEMGamer
Рет қаралды 65 М.
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
ChimiChanga
Рет қаралды 65 М.
Functional architecture - The pits of success - Mark Seemann
1:00:10
NDC Conferences
Рет қаралды 141 М.
Robert C  Martin -  Functional Programming; What? Why? When?
58:27
Scott Wlaschin - Coding Like Frankenstein
57:02
tretton37
Рет қаралды 2,1 М.
Functional programming design patterns by Scott Wlaschin
1:05:44
Ivan Plyusnin
Рет қаралды 191 М.
Scott Wlaschin - Talk Session: Domain Modeling Made Functional
48:03
Functional Design Patterns - Scott Wlaschin
1:05:50
NDC Conferences
Рет қаралды 294 М.
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 13 МЛН
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 7 МЛН
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 3,4 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 65 МЛН
Tag him😳💕 #miniphone #iphone #samsung #smartphone #fy
0:11
Pockify™
Рет қаралды 4,7 МЛН