mutable

Is this a sensible monad for mutable state in Clojure?

I've been experimenting with monads in Clojure and came up with the following code, where a monadic value/state pair is represented by a mutable Clojure deftype object. Since the object is mutable, an advantage would seem to be that you can write monadic code without needing to construct new result objects all the time. However, I'm pr...

What is the syntax for adding an element to a scala.collection.mutable.Map ?

What is the syntax for adding an element to a scala.collection.mutable.Map ? Here are some failed attempts: val map = scala.collection.mutable.Map map("mykey") = "myval" map += "mykey" -> "myval" map.put("mykey","myval") ...