4 ms·
Okay, then I can pick another example: A dictionary where the type of the values depends on the key they're inserted under. (For example, a representation of th
by rntz 10y ago
Okay, then I can pick another example: A dictionary where the type of the values depends on the key they're inserted under. (For example, a representation of the closure of a function in a typed language.) Of course, then I can go to a dependently typed language, but are you really going to tell me that only dependently typed languages count as "good" static type systems?
- rbehrends 10y agoI am not arguing completeness here; a type system is not a full-blown specification language and does not have to be. (I actually tend towards the point of view that trying to make them complete specification languages has limited practical value, but that's a different issue.) The point here is that the type system does not restrict me from implementing a data structure that adheres to this constraint, even if it does not enforce it for me.
- deleted 10y ago[deleted]
- dllthomas 10y agoYou can do this in GHC Haskell with existential quantification, or trade static checks for runtime with Data.Dynamic. (Again, not arguing against your thesis here.)