Tag: #monoids

What are Monoids and Semigroups: explained with Type Classes[Scala].
How-To, Scala

What are Monoids and Semigroups: explained with Type Classes[Scala].

Learn how to attain ad-hoc polymorphism with Type classes in a functional way.Scala is one of the best programming languages❤.you can choose to treat everything as function in Scala with referential transparency, modularity, maintainability and tons of syntactic sugars.Functional approach is the best, to overcome shared and mutable state and to focus on results.Type Classes do not have native support in Scala, so you can use built-in features like traits and implicit classes to achieve ad-hoc polymorphism.What is ad-hoc polymorhism?function with same name acts differently for different declared types.lets understand the concept first and transition towards the how-to,i believe that, if you are aware of the problem, then you can imp...