J
Thanks for writing this! I agree, especially the first part about not (ab)using exceptions to model expected outcomes of a function/process. Regarding the Either<Left,Right> approach. I'm not convinced. I can't find a compelling reason to prefer this over discriminated union types. Perhaps you can think of an advantage? Thanks again!
CommentArticleNov 5, 2021Stop catching errors in TypeScript; Use the Either type to make your code predictable