<div dir="ltr"><div><div><div><div><div>Dear haskellers,<br><br></div>I have a multi-step computation. The steps are predefined, but users can choose which steps to execute (something like a recipe). Here is an example recipe:<br><br></div>Step 1 - Get data from network (multiple HTTP calls) and put into a list<br></div>Step 2 - Process the data (e.g. average, sum, median, etc.)<br></div><div>Step 3 - Persist result to database<br></div><br></div><div>Sometimes, Step 1 can fail for some of the HTTP calls. When this happens, Step 2 should continue as much as possible using whatever data that has been retrieved, but somehow indicate that an error has occurred and the result is partial.<br><br></div><div>Q1: What is the idiomatic way of achieving this? Using throwError in Control.Monad.Except aborts the computation, which isn't what I want.<br><br>Q2: (General software design) Furthermore, where should the error be logged? Logging it in both Step 1 and 2 preserves modularity for each of the steps, unfortunately it would result in duplicate error messages. What is the best practice for this?<br><br></div><div>Regards,<br></div><div>Hon<br></div></div>