> The words catamorphism, semigroup and monoid barely make sense to most programmers.
Over the last few years I have absorbed a lot of these terms via professional Haskell development and have come to the conclusion that it is quite unfortunate that most of us tend to shy away from this unfamiliar vocabulary. It turns out these are very precise (mathematical) terms which describe common things we see every day in programming.
Addition, multiplication, and string concatenation are all monoids (described as: an associative binary operation with an id element). This might not seem useful to know on the surface, however, once you discover that you can write generic functions over any monoid you can start eliminating large classes of errors that tend to turn up in software development due to the DRY principle.
> An extreme attempt to simplify?
It turns out that the more generic you make something, the harder it is to do the wrong operations on it.
id :: a -> a
If 'a' is a generic type value for all possible types, is it possible to return anything other than the initial value passed in?
Its about learning-fatigue due to needing to function in real life, especially since the learning curve is steep.
A family man might read a book about FP patterns to solve common issues, agile, QS+testing, concurrency, etc (actually seen tgese read by 50yo collegues) - but not a single one has a category theory book on their table.
Its a question of time invested vs benefits to current occupation.
FP terminology is the domain of the young and the driven, who also are of academic age. (Probably winy find any junior-high kids dabbling with semigroups anytime soon)
Over the last few years I have absorbed a lot of these terms via professional Haskell development and have come to the conclusion that it is quite unfortunate that most of us tend to shy away from this unfamiliar vocabulary. It turns out these are very precise (mathematical) terms which describe common things we see every day in programming.
Addition, multiplication, and string concatenation are all monoids (described as: an associative binary operation with an id element). This might not seem useful to know on the surface, however, once you discover that you can write generic functions over any monoid you can start eliminating large classes of errors that tend to turn up in software development due to the DRY principle.
> An extreme attempt to simplify?
It turns out that the more generic you make something, the harder it is to do the wrong operations on it.
If 'a' is a generic type value for all possible types, is it possible to return anything other than the initial value passed in?