The Functional Programmer's Toolkit - Scott Wlaschin

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 พ.ย. 2024

ความคิดเห็น • 63

  • @MarkusBurrer
    @MarkusBurrer ปีที่แล้ว +9

    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. ;-)

  • @tullochgorum6323
    @tullochgorum6323 ปีที่แล้ว +5

    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. ;-)

  • @MrTruthAndFacts
    @MrTruthAndFacts 5 ปีที่แล้ว +43

    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

  • @qewolf
    @qewolf 5 ปีที่แล้ว +54

    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

  • @timz4183
    @timz4183 5 ปีที่แล้ว +55

    Scott Wlaschin is so awesome! He made me a better software developer.

  • @inversebrah
    @inversebrah 2 ปีที่แล้ว +3

    this lecture should have more views

  • @EldronGah
    @EldronGah ปีที่แล้ว +2

    One of the best video I have seen on FP, truly a gem

  • @jbrains
    @jbrains 4 ปีที่แล้ว +15

    I always enjoy a speaker who distinguishes "unfamiliar" from "complicated".

  • @raymondyoo5461
    @raymondyoo5461 ปีที่แล้ว

    Great talk 👍
    You’re handling well almost every topic of FP only in an hour
    Impressive 👏👏

  • @brettkoenig9897
    @brettkoenig9897 4 ปีที่แล้ว +6

    This is so awesome! I’ve been working on learning FP for a couple months now and this cleared a lot of things up.

  • @ycombine1053
    @ycombine1053 4 ปีที่แล้ว +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.

  • @wuzixiao1
    @wuzixiao1 2 ปีที่แล้ว +1

    The best talk about FP. It really turns my head around.

  • @dcuccia
    @dcuccia 4 ปีที่แล้ว +2

    A timeless talk!

  • @reflechant
    @reflechant 5 ปีที่แล้ว +10

    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 ปีที่แล้ว +3

      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.

  • @MarkusBurrer
    @MarkusBurrer 3 ปีที่แล้ว +3

    I rarely thumb up videos on TH-cam. But for this talk I have to.

  • @roysmith5711
    @roysmith5711 4 ปีที่แล้ว +3

    I would like to suggest everyone to learn LISP or even better Clojure. FP concepts are much easier to understand in LISP.

  • @DataPastor
    @DataPastor 24 วันที่ผ่านมา

    Very nice talk thank you!

  • @CrapE_DM
    @CrapE_DM 5 ปีที่แล้ว +8

    turn up the volume...

  • @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.

  • @gzoechi
    @gzoechi 4 ปีที่แล้ว +1

    Beautiful explanation!

  • @Archon-Zero
    @Archon-Zero 5 ปีที่แล้ว +1

    Wonderful! Thanks Scott.

  • @VitalyBrusentsev
    @VitalyBrusentsev 5 ปีที่แล้ว +4

    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 ปีที่แล้ว +24

      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 ปีที่แล้ว +4

      @@AntonBurger Thank you, this makes sense to me now.

  • @giarc1988
    @giarc1988 2 ปีที่แล้ว +1

    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

  • @Jopie65
    @Jopie65 4 ปีที่แล้ว +2

    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? 😁

  • @gregbell2117
    @gregbell2117 5 ปีที่แล้ว +3

    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 3 ปีที่แล้ว +2

      it's been a year but yes that is true! a map is what is called a "Higher-kinded type".

  • @omarkhan1491
    @omarkhan1491 5 ปีที่แล้ว +2

    1:02:52 final code

  • @hieuvhla12
    @hieuvhla12 5 ปีที่แล้ว +1

    Love your talk

  • @Bx99875
    @Bx99875 2 ปีที่แล้ว +2

    The best 1hour spent in FP

    • @cat-.-
      @cat-.- 2 ปีที่แล้ว

      Exactly my thoughts at the 50 minute mark

  • @ecosta
    @ecosta 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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 ปีที่แล้ว +4

    The coughing in public is so 2019!!!

  • @zaidamascorro5426
    @zaidamascorro5426 3 ปีที่แล้ว +7

    listening a talk with someone in the audience coughing a lot, in 2021.

    • @scotttang6229
      @scotttang6229 3 ปีที่แล้ว

      Right? not sure why that guy didnt just step out... LOL

    • @pepineros4681
      @pepineros4681 2 ปีที่แล้ว

      Still listening in 2022!

    • @myusernameisrighther
      @myusernameisrighther 2 ปีที่แล้ว +1

      @@pepineros4681 the video is just over an hour long… how long is it going to take you to finish it?

  • @bebop6544
    @bebop6544 2 ปีที่แล้ว +1

    I love the content, but the coughing is seriously driving me crazy.

  • @dougdigdag5680
    @dougdigdag5680 2 ปีที่แล้ว

    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 ปีที่แล้ว +2

      @@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 ปีที่แล้ว +2

      @@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. ;-)

  • @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. ;-)

  • @brianedwards30
    @brianedwards30 4 ปีที่แล้ว +1

    Volume is a problem

    • @Asdayasman
      @Asdayasman 3 ปีที่แล้ว +3

      Yeah and its relation to surface area is baffling.

  • @TomasSandven
    @TomasSandven 3 ปีที่แล้ว +5

    Is this guy seriously going to be coughing constantly the entire talk!? It’s driving me insane!

    • @AlligatorTower
      @AlligatorTower 2 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      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 ปีที่แล้ว

      @@soonshin-sam-kwon I don't see giants here, only dwarves and trolls. :-)

  • @gzoechi
    @gzoechi 4 ปีที่แล้ว +4

    Beautiful explanation!