Feb 19, 2023
Awesome and really well-written article!
I'd like to just point out that throwing exceptions make a function impure, so maybe returning an Either or Maybe type could be more appropriate (or a simple error object representing your domain errors).
As an advantage, you can trust your function's signatures, because they will always show all the possible outputs (also known as total functions in the FP jargon).