Update spec.md
This commit is contained in:
25
spec.md
25
spec.md
@@ -91,6 +91,21 @@ type Uint8 = {...?Uint8}
|
||||
</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
|
||||
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
|
||||
|
Reference in New Issue
Block a user