Monoid Typeclass – Gints Dreimanis

preview_player
Показать описание
In this video, we cover the Monoid typeclass in Haskell. Learn what it is, how to use it, and how to define instances of Monoid for your own data types.

Get FP merch that doesn't suck. 👇

Read our blog post covering this topic:

Follow on social media:

Learn more about us:

Contact us:

0:00 Intro
0:22 Monoid-like things in Haskell
0:53 What is a monoid in algebra?
1:28 Examples of monoids
2:12 Monoid in Haskell
3:30 Defining your own monoid instance
4:29 Conclusion
Рекомендации по теме
Комментарии
Автор

Maybe its time to get into FP lol, great video. 👍

ThislsYusuf
Автор

Very interesting but I don't see the point of invoking the Monoid class in any of these examples. You could just as well have defined your Move type and the <> function by themselves and you wouldn't need to mess about with two different instance declarations which don't even show their types. You could even give empty a relevant name like "NoMove" or "Stay" or even "Unit". Seems easier and clearer.

marcthatcher