This is a story about an idea, an abstraction if you will. As software developers we deal in abstractions constantly, but I want to talk to you about one particular idea, the idea of +. Addition is pretty fundamental as a concept, so let's run through the basics. You'll be familiar with some common forms of addition like integer addition 1 + 2 = 3 and rational addition 1/2 + 2/3 = 7/6. But what does it mean to be able to add something? Could we add functions? What about optional values?
One answer to that question is provided by algebra a lot of algebra is spent defining sets of things and what operations can be performed on them. And what algebra will tell us is that the things we tend to think of as being addable are generally called Semigroups. A Semigroup is a set where all items in the set can be added together so that for every a, b, and c in the set (a + b) + c = a + (b + c). I