Question

I've never used clojure before and I'm trying to get the 'domonad' function/macro so I can play with it and learn from this tutorial on monads which is quite good. I heard it was in clojure-contrib, then moved to clojure.algo

I tried

user=> (ns your-namespace
  (:require clojure.contrib.monads))
FileNotFoundException Could not locate clojure/contrib/monads__init.class or clojure/contrib/monads.clj on classpath:   clojure.lang.RT.load (RT.java:443)
user=> (ns your-namespace
  (:require clojure.algo.monads))
FileNotFoundException Could not locate clojure/algo/monads__init.class or clojure/contrib/monads.clj on classpath:   clojure.lang.RT.load (RT.java:443)

Nothing works. I think I don't know how to use libraries.

How can I get this dependency?

Was it helpful?

Solution

The short answer is Use Leiningen for project management in clojure.

  • install leinengen
  • run "lein new project-name"
  • cd project-name and edit project.clj to add the dependency
    [org.clojure/algo.monads "0.1.5"]
  • run lein repl, or better yes use Emacs and the cider-mode package
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top