Functional Programming - 19: Magma, Semigroup, Monoid demo

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

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

  • @vanikoakofashvili1524
    @vanikoakofashvili1524 Год назад +6

    I love this series; please don't stop recording the videos. (waiting for functors

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

      Thank you. I’m really glad you loved the videos so far. We’re getting pretty close to Functors, and I have good plans for it :)

  • @jpbastyr
    @jpbastyr Год назад +3

    love these videos, makes it a lot easier to understand these concepts with a demo in code. thanks!

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

      I’m glad you’re enjoying them.

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

    This is awesome. A million thanks for carefully walking through through each concept.

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

      I’m glad you liked the videos so far

  • @senthilramalingam9500
    @senthilramalingam9500 Год назад +3

    Thank you so much brother for sharing such wonderful knowledge in an easy to understand way. Pls upload the rest of all the Categories...

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

      You’re welcome. You can see many Algebraic Structures outlined in here:
      en.wikipedia.org/wiki/Outline_of_algebraic_structures

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

    Your voice and way of teaching make it easy to follow along. Thank you, awesome content!

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

      I’m glad you think so! Thank you for following the videos.

  • @jessexing3456
    @jessexing3456 9 месяцев назад +2

    awesome video!

  • @LucasRodrigues-ju2pb
    @LucasRodrigues-ju2pb Год назад +1

    This channel is amazing! 👍

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

      That’s wonderful to hear :)

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

    Excellent!! ❤❤

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

    Great series, thanks so much!
    What do you think about the fp-ts library?

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

      Thank you Dawid, I’m glad you liked the series so far.
      I think Giulio work on fp-ts and his other projects has created a lot of awareness in the TypeScript community about Functional Programming. As you know TypeScript is pretty popular among Frontend engineers. All this awareness hopefully shows the language designers how much engineers want to have FP tools natively supported in TypeScript.

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

    Excellent explanation. I've been working on implementing Quasigroups and Loops starting from Magma, but i've been having troubles to find any easy example of them outside substraction and division for integers and real numbers. Do you have any example you could give me at least for a string quasigroup?
    Quasigroups are magmas but with the notion of inverse (non associative and without identity)
    Loops are associative quasigroups.

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

      Thanks for your comment and interest in quasigroup! Honestly, I'm not familiar with it at the moment, but I'm always up for a good challenge and learning something new. I'll definitely look into quasigroup and maybe even make a video about it in the future. If you happen to have any good resources about quasigroup that you'd like to share, please feel free to add it here. Appreciate you bringing it to my attention!

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

      @@webvv Well, there is the wikipedia article about algebraic structures and other dedicated to quasigroups and loops. Also, if you want to see details about the implementation in a programming language, haskell has two paths to construct a group: the main one, aka Magna → Semigroup → Monoid → Group, and the alternative one, aka Magma → Quasigroup → Loop → Group. The details in this alternative aren't the best, but for a rough implementation definition is alright.
      I know that you can construct a group even from another angle (Magma → Unital Magma→ Inverse Semigroup → Group), but for a personal project i would like to find at least some use case for quasigroups before.
      Appreciate the answer.

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

      That is pretty interesting. To what it’s worth I’m planning to talk about Group in the next video which is on the first path you mentioned. But I’ll look into Quasigroup to learn more about it. Thank you for mentioning this.

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

    ❤️❤️👍❤️❤️

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

    It would be nice to replace all the cons(cons(cons... with more elegant function which creates linked list

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

      You are correct it would be much cleaner! The reason I haven’t created a helper functions like “fromArray” is for teaching reasons.

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

    What is the difference between Magma and semigroup again?

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

      All Semigroups are Magma, but all Magmas are not Semigroup. Semigroup is Magma with an extra requirement that its combine (concat) operation is Associative. I’ve explained this in details in the previous video:
      ruclips.net/video/Vev5_wJDJig/видео.htmlsi=OFsyHx_ghI64LnZ2

    • @nathaaaaaa
      @nathaaaaaa 4 месяца назад +1

      ​@@webvvaka addition and multiplication are semigroups; subtractions, divisions and str concat are regular magmas.
      Am I right?
      Thanks for your videos, very helpful for learning functional programming

    • @webvv
      @webvv  4 месяца назад

      I’m glad you like them. All true except String concat. String concatenation is a Semigroup.
      Pro + (gram + ing) = (Pro + gram) + ing

    • @nathaaaaaa
      @nathaaaaaa 4 месяца назад

      @@webvv ohh I see, I was thinking on cases like
      pro + (gram + ming) != (ming + pro) + gram
      But I guess I didn't understand the association correctly at first