Every category theory guru you’ve read explains the Writer monad using logging as an example. But logging is a bad example because—despite the name—the definition of the Writer monad allows reads—and worse, modifications—of the whole log. This can’t be right for two reasons. It’s too costly. And logs are typically only written to, never read from and definitely not modified.
So what is the category-theoretic correct way to do logging?
This talk delivers three benefits. It gives you the answer. You’ll see a free monad in action. And you’ll understand the theory better than before.
voted / votable