The reader monad is one solution to "dependency injection". This document shows how we might discover the reader monad when we attempt to solve this problem.
Our working definition of the dependency injection problem will be this: we have a method or function that takes certain parameters that we don't want to specify every time we call it. For example, we might have a function that gets a user given an ID and also requires a database connection.
def getUser(db: DbConnection, id: Id): User =