@@ -105,10 +105,10 @@ static_assert(not is_subtype_of(B2, B1))
105
105
This section covers structural properties of intersection types and documents some decisions on how
106
106
to represent mixtures of intersections and unions.
107
107
108
- ### Single-element unions
108
+ ### Single-element intersections
109
109
110
- If we have a union of a single element, we can simplify to that element. Similarly, we show an
111
- intersection with a single negative contribution as just the negation of that element.
110
+ If we have an intersection with a single element, we can simplify to that element. Similarly, we
111
+ show an intersection with a single negative contribution as just the negation of that element.
112
112
113
113
``` py
114
114
from knot_extensions import Intersection, Not
@@ -422,8 +422,8 @@ def example_type_bool_type_str(
422
422
423
423
#### Positive and negative contributions
424
424
425
- If we intersect a type ` X ` with the negation of a disjoint type ` Y ` , we can remove the negative
426
- contribution ` ~Y ` , as it necessarily overlaps with the positive contribution ` X ` :
425
+ If we intersect a type ` X ` with the negation ` ~Y ` of a disjoint type ` Y ` , we can remove the negative
426
+ contribution ` ~Y ` , as ` ~Y ` must fully contain the positive contribution ` X ` as a subtype :
427
427
428
428
``` py
429
429
from knot_extensions import Intersection, Not
@@ -515,8 +515,7 @@ def _(
515
515
516
516
#### Negative type and negative subtype
517
517
518
- For negative contributions, this property is reversed. Here we can get remove superfluous
519
- _ subtypes_ :
518
+ For negative contributions, this property is reversed. Here we can remove superfluous _ subtypes_ :
520
519
521
520
``` py
522
521
from knot_extensions import Intersection, Not
0 commit comments