I am writing my first monad instance so please forgive if I'm missing something obvious.
I want to do something like this:
readStuffFromDatabase >>= function1 >>= ... >>= functionN >>= writeStuffToDatabase
function1 ... functionN are business logic. Any business logic can return DoNothing which should obviously prevent any further computation.
Here are my questions:
Am I thinking about the problem in the right way? Can this approach lead to idiomatic code, good performance, etc. or is it already doomed?
How should I define a type intended to chain arbitrary amounts of computation together? What's fuzzy to me is do all monad instances already do that and all I need is a vanilla monad instance? (Like Maybe?) Or do I need something more sophisticated?