Skip to content

Commit

Permalink
a bit more on gradual unions
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Jun 1, 2024
1 parent 6bebab4 commit 2900cce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/spec/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,11 @@ supertype relation, the union ``T1 | T2`` is a supertype of both ``T1`` and
A gradual union type ``S1 | S2``, where ``S1`` and ``S2`` are gradual types,
represents all possible sets of values that could be formed by union of the
possible sets of values represented by materializations of ``S1`` and ``S2``,
respectively. Thus, via materialization, the gradual types ``S1`` and ``S2``
are both assignable to a gradual union type ``S1 | S2``.
respectively.

For any materialization of ``S1`` to ``T1`` and ``S2`` to ``T2``, ``S1 | S2``
can likewise be materialized to ``T1 | T2``. Thus, the gradual types ``S1`` and
``S2`` are both assignable to the gradual union type ``S1 | S2``.

If ``B`` is a subtype of ``A``, ``B | A`` is equivalent to ``A``.

Expand Down

0 comments on commit 2900cce

Please sign in to comment.