Questions tagged [subtypes]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
13 votes
10 answers
4k views

Are there any practical use cases for subtyping primitive types?

In, for example, Python, it is possible to subtype primitive types: ...
Wheelwright's user avatar
9 votes
1 answer
271 views

What are some options for integrating subtyping with Damas-Hindley-Milner inference?

Type inference in a Damas-Hindley-Milner type system with subtyping is known to be undecidable in general. What makes it so difficult? What options are there to get around undecidability which could ...
Pseudonym's user avatar
  • 4,406
6 votes
1 answer
208 views

Are there disadvantages to having subtypes of algebraic data types?

Many languages support algebraic data types which are essentially tagged unions of tuples or structs. For example, suppose we have a type for an expression node in an AST: ...
kaya3's user avatar
  • 17.1k