Thank you for all the links
I have quite a bit to read on. Especially witchcarft, (even if it does seem a tad too complex to me. My team and I are no Haskell FP wizards, at least not yet).
We were quite used to the Javascript promise syntax, so the Chain API is inspired by the standard JS Promise. And is not a macro, more like the Ecto Multi Struct, that manages a transaction. So you have more freedom with were and what you do with you Chain Struct.
I will check on to see if those libs have the features we use :
ok/error chaining (obviously)
intermediate error catching (error tuples, but also thrown error)
we are able to manage the same workflows as we do now.
We have sort of complicated use cases, and Chain helps managing the complexity. (Like this one)
Yes, I suppose it is an anti-pattern.
Our need was to be able to verify that a cron job had run. As Ecto can throw in some circumstances (as far as I understand at least) having that possibility was really helpful to ensure we log any error that can happen in our job and transfer that log to sentry.
Chain gives you the stack trace with the thrown error, so in our case the error is re-thrown with the initial stack trace after we log it.
Result seems a great library, it seems simple enough and might cover much of our usecase. I will check it out, thank you.