2 ms·
>The invariant is enforceable No, what you are showing is how an API designer could enforce a particular API design decision. That's fine, but what I'm talking
by fauigerzigerk 10y ago
>The invariant is enforceable
No, what you are showing is how an API designer could enforce a particular API design decision. That's fine, but what I'm talking about is how a language designer could enforce the invariants of a particular error handling concept. I think that sum types alone are not sufficient to do that.
But I have to say I really don't like your tone. I'm not asking for one thing and then the exact opposite. I'm simply discussing pros and cons and I'm thinking about the consequences of different designs.
I'll make my mind up when I feel I know enough the subject to do so. If that offends you, then I suggest you talk to someone else.
- catnaroek 10y ago> No, what you are showing is how an API designer could enforce a particular API design decision. That's fine, but what I'm talking about is how a language designer could enforce the invariants of a particular error handling concept. I think that sum types alone are not sufficient to do that. Different APIs have different ways to handle errors. The language designer's job is to allow the programmer to express his intention in the most precise way possible.