Update spec.md

This commit is contained in:
2025-09-18 13:05:02 +02:00
parent 1eb40036ee
commit f4b6589b1a

25
spec.md
View File

@@ -91,6 +91,21 @@ type Uint8 = {...?Uint8}
</details> </details>
## Extensible unions
The difference between these and partial unions is that many compilation units can extend one extensible union.
This means that no compilation unit can do exhaustive pattern matching
```
extensible union Plan
extend Plan with 'ReadlnPlan Unit
extend Plan with 'WritelnPlan Unit
# pattern matching against these is always non-exhaustive.
# can only pattern match against the imported extensions
```
## Compatible-with ## Compatible-with
Check if type is compatible-with / assignable-to type requirements. Check if type is compatible-with / assignable-to type requirements.
@@ -523,16 +538,6 @@ def example(li: List[Char]) -> {t:Token,rem:List[Char]} {
## Extensible unions
```
extensible union Plan
extend Plan with 'ReadlnPlan Unit
extend Plan with 'WritelnPlan Unit
# pattern matching against these is always non-exhaustive.
# can only pattern match with the imported extensions
```
## Lenses ## Lenses