Monads, Functors and Monoids are Functional Desgin Patterns?


#1

I have one question, when I was watching tutorials “Category Theory from the Universe Up”, where you teach monoids, functors and monads. These are amazing, but my question is, these are functional design pattern or Some api for performing operations. Like when i was looking theses for scala, some of the tutorials gives example like Functors are map, monads are like flatmap Or monoids are like foldleft or foldright.

So, I want to know, these are design patterns or not and if possible give me some example of Functional Design Patterns.


#2

Hi @harmeet,

I would say it depends on what me mean by Design Pattern. I looked up the wiki definition and i’m going to go based off that one. wiki.

I would say with my limited knowledge that Monads, Functors and Monoids are probably design patterns in that they are re-usable patterns. If we recall the videos Eric made on the subject, he have several examples how the idea of a functor was re-applied across several implementations.

Given that the examples were easily translated to code i’m willing to bet that they meet the second requirement of a design pattern.

I never know exactly what people thing “Functional” means, so i’ll leave that one alone.


#3

Thanks @Drew_Verlee This makes sense. This is really helpful to us.