Sets, types and type checking
kaleidawave.github.io
Sets, types and type checking
1–10 of 36 posts
Re: Sets, types and type checking
#2I think they might have meant "entities" instead of "entries?"
The term "diagonal identity" seems to be non-standard as well?
Re: Sets, types and type checking
#3> Like sets, types can be by description have an infinite number of distinct entries I think they might have meant "entities" instead of "entries?" The term "diagonal identity" seems to be non-standard as well?
Re: Sets, types and type checking
#4Re: Sets, types and type checking
#5`any`, however, is not `top`, it is `break_the_type_system`. The top type in TS is `unknown`.
Re: Sets, types and type checking
#6`never` is better known as `bottom`. `noreturn` in some languages is the same thing `any`, however, is not `top`, it is `break_the_type_system`. The top type in TS is `unknown`.
Re: Sets, types and type checking
#7I don’t think it is appropriate to say Rust has ‘union types’. Rust has sum types, implemented as Enums and (unsafe) Union types. There is a distinct difference between sum types and union types from a type theoretic perspective.
Scala3 is the only programming language to implement both AFAIK.
C# has a proposal to add both unions and disjoint unions: https://github.com/dotnet/csharplang/blob/main/proposals/Typ...
OCaml has polymorphic variants which are open disjoint unions.
Kotlin is looking to add union types for errors: https://youtrack.jetbrains.com/issue/KT-68296/Union-Types-fo...
I believe Java's checked exceptions behave somewhat like union types.
Re: Sets, types and type checking
#8I don’t think it is appropriate to say Rust has ‘union types’. Rust has sum types, implemented as Enums and (unsafe) Union types. There is a distinct difference between sum types and union types from a type theoretic perspective.
disjoint union vs union. Scala3 is the only programming language to implement both AFAIK. C# has a proposal to add both unions and disjoint unions: https://github.com/dotnet/csharplang/blob/main/proposals/Typ... OCaml has polymorphic variants which are open disjoint unions. Kotlin is looking to add union types for errors: https://youtrack.jetbrains.com/issue/KT-68296/Union-Types-fo... I believe Java's checked excepti…
Re: Sets, types and type checking
#9I don’t think it is appropriate to say Rust has ‘union types’. Rust has sum types, implemented as Enums and (unsafe) Union types. There is a distinct difference between sum types and union types from a type theoretic perspective.
disjoint union vs union. Scala3 is the only programming language to implement both AFAIK. C# has a proposal to add both unions and disjoint unions: https://github.com/dotnet/csharplang/blob/main/proposals/Typ... OCaml has polymorphic variants which are open disjoint unions. Kotlin is looking to add union types for errors: https://youtrack.jetbrains.com/issue/KT-68296/Union-Types-fo... I believe Java's checked excepti…
Re: Sets, types and type checking
#10`never` is better known as `bottom`. `noreturn` in some languages is the same thing `any`, however, is not `top`, it is `break_the_type_system`. The top type in TS is `unknown`.
You don’t even know how to query it to find anything out about it.
But you could pass it to someone else.
When someone asks you for a completely unconstrained object, the type is “any”.
It’s technically the same type from two perspectives.
(Not saying this extreme version of the concepts are how they are implemented. Never had a chance to use such types before.)