how to form an endomonoid

An endofunction is a function where the parameter and return type are the same for instance int to int. It isn’t a very difficult concept but it is fun to play around with and see how functions compose. Below is a little example that builds on the last category theory post.

Note there’s a bit of a design choice here that should reflect the semantic meaning of your program regarding the use of andThen or compose, but other than that endomonoid┬ásounds like a way more difficult term than it turns out to be.