Semigroups and monoids
We start this chapter with two fairly elementary abstractions: semigroups and monoids. These are both standard concepts in the field of mathematics called algebra, and we are all familiar with examples of semigroups and monoids from primary school arithmetic (though not necessarily with the general concept). What is perhaps less well-known is that semigroups and monoids are also omnipresent in (functional) programming.