A datastore is a monad transformer

In the paper attached to my last post, I proved that any data store is a monad. Then I proved that if the data was a monoid (so it has a zero and addition) then the store is a monoid too. And then I asserted that if the data is a monad, then so is the store. And said I wasn’t going to prove it.

Well, it didn’t fit in that paper, but I thought it was worth writing down. So, without further ado, I have written a very short note that:

In that case you might want to look here: Distributed storage in Haskell. In this I introduce the basic storage monad and show that (a) if the data is a monoid then so is the store, (b) if the data is a monoid, it doesn’t matter whether you do monoidal addition on the data or the store.

If you’re interested in the database angle, something I would like to do is to convert the simple in-memory store described in that paper to a store backed by a database.