Nice review! One thing to note is that piping into a case has been described as a bad pattern. The suggested solution is to extract the cases into a function (with multiple heads).
Benefits:
- Function name can be explanatory about what’s happening
- Easier to test the ‘cases’






















