Re:Push ifs up and fors down
by KineticLensman on Thursday November 16, 2023 @05:19AM
(#38287771)
Yes, pattern matching really helps with clarity, especially when there are multiple happy paths, like in a parser
To do this, you need to encode the distinction between happy and sad path in your types. That's good for all sorts of other reasons, so it's not really a drawback.