Trim open issues to materialization
This commit is contained in:
@@ -5,21 +5,19 @@
|
||||
## 基本的な設定スキーマ
|
||||
|
||||
```dcdl
|
||||
rec {
|
||||
Host = IPv4Address;
|
||||
Host = IPv4Address;
|
||||
|
||||
Port = Int & >= 1 & <= 65535;
|
||||
NarrowedPort = Port & > 443;
|
||||
Port = Int & >= 1 & <= 65535;
|
||||
NarrowedPort = Port & > 443;
|
||||
|
||||
MyConfig = {
|
||||
host = Host;
|
||||
port = NarrowedPort default 8080;
|
||||
feature_hoge = {
|
||||
enable = Bool default true;
|
||||
fuga = Int default 10;
|
||||
};
|
||||
MyConfig = {
|
||||
host = Host;
|
||||
port = NarrowedPort default 8080;
|
||||
feature_hoge = {
|
||||
enable = Bool default true;
|
||||
fuga = Int default 10;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
NewConfig = MyConfig & {
|
||||
host = "127.0.0.1";
|
||||
@@ -33,28 +31,20 @@ disabled_config = NewConfig & {
|
||||
enabled_config = NewConfig;
|
||||
```
|
||||
|
||||
## 関数と文字列生成
|
||||
## 関数と制約
|
||||
|
||||
```dcdl
|
||||
let
|
||||
maybe_hw = String & /Hello! .*/;
|
||||
part = {
|
||||
greet = String;
|
||||
target = String;
|
||||
};
|
||||
mk_hw = (part: part) =>
|
||||
maybe_hw & "${part.greet}! ${part.target}";
|
||||
Port = Int & >= 1 & <= 65535;
|
||||
add_offset = (base: Port, offset: Int) => base + offset;
|
||||
in
|
||||
mk_hw({
|
||||
greet = "Hello";
|
||||
target = "World";
|
||||
})
|
||||
add_offset(8000, 80)
|
||||
```
|
||||
|
||||
評価結果:
|
||||
|
||||
```text
|
||||
"Hello! World"
|
||||
8080
|
||||
```
|
||||
|
||||
## match
|
||||
|
||||
Reference in New Issue
Block a user