3 ms·
Nominal typing with correct variance describes OO (classes, inheritance and rules governing it <<liskov substitution principles, L from SOLID>>). Structural typ
by mirekrusin 2y ago
Nominal typing with correct variance describes OO (classes, inheritance and rules governing it <<liskov substitution principles, L from SOLID>>). Structural typing is used for everything else in js.
Flow does it correctly. Typescript treats everything as structurally typed.
As a side note flow also has first class support for opaque types so no need to resort to branding hacks.
- int_19h 2y agoYou can do classes, inheritance, and LSP with structural typing just fine; look at OCaml.