3 ms·
How about using an algebraic effect system? That's sort of a general purpose alternative to monads that also doesn't require an extra code path, and adds a bit
by cousin_it 11y ago
How about using an algebraic effect system? That's sort of a general purpose alternative to monads that also doesn't require an extra code path, and adds a bit of theoretical niceness. For example, if your code can throw two different exceptions, composing two monads is order-sensitive (because the monad interface is in some sense too general and forgets too much), while algebraic effects always commute with each other.
- gorena 11y agoTrue. I could rephrase as "the possibility of errors is just another type, and is best treated as such"?
- deleted 11y ago[deleted]