I'm looking for some insight into the relationship between Monads and Middleware.
It seems to me that middleware (ala Ring, Boot) is really just a subset of Monads, where bind and lift are globally agreed upon conventions, rather than explicitly defined. For example, with middleware you need every function to accept and return the same signature so as to be composable, whereas with monads you explicitly provide the code for binding and lifting into and out of the monad world.
My basic questions are:
1.) Is middleware really a monad with a different name?
2.) Is there any compelling reason to use monads in clojure instead of middleware?
3.) Are there classes of problems that can be solved with monads that can't be solved with middleware?
4.) Is there any benefit (beyond curiosity) to porting/re-implementing middleware as monads?
Thanks.
Scott Klarenbach