Reinventing the Reader Monad

Alternative solution to the problem in Scott Wlaschin's "Reinventing the Reader Monad" article (but without monads).