|Playlist||schedule page slides as PDF|
Subtyping 1 — records (4:21)
Subtyping 2 — subtypes (6:01)
Motivation for and implementation of a subtype relation on record types. See subtype (but that implementation has everything through video 6).
Subtyping 3 — record fields (2:18)
Extending the subtype relation to let field types be subtypes. (This turns out to be unsound for mutable records.)
Extending the subtype relation to allow function types that return subtypes.
Extending the subtype relation to allow function types that consume supertypes, which is an example of contravariance. See subtype for all of the pieces put together.
Subtyping 6 — terminology (1:04)
Explains the terms covariant and contravariant.
Our subtyping turns out to be unsound withmutable records, where field types must be invariant. See subtype-mut.