Created
April 17, 2014 01:13
-
-
Save m0smith/10946475 to your computer and use it in GitHub Desktop.
Dependency Injection in Clojure 5.1 - Reader Monad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn foo [] | |
(domonad reader-m [db (asks :db)] | |
(update! db "foo"))) | |
(defn app [] | |
(domonad reader-m [_ (foo)])) | |
((app) (init-context)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment