by bcoates · 13y ago · 0 comments
An immutable List of Foos is a List of Bars if a Foo is a Bar. A function taking X and returning Y is a function taking A and returning B if A is a X and Y is a B.
It's just answering the question "Can I use type relationships to guarantee that I will have no run-time conversion failures?"
+ (covariant): the type can be cast to some broader (more general) type
- (contravariant): the type can be cast to some narrower (more concrete) type