David Sankel: Monoids, Monads, and Applicative Functors: Repeated Software Patterns

preview_player
Показать описание
Forget factories, singletons, and proxies; What are the real patterns in software development? This talk explores abstract mathematical structures that commonly recur in software development. Once a mind is trained to recognize these patterns, it becomes easy to identify the fundamental operations for domain specific classes and how to put the pieces together. This discussion is for those who enjoy math, abstract concepts, and expanding their minds.

---

*--*

---
Рекомендации по теме
Комментарии
Автор

The discussion in the end was very interesting! Thanks for keeping it in the video!

ChristopherOkhravi
Автор

Great talk. Thank you! The point about Map-Reduce can also be thought of as Functor-to-Monoid was super interesting! :)

ChristopherOkhravi
Автор

functions of type a -> a form a monoid under function composition, thats correct... but your special element is not the function, that always gives you the empty element of type a, it's the identity function... because you can compose any function with the identity function in any way and you get effectively your "any function"

okdoomer
Автор

Did you ever form a conclusion on the sufficient constraints to form a functor on `std::set`?

TimTeatro
Автор

When you cross your eyes and see the functional representation, is that real, compilable c++? Or is it the dream? 1:00:37

JoeGorse
Автор

Great talk. A minor detail (which isn't consequential to the talk, so was probably best left out) is the idea that the set needs to be closed under the binary operation. That is, the operation can't produce a value that is outside of the set. Now, I haven't thought about this previously, but in the case of IEEE digital numeric types, I think you get closure automatically because of the Inf or NaN elements. So, if you were to approximate the `int` type as an interval on the integers, then INT_MAX + INT_MAX would produce a number outside of the int type. That means that finite ranges of integers don't form monoids. However, if INT_MAX + INT_MAX gives a special value, and the special value is in the set of `int`s, then you get closure under addition. Someone, correct me if I'm wrong.

_Edit:_ Also, if you go over INT_MAX and roll back and start counting from 0 again, then I think that operation (which diverges from traditional addition in those special cases) would form a monoid on a finite interval of integers. I think that's cool too.

TimTeatro
Автор

Lol. The imperative mortals are raging about FP

piq-dgvz
Автор

what scares me the most is that the guy asking questions in the last 15-20 minutes is working on swift language, but he is using this talk (and probably other similar talks) to decide if they want to bake some sorts of functional programming tools into the language or not. As really good material about fp is scarce, people talking about these topics MUST be much more knowledgable in the topic to present these concepts. Experts can deliver concepts in the form of digestible examples in real world applications and scenarios. With all respect to david sankel, the presentation was weak and he was unable to address any questions or even why he even learned these things in the first place! He skimmed through areas where he should focus, and focused on areas where he should be skimming through.

aBamieh