5 ms·
You're making this harder than it actually is by conflating a bunch of things, comparing apples and oranges. Sets defined by type vs sets defined by lists of pr
by eevilspock 4y ago
You're making this harder than it actually is by conflating a bunch of things, comparing apples and oranges. Sets defined by type vs sets defined by lists of properties, specs, rules etc.
For types, just draw the Venn diagrams:
- The set of objects of Type A is entirely within the set of objects of Subtype of A. Subtype of A is the superset.
- the set of things that are Dogs (class or real world) is entirely within the set of things that are Animals.
- the set of things that are Javascript programs is entirely within the set of things that are Typescript programs.
- hbrn 4y ago> Sets defined by type vs sets defined by lists of properties, specs, rules etc. Recursive explanations are useless: "types are just sets defined by types". That's why we are trying to define them through other means. Also TS has structural type system, which is literally about comparing properties.
- strbean 4y ago(butting in) What is recursive about the parent comment?
- hbrn 4y agoIt's recursive in the context of "making sense of TS using set theory". If you understand sets, but not types, statements about "sets defined by types" are meaningless.
- Tainnor 4y agoThat's not what GP wrote - they wrote that there is a difference between "the set of all instances of type A" and "the set of all properties satisfied by all instances of type A". There's nothing recursive about that. And this is all completely independent of the question of whether a language is structurally or nominally typed.