Just starting to grok monads. I think in Clojure, so purity isn't terribly important to me.
I have a series of business operations (composable transforms) which may fail. This can be abstracted nicely with error-monad.
Some of the business operations involve database IO, and I need to perform the operations in bulk for speed. each bulk operation acts on a set of independent items, so one failure must not fail the whole set.
should I just think of my bulk transforms as a series of functions on one object (map) done inside something like error monad but acting on independent items in a seq? does seq-monad help me here? how should I be thinking about this? any other ideas?
I don't see any particular benefit in combining this with IO-monad for my database side effects in Clojure, thoughts on this?
It's hard to say what you need exactly, because your business case seems a little involved, but I think you may get some mileage from using the clojure.algo.monads library.
You can create your own variation on a error-monad or maybe-monad that internally deals with batches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With