3 ms·
I've long loved Option/Maybe types for this reason, but I've recently started to really lean into Result/Either types. When you can return the answer or an erro
by joshmarlow 8y ago
I've long loved Option/Maybe types for this reason, but I've recently started to really lean into Result/Either types. When you can return the answer or an error, you can chain the errors together as the error goes up your stack and you have a nice trail leading from the calling code to the violated expectation - sometimes several libraries/abstraction boundaries away!