Skip to main content

Questions tagged [subtypes]

The tag has no usage guidance.

14 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
15 votes
1 answer
513 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
  • 5,206
6 votes
1 answer
261 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
  • 20k