Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert clojure.contrib.monads to be used with clojurescript?

I would like to use the Clojure Monad library clojure.contrib.monads in ClojureScript. Is there an implementation that has been tested as known to work with ClojureScript as it does not appear in the standard ClojureScript distribution?

(I am assumming I may have to just copy and paste the code from a clj into a cljs. Although what about the macros, as these need to be in a clj file)

Update: (am I right in thinking that these are the two files I will need?)

Files

  • monads.clj
  • monadic_io_streams.clj

Ok, it looks like this doesn't exist. I'm going to have to go through the implementation in Clojure first to make sure that eval and similar stuff is not used, as Clojurescript does not support all the features of Clojure.

like image 647
yazz.com Avatar asked Jul 08 '12 08:07

yazz.com


1 Answers

You may want to take a look at Jim Duey's protocol-monads, for which cljs support has been recently added - see this commit for details.

like image 72
spariev Avatar answered Oct 31 '22 17:10

spariev