|Playlist||schedule page slides as PDF|
Subtyping 1 — records (5:58)
Subtyping 2 — subtypes (6:46)
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:50)
Extending the subtype relation to let field types be subtypes witin record subtype. (This turns out to be unsound for mutable records, but it’s fine for functional update.)
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:34)
Explains the terms covariant and contravariant.
Our subtyping turns out to be unsound with mutable records, where field types must be invariant. See subtype-mut.