by mikkelewis · 13y ago · 0 comments
I should say one thing however:
I'm using Scala because of Akka. An extremely powerful library that does a good job of hiding the complexities while still allowing you to be flexible.
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