init
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Composition Expression
|
||||
|
||||
composition expression は、複数の値・制約・構造を合成する式である。
|
||||
|
||||
## `&`
|
||||
|
||||
`&` は制約を保った合成を行う。
|
||||
|
||||
```n
|
||||
Port = Int & >= 1 & <= 65535;
|
||||
Config = MyConfig & { port = 8000; };
|
||||
```
|
||||
|
||||
## `//`
|
||||
|
||||
`//` は右辺優先の構造的 patch を行う。
|
||||
|
||||
```n
|
||||
Patched = Base // {
|
||||
feature_hoge.enable = false;
|
||||
};
|
||||
```
|
||||
|
||||
詳細は [合成演算子](../operators.md) に置く。
|
||||
Reference in New Issue
Block a user