3 ms·
That's because it's structurally typed (as opposed to nominally typed). I don't happen to prefer it, but I don't think it's fair to conflate that with unsoundne
by saghm 7mo ago
That's because it's structurally typed (as opposed to nominally typed). I don't happen to prefer it, but I don't think it's fair to conflate that with unsoundness like the example given above; it's totally possible to have a sound structural type system. TypeScript doesn't happen to be sound, but it's not because of that.
- teaearlgraycold 7mo agoStructural typing is great. It's the verified version of duck typing.
- LelouBil 7mo agoYou can even get nominal typing with branded types if you need it. (Like for the newtype pattern)