Reader Monad for Dependency Injection: multiple dependencies, nested calls
When asked about Dependency Injection in Scala, quite a lot of answers point to the using the Reader Monad, either the one from Scalaz or just rolling your own. There are a number of very clear articles describing the basics of the approach (e.g. Runar's talk , Jason's blog ), but I didn't manage to find a more complete example, and I fail to see the advantages of that approach over e.g. a more traditional "manual" DI (see the guide I wrote ). Most probably I'm missing some important point, hence the question. Just as an example, let's imagine we have these classes: trait Datastore { def