We can lift subtyping into any covariant type constructor
Widen a F[X,+A] to a F[X,B] if (A As B).
Widen a F[X,+A] to a F[X,B] if (A As B). This can be used to widen the output of a Function1, for example.
Subtyping is transitive
Use this relationship to narrow the input type of a Function1
We can lift a subtyping relationship into a contravariant type constructor.
We can lift a subtyping relationship into a contravariant type constructor.
Given that F has the shape: F[-_], we show that: (A As B) implies (F[B] As F[A])
It can be convenient to convert a <:< value into a <~<
value.
It can be convenient to convert a <:< value into a <~<
value.
This is not strictly valid as while it is almost certainly true that
A <:< B
implies A <~< B
it is not the case that you can create
evidence of A <~< B
except via a coercion. Use responsibly.
Use this relationship to widen the output type and narrow the input type of a Function1
widen two types for binary type constructors covariant in both parameters
widen two types for binary type constructors covariant in both parameters
lift2(a,b) = co1_2(a) compose co2_2(b)
Use this relationship to widen the output type of a Function1
Subtyping is reflexive
reify a subtype relationship as a Liskov relationship
reify a subtype relationship as a Liskov relationship
We can witness the relationship by using it to make a substitution *