An Introduction to Functors in JavaScript: The Basics in 9 Minutes with Examples

Поделиться
HTML-код
  • Опубликовано: 20 янв 2025

Комментарии • 66

  • @greenhorn7189
    @greenhorn7189 10 месяцев назад

    Great explains for begineers. Keep doing with live Example. Thank you a lot

  • @Kirshach
    @Kirshach 3 года назад +33

    Why on earth does this video have so little views, that was a great explanation!

    • @FernandoBasso
      @FernandoBasso 9 месяцев назад

      If I find the devs who didn't watch or +1 this video, they'll have hell to pay. Leave it to me.

  • @m-is8mm
    @m-is8mm 5 месяцев назад

    Easily the best video I've found on the topic. Significantly better than the others.

  • @licriss
    @licriss 4 года назад +6

    So good to finally find an accurate explanation with concrete yet simple examples, thanks!!

  • @hansschenker
    @hansschenker Год назад

    Congratulations for the clear and easy going explanation! So far the best functor explanation on YT.

  • @Faruk-zt5iw
    @Faruk-zt5iw Год назад +1

    This is the by far the best video on functors.

  • @QRSTUVWXYZ123ify
    @QRSTUVWXYZ123ify 4 года назад +3

    Okay this is fun. I had a look at Wikipedia article *functor* and was afraid to then watch this video.
    But having enjoyed and benefitted from other videos you've shared, I worked through this. Pretty sure that I can get this by watching a few more times and writing code following along, grokking all the steps by repeating till the ah~ha arrives. You've done a great job making this approachable. Thank you!

    • @IjemmaOnwuzulike
      @IjemmaOnwuzulike  4 года назад +1

      ayye love to hear it, let me know if there's a point in the video you want me to diver deeper into✨

  • @bullettime2808
    @bullettime2808 Год назад

    I'm glad I found your channel it's a goldmine

  • @balanced-living
    @balanced-living Год назад

    Amazing video ❤, like your style of explanation

  • @ayushcodes
    @ayushcodes Год назад

    this is a very great explanation, thank you!!!

  • @NillKitty
    @NillKitty 3 года назад +15

    This video has extreme value in that it demonstrates scary FP concepts without using FP syntax. It's extremely easy to see what a "functor" is when you can see it in a language most people already understand. Great job and super high production quality skills; wish my tech videos looked this good. What do you use your graphics and how long does it take to put a video like this together?

    • @IjemmaOnwuzulike
      @IjemmaOnwuzulike  Год назад

      Thank you! I'm glad the video was helpful, it takes me a week to write the script, record, and edit the video - i used after effects for the animation and final cut for the editing

  • @akirakosaintjust
    @akirakosaintjust Год назад

    This video is invaluable. Thank you for taking your time to explain FP concepts derived from category theory in a demistified, practical and clear way.

  • @SuperChukwudalu
    @SuperChukwudalu Год назад

    Best Functor video. Really simple.

  • @antoniozeajr.4702
    @antoniozeajr.4702 2 года назад

    Best explanation after two days searching

  • @klebergermano3356
    @klebergermano3356 2 года назад

    The best video that I found about Functors with a great and concise explanation, thank you

  • @superchillh3o
    @superchillh3o 4 года назад +3

    Very similar to Brian Lonsdorf content, thank you so much for creating this, clear, concise, and practical!

  • @andypsolomon
    @andypsolomon Год назад

    This was great. The best explanation of Functors I've ever heard.

  • @damickillah
    @damickillah Год назад

    You simply and absolutely should have more subscribers, due to this video alone. However, I skimmed through some of your other videos and your videos are immaculately produced and presented. I love to see it! Props & respect!🥰 SUBSCRIBED!!!!!

  • @scfoxcode
    @scfoxcode 3 года назад +1

    Really nice explanation. I've played around with Haskell and Elm, but never really got the whole Functor, Applicative, Monad business. Having another crack at it and this video is great

  • @femiabolaji1809
    @femiabolaji1809 Год назад

    Coming back to this video to say it is amazing.

  • @elatedbento
    @elatedbento Год назад +2

    Excellent, precious video. Would you be so kind to do one about Monads? Please do one on monads. We desperately need one! Thanks 😃

  • @janduna4100
    @janduna4100 2 года назад +1

    Amazing content, so clearly conveyed with irrelevance omitted. Love it!

  • @benjaminstorrier
    @benjaminstorrier Год назад

    I actually understand now. Brilliant :) ❤

  • @SuperQuwertz
    @SuperQuwertz 2 года назад

    Yo I want a series on fp-ts from you
    The video was great and easy to understand

  • @EduardoLarios95
    @EduardoLarios95 2 года назад

    This video was amazing, you totally made the topic more understandable for someone with C#/TS experience wanting to jump to some more functional concepts. Subscribed :)

  • @eddyrc645
    @eddyrc645 4 года назад +2

    Thanks so much for this, it was super helpful

  • @BrunooS15
    @BrunooS15 2 года назад

    Thanks so much for this video!

  • @zemaumm
    @zemaumm Год назад

    This video is SO good

  • @andriilukianenko8106
    @andriilukianenko8106 3 года назад +1

    Hi, Ijemma! Thanks for the content, it's earned my Like.
    I'd like to add a bit to the 'nestedNumbers' vs 'chainedNumbers': indeed, reading chained map() calls is easier and we can plug in trace/tap() for debugging, and certainly looks better than e(g(f(x))).
    Luckily, FP gives us one more cool feature - compose().
    h = compose(e, g, f) . -> map(h)

  • @definty
    @definty 3 года назад

    Your channles so usefull and to the point. I love it! Thx for the content. BTW your missing a closeing parenthesis on the example at 3.28

  • @williamb.2031
    @williamb.2031 2 года назад

    Fantastic video! :) thanks!

  • @Talaria.School
    @Talaria.School Год назад

    Nice topics. Thanks mam

  • @rasmusl2067
    @rasmusl2067 Год назад

    Great content!

  • @lateAutumn314
    @lateAutumn314 Год назад

    Damn, super interesting tutorial!

  • @rashidakhan77
    @rashidakhan77 3 года назад

    Very nice lesson!

  • @elatedbento
    @elatedbento Год назад

    Quick question: if I map to a different type, such as going from an array of strings to an array of ints, is it still a functor? If I do ["John", "Mary", "Kate"].map(name => name.length), thus changing the inner type, is it still a functor or a different kind of functor?

    • @madlep
      @madlep Год назад +1

      Yes. Still a functor. Functors are “structure preserving”, so an array functor has to map to another array functor. And it’s totally fine and used often to change the inner type. What it CAN’T do is return a different type of functor - like a promise, or an option, or a result etc (well, there’s nothing stopping it doing that, but it wouldn’t be a correct functor implementation, and it would be considered a bug)

    • @elatedbento
      @elatedbento Год назад

      ​@@madlepthank you so much for taking the time to explain. I really appreciate it! ❤

  • @hugodsa89
    @hugodsa89 3 года назад

    Awesome content really love it ! ❤️

  • @rorycawley
    @rorycawley 3 года назад

    Nice content!

  • @quickfingers5982
    @quickfingers5982 4 года назад

    what is functor identity and what are the use cases?

    • @IjemmaOnwuzulike
      @IjemmaOnwuzulike  4 года назад

      Functor identity is one of the laws that an object must follow in order to be considered a functor.
      So a quick way to tell if an object is a functor is to see if it doesn't change in shape or value after its mapping interface has been called on it. A mapping interface would be the strap "map" function or the promise "then" function

    • @quickfingers5982
      @quickfingers5982 4 года назад

      @@IjemmaOnwuzulike thank you very much! are we saying that we only implement identity so it's satisfied a functor? in a real world we don't use it?

    • @IjemmaOnwuzulike
      @IjemmaOnwuzulike  4 года назад +1

      It's more like a characteristic of an object that needs to be present in order to be considered a functor.
      It's like how for a car to be considered a car it needs four wheels, a steering wheel, an engine, etc. There are properties (or satisfied laws) that an object must have to be a functor.
      This topic me a while to get used to let me know if you have more questions!

    • @quickfingers5982
      @quickfingers5982 4 года назад

      @@IjemmaOnwuzulike this is all good. Thank you! appreciate it.

  • @SuperQuwertz
    @SuperQuwertz 2 года назад

    Also the other concepts of fp please, like Monads etc.
    Especially in the context of Typescript

  • @justinhj1
    @justinhj1 Год назад

    I really enjoyed this video for the content but also the production style. What tool do you use for the animated on-screen content if you don't mind me asking?

  • @ehza
    @ehza 2 года назад

    this is so cool

  • @whatthefunction9140
    @whatthefunction9140 Год назад

    Functors are funky

  • @processorbot8761
    @processorbot8761 4 года назад +2

    damn great video

  • @paularah8877
    @paularah8877 4 года назад

    love it!

  • @jongeduard
    @jongeduard Год назад +2

    This is really funny. This explanation of a Functor is really somewhat different from what I have seen from a C++ tutorial. To me it looks like a specific version of it, not the whole story.
    In that tutorial a functor was explained as an object that behaves like a function. It did this by directly implementing the function call operator, so that it could literally be called as if it where a real function. And ok, I know JS does not have operator overloading, so then it that map method and that then method are ways to replace that. But this is all not the issue.
    In that C++ explanation they where NOT talking about that whole identity rule, just about composition. They did not require that the created function should return a new data structure or a new functor, but the generated function was just returning a single value like an integer for example. Was that a wrong explanation?
    I would say, that identity thing is more important for Monads, which are basically very related, but which indeed require both a wrapped type as imput as well as that they return the that wrapped type (arrays or lists are a good example, but the Option and Result types in the Rust language are also great examples of monads).
    I am really interested in anyones reply on this, learn me more.

  • @kaungsithu7377
    @kaungsithu7377 2 года назад

    more videos about applicative functor

  • @CarmelleCodes
    @CarmelleCodes 4 года назад

    these animations!! yes!!!!

  • @anhi399
    @anhi399 Год назад

    I too wanna say howdy to Don, Ramy, and Chadwick--Ijemma knows what's up

  • @Lambdaphile
    @Lambdaphile Год назад +1

    wtf, insta sub!

  • @parkerbordeaux7388
    @parkerbordeaux7388 Год назад

    Calling this a functor is the silliest thing I’ve ever heard in my life

  • @jewulo
    @jewulo 3 года назад +2

    Why are you calling a container data structure a functor. This just seems like a ruse for FP people to sound like they are smarter than everyone else. IMHO.

    • @IjemmaOnwuzulike
      @IjemmaOnwuzulike  3 года назад +4

      tbh people who use the term casually in everyday technical discussions might be showing off, but there's value knowing vocabulary associated with common data structures