Fork me on GitHub

Best I've come up with so far:


Never mind. The above doesn't even work right. Below does exactly what the algo.monads example does, was getting hung up because I was specifying the initial value as a number and not an instance of state.


Very cool. If I had a nit to pick, it would be that if I want to specify the initial value for the reduce, I have to wrap it in m/return, specifying the context. m/return makes sense, but avoiding the context would be nice-to-have.


But I guess when the time comes to run the computation, you just wrap in with-context.