To create an instance of A Is B
you must show that for every choice
of F[_]
you can convert F[A]
to F[B]
.
To create an instance of A Is B
you must show that for every choice
of F[_]
you can convert F[A]
to F[B]
. Loosely, this reads as
saying that B
must have the same effect as A
in all contexts
therefore allowing type substitution.
Is
is transitive and therefore values of Is
can be composed in a
chain much like functions.
Is
is transitive and therefore values of Is
can be composed in a
chain much like functions. See also compose
.
Substitution on identity brings about a direct coercion function of the
same form that =:=
provides.
Substitution on identity brings about a direct coercion function of the
same form that =:=
provides.
Is
is transitive and therefore values of Is
can be composed in a
chain much like functions.
Is
is transitive and therefore values of Is
can be composed in a
chain much like functions. See also andThen
.
Is
is symmetric and therefore can be flipped around.
Is
is symmetric and therefore can be flipped around. Flipping is its
own inverse, so x.flip.flip == x
.
Sometimes for more complex substitutions it helps the typechecker to
wrap one layer of F[_]
context around the types you're equating
before substitution.
Sometimes for more complex substitutions it helps the typechecker to
wrap one layer of F[_]
context around the types you're equating
before substitution.
A value A Is B
is always sufficient to produce a similar Predef.=:=
value.
A value A Is B
is always sufficient to produce a similar Predef.=:=
value.
A value of
A Is B
is proof that the typesA
andB
are the same. More powerfully, it asserts that they have the same meaning in all type contexts. This can be a more powerful assertion thanA =:= B
and is more easily used in manipulation of types while avoiding (potentially erroneous) coercions.A Is B
is also known as Leibniz equality.