@nfdi4plants/arctrl 2.0.0-beta.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARC.js +55 -18
- package/Contract/ArcAssay.js +4 -4
- package/Contract/ArcInvestigation.js +4 -4
- package/Contract/ArcStudy.js +3 -3
- package/Contract/Datamap.js +1 -1
- package/Contract/ValidationPackagesConfig.js +96 -0
- package/Core/ArcTypes.js +93 -90
- package/Core/Conversion.js +13 -13
- package/Core/DataContext.js +53 -6
- package/Core/{Table/DataMap.js → DataMap.js} +34 -22
- package/Core/Process/Component.js +15 -5
- package/Core/Process/FactorValue.js +14 -5
- package/Core/Process/MaterialAttributeValue.js +14 -5
- package/Core/Process/ProcessParameterValue.js +11 -2
- package/Core/Table/ArcTable.js +99 -11
- package/Core/Table/CompositeCell.js +38 -23
- package/Core/Table/CompositeColumn.js +7 -30
- package/Core/Table/CompositeHeader.js +5 -215
- package/Core/{Process/Value.js → Value.js} +9 -9
- package/Json/Assay.js +10 -9
- package/Json/{Process/Data.js → Data.js} +17 -17
- package/Json/{Process/DataFile.js → DataFile.js} +9 -9
- package/Json/DataMap/DataContext.js +30 -0
- package/Json/DataMap/DataMap.js +25 -0
- package/Json/Encode.js +10 -1
- package/Json/Process/Component.js +1 -1
- package/Json/Process/FactorValue.js +1 -1
- package/Json/Process/MaterialAttributeValue.js +1 -1
- package/Json/Process/ProcessInput.js +1 -1
- package/Json/Process/ProcessOutput.js +1 -1
- package/Json/Process/ProcessParameterValue.js +2 -2
- package/Json/Process/Value.js +3 -3
- package/Json/{Process/PropertyValue.js → PropertyValue.js} +30 -21
- package/Json/Study.js +9 -8
- package/Json/Table/CompositeCell.js +1 -1
- package/Json/context/rocrate/isa_data_context.js +1 -1
- package/Json/context/rocrate/isa_investigation_context.js +1 -1
- package/Json/context/rocrate/property_value_context.js +1 -1
- package/Spreadsheet/AnnotationTable/ArcTable.js +3 -2
- package/Spreadsheet/AnnotationTable/CompositeColumn.js +9 -7
- package/Spreadsheet/ArcAssay.js +62 -26
- package/Spreadsheet/ArcInvestigation.js +59 -38
- package/Spreadsheet/ArcStudy.js +51 -20
- package/Spreadsheet/DataMap.js +1 -1
- package/Spreadsheet/DataMapTable/DataMapTable.js +3 -3
- package/Spreadsheet/Template.js +1 -1
- package/ValidationPackages/ValidationPackage.js +61 -0
- package/ValidationPackages/ValidationPackagesConfig.js +88 -0
- package/Xlsx.js +9 -9
- package/Yaml/Encode.js +8 -0
- package/Yaml/ValidationPackage.js +47 -0
- package/Yaml/ValidationPackagesConfig.js +48 -0
- package/fable_modules/YAMLicious.0.0.1/Decode.fs +374 -0
- package/fable_modules/YAMLicious.0.0.1/Decode.fs.js +1684 -0
- package/fable_modules/YAMLicious.0.0.1/Encode.fs +148 -0
- package/fable_modules/YAMLicious.0.0.1/Encode.fs.js +74 -0
- package/fable_modules/YAMLicious.0.0.1/Interop/JsInterop.fs +14 -0
- package/fable_modules/YAMLicious.0.0.1/Interop/JsInterop.fs.js +11 -0
- package/fable_modules/YAMLicious.0.0.1/Interop/PyInterop.fs +9 -0
- package/fable_modules/YAMLicious.0.0.1/Library.fs +138 -0
- package/fable_modules/YAMLicious.0.0.1/Library.fs.js +7 -0
- package/fable_modules/YAMLicious.0.0.1/Persil.fs +86 -0
- package/fable_modules/YAMLicious.0.0.1/Persil.fs.js +49 -0
- package/fable_modules/YAMLicious.0.0.1/Preprocessing.fs +59 -0
- package/fable_modules/YAMLicious.0.0.1/Preprocessing.fs.js +102 -0
- package/fable_modules/YAMLicious.0.0.1/Reader.fs +295 -0
- package/fable_modules/YAMLicious.0.0.1/Reader.fs.js +530 -0
- package/fable_modules/YAMLicious.0.0.1/Regex.fs +108 -0
- package/fable_modules/YAMLicious.0.0.1/Regex.fs.js +19 -0
- package/fable_modules/YAMLicious.0.0.1/RegexActivePatterns.fs +166 -0
- package/fable_modules/YAMLicious.0.0.1/RegexActivePatterns.fs.js +225 -0
- package/fable_modules/YAMLicious.0.0.1/Writer.fs +84 -0
- package/fable_modules/YAMLicious.0.0.1/Writer.fs.js +161 -0
- package/fable_modules/YAMLicious.0.0.1/YAMLicious.fableproj +39 -0
- package/fable_modules/YAMLicious.0.0.1/YAMLiciousTypes.fs +82 -0
- package/fable_modules/YAMLicious.0.0.1/YAMLiciousTypes.fs.js +130 -0
- package/fable_modules/YAMLicious.0.0.1/obj/Debug/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
- package/fable_modules/YAMLicious.0.0.1/obj/Debug/netstandard2.0/YAMLicious.AssemblyInfo.fs +19 -0
- package/fable_modules/YAMLicious.0.0.1/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
- package/fable_modules/YAMLicious.0.0.1/obj/Release/netstandard2.0/YAMLicious.AssemblyInfo.fs +19 -0
- package/fable_modules/project_cracked.json +1 -1
- package/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1684 @@
|
|
|
1
|
+
import { isString } from "./Interop/JsInterop.fs.js";
|
|
2
|
+
import { tryParse } from "../fable-library-js.4.16.0/Int32.js";
|
|
3
|
+
import { FSharpRef } from "../fable-library-js.4.16.0/Types.js";
|
|
4
|
+
import { printf, toText } from "../fable-library-js.4.16.0/String.js";
|
|
5
|
+
import { iterate, exists, filter, tryFind, toArray, map as map_1, tail, head, isEmpty } from "../fable-library-js.4.16.0/List.js";
|
|
6
|
+
import { tryParse as tryParse_1 } from "../fable-library-js.4.16.0/Double.js";
|
|
7
|
+
import { tryParse as tryParse_2 } from "../fable-library-js.4.16.0/Boolean.js";
|
|
8
|
+
import { ofSeq, ofList } from "../fable-library-js.4.16.0/Map.js";
|
|
9
|
+
import { structuralHash, equals as equals_1, compare } from "../fable-library-js.4.16.0/Util.js";
|
|
10
|
+
import { Dictionary } from "../fable-library-js.4.16.0/MutableMap.js";
|
|
11
|
+
import { tryParse as tryParse_3, minValue } from "../fable-library-js.4.16.0/Date.js";
|
|
12
|
+
import { tryParse as tryParse_4, minValue as minValue_1 } from "../fable-library-js.4.16.0/DateOffset.js";
|
|
13
|
+
import { value as value_1, map as map_3, some } from "../fable-library-js.4.16.0/Option.js";
|
|
14
|
+
import { map as map_2 } from "../fable-library-js.4.16.0/Seq.js";
|
|
15
|
+
import { addToDict } from "../fable-library-js.4.16.0/MapUtil.js";
|
|
16
|
+
import { class_type } from "../fable-library-js.4.16.0/Reflection.js";
|
|
17
|
+
import { read as read_1 } from "./Reader.fs.js";
|
|
18
|
+
|
|
19
|
+
export function Helper_isString(value) {
|
|
20
|
+
return isString(value);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function int(value) {
|
|
24
|
+
let matchResult, v;
|
|
25
|
+
switch (value.tag) {
|
|
26
|
+
case 1: {
|
|
27
|
+
matchResult = 0;
|
|
28
|
+
v = value.fields[0];
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case 3: {
|
|
32
|
+
if (!isEmpty(value.fields[0])) {
|
|
33
|
+
if (head(value.fields[0]).tag === 1) {
|
|
34
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
35
|
+
matchResult = 0;
|
|
36
|
+
v = head(value.fields[0]).fields[0];
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
matchResult = 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
matchResult = 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
matchResult = 1;
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
default:
|
|
52
|
+
matchResult = 1;
|
|
53
|
+
}
|
|
54
|
+
switch (matchResult) {
|
|
55
|
+
case 0: {
|
|
56
|
+
let matchValue;
|
|
57
|
+
let outArg = 0;
|
|
58
|
+
matchValue = [tryParse(v.Value, 511, false, 32, new FSharpRef(() => outArg, (v_1) => {
|
|
59
|
+
outArg = (v_1 | 0);
|
|
60
|
+
})), outArg];
|
|
61
|
+
if (matchValue[0]) {
|
|
62
|
+
return matchValue[1] | 0;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
throw new Error((toText(printf("%s: %A"))("Expected an int")(v.Value) + "\\nParameter name: ") + "value");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
default:
|
|
69
|
+
throw new Error((toText(printf("%s: %A"))("Expected an YAMLElement.Value")(value) + "\\nParameter name: ") + "value");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function float(value) {
|
|
74
|
+
const Culture = {};
|
|
75
|
+
let matchResult, v;
|
|
76
|
+
switch (value.tag) {
|
|
77
|
+
case 1: {
|
|
78
|
+
matchResult = 0;
|
|
79
|
+
v = value.fields[0];
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case 3: {
|
|
83
|
+
if (!isEmpty(value.fields[0])) {
|
|
84
|
+
if (head(value.fields[0]).tag === 1) {
|
|
85
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
86
|
+
matchResult = 0;
|
|
87
|
+
v = head(value.fields[0]).fields[0];
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
matchResult = 1;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
matchResult = 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
matchResult = 1;
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
default:
|
|
103
|
+
matchResult = 1;
|
|
104
|
+
}
|
|
105
|
+
switch (matchResult) {
|
|
106
|
+
case 0: {
|
|
107
|
+
let matchValue;
|
|
108
|
+
let outArg = 0;
|
|
109
|
+
matchValue = [tryParse_1(v.Value, new FSharpRef(() => outArg, (v_1) => {
|
|
110
|
+
outArg = v_1;
|
|
111
|
+
})), outArg];
|
|
112
|
+
if (matchValue[0]) {
|
|
113
|
+
return matchValue[1];
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
throw new Error((toText(printf("%s: %A"))("Expected an int")(v.Value) + "\\nParameter name: ") + "value");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
default:
|
|
120
|
+
throw new Error((toText(printf("%s: %A"))("Expected an YAMLElement.Value")(value) + "\\nParameter name: ") + "value");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function char(value) {
|
|
125
|
+
let matchResult, v, anyElse;
|
|
126
|
+
switch (value.tag) {
|
|
127
|
+
case 1: {
|
|
128
|
+
matchResult = 0;
|
|
129
|
+
v = value.fields[0];
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
case 3: {
|
|
133
|
+
if (!isEmpty(value.fields[0])) {
|
|
134
|
+
if (head(value.fields[0]).tag === 1) {
|
|
135
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
136
|
+
matchResult = 0;
|
|
137
|
+
v = head(value.fields[0]).fields[0];
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
matchResult = 1;
|
|
141
|
+
anyElse = value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
matchResult = 1;
|
|
146
|
+
anyElse = value;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
matchResult = 1;
|
|
151
|
+
anyElse = value;
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
default: {
|
|
156
|
+
matchResult = 1;
|
|
157
|
+
anyElse = value;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
switch (matchResult) {
|
|
161
|
+
case 0:
|
|
162
|
+
if (Helper_isString(v.Value)) {
|
|
163
|
+
return v.Value[0];
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
throw new Error((toText(printf("%s: %A"))("Expected a char")(v.Value) + "\\nParameter name: ") + "value");
|
|
167
|
+
}
|
|
168
|
+
default:
|
|
169
|
+
throw new Error((toText(printf("%s: %A"))("Expected a char")(anyElse) + "\\nParameter name: ") + "value");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function bool(value) {
|
|
174
|
+
let matchResult, v, anyElse;
|
|
175
|
+
switch (value.tag) {
|
|
176
|
+
case 1: {
|
|
177
|
+
matchResult = 0;
|
|
178
|
+
v = value.fields[0];
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
case 3: {
|
|
182
|
+
if (!isEmpty(value.fields[0])) {
|
|
183
|
+
if (head(value.fields[0]).tag === 1) {
|
|
184
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
185
|
+
matchResult = 0;
|
|
186
|
+
v = head(value.fields[0]).fields[0];
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
matchResult = 1;
|
|
190
|
+
anyElse = value;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
matchResult = 1;
|
|
195
|
+
anyElse = value;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
matchResult = 1;
|
|
200
|
+
anyElse = value;
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
default: {
|
|
205
|
+
matchResult = 1;
|
|
206
|
+
anyElse = value;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
switch (matchResult) {
|
|
210
|
+
case 0: {
|
|
211
|
+
let matchValue;
|
|
212
|
+
let outArg = false;
|
|
213
|
+
matchValue = [tryParse_2(v.Value, new FSharpRef(() => outArg, (v_1) => {
|
|
214
|
+
outArg = v_1;
|
|
215
|
+
})), outArg];
|
|
216
|
+
if (matchValue[0]) {
|
|
217
|
+
return matchValue[1];
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
throw new Error((toText(printf("%s: %A"))("Expected a bool")(v.Value) + "\\nParameter name: ") + "value");
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
default:
|
|
224
|
+
throw new Error((toText(printf("%s: %A"))("Expected a bool")(anyElse) + "\\nParameter name: ") + "value");
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function map(keyDecoder, valueDecoder, value) {
|
|
229
|
+
if (value.tag === 3) {
|
|
230
|
+
return ofList(map_1((x) => {
|
|
231
|
+
if (x.tag === 0) {
|
|
232
|
+
return [keyDecoder(x.fields[0].Value), valueDecoder(x.fields[1])];
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
throw new Error((toText(printf("%s: %A"))("Expected a mapping")(x) + "\\nParameter name: ") + "value");
|
|
236
|
+
}
|
|
237
|
+
}, value.fields[0]), {
|
|
238
|
+
Compare: compare,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
throw new Error((toText(printf("%s: %A"))("Expected a map")(value) + "\\nParameter name: ") + "value");
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function dict(keyDecoder, valueDecoder, value) {
|
|
247
|
+
if (value.tag === 3) {
|
|
248
|
+
return new Dictionary(ofSeq(map_1((x) => {
|
|
249
|
+
if (x.tag === 0) {
|
|
250
|
+
return [keyDecoder(x.fields[0].Value), valueDecoder(x.fields[1])];
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
throw new Error((toText(printf("%s: %A"))("Expected a mapping")(x) + "\\nParameter name: ") + "value");
|
|
254
|
+
}
|
|
255
|
+
}, value.fields[0]), {
|
|
256
|
+
Compare: compare,
|
|
257
|
+
}), {
|
|
258
|
+
Equals: equals_1,
|
|
259
|
+
GetHashCode: structuralHash,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
throw new Error((toText(printf("%s: %A"))("Expected a dictionary")(value) + "\\nParameter name: ") + "value");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export function datetime(value) {
|
|
268
|
+
let matchResult, v, anyElse;
|
|
269
|
+
switch (value.tag) {
|
|
270
|
+
case 1: {
|
|
271
|
+
matchResult = 0;
|
|
272
|
+
v = value.fields[0];
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
case 3: {
|
|
276
|
+
if (!isEmpty(value.fields[0])) {
|
|
277
|
+
if (head(value.fields[0]).tag === 1) {
|
|
278
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
279
|
+
matchResult = 0;
|
|
280
|
+
v = head(value.fields[0]).fields[0];
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
matchResult = 1;
|
|
284
|
+
anyElse = value;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
matchResult = 1;
|
|
289
|
+
anyElse = value;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
matchResult = 1;
|
|
294
|
+
anyElse = value;
|
|
295
|
+
}
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
default: {
|
|
299
|
+
matchResult = 1;
|
|
300
|
+
anyElse = value;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
switch (matchResult) {
|
|
304
|
+
case 0: {
|
|
305
|
+
let matchValue;
|
|
306
|
+
let outArg = minValue();
|
|
307
|
+
matchValue = [tryParse_3(v.Value, new FSharpRef(() => outArg, (v_1) => {
|
|
308
|
+
outArg = v_1;
|
|
309
|
+
})), outArg];
|
|
310
|
+
if (matchValue[0]) {
|
|
311
|
+
return matchValue[1];
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
throw new Error((toText(printf("%s: %A"))("Expected a DateTime")(v.Value) + "\\nParameter name: ") + "value");
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
default:
|
|
318
|
+
throw new Error((toText(printf("%s: %A"))("Expected a DateTime")(anyElse) + "\\nParameter name: ") + "value");
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export function datetimeOffset(value) {
|
|
323
|
+
let matchResult, v, anyElse;
|
|
324
|
+
switch (value.tag) {
|
|
325
|
+
case 1: {
|
|
326
|
+
matchResult = 0;
|
|
327
|
+
v = value.fields[0];
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
case 3: {
|
|
331
|
+
if (!isEmpty(value.fields[0])) {
|
|
332
|
+
if (head(value.fields[0]).tag === 1) {
|
|
333
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
334
|
+
matchResult = 0;
|
|
335
|
+
v = head(value.fields[0]).fields[0];
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
matchResult = 1;
|
|
339
|
+
anyElse = value;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
matchResult = 1;
|
|
344
|
+
anyElse = value;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
matchResult = 1;
|
|
349
|
+
anyElse = value;
|
|
350
|
+
}
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
default: {
|
|
354
|
+
matchResult = 1;
|
|
355
|
+
anyElse = value;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
switch (matchResult) {
|
|
359
|
+
case 0: {
|
|
360
|
+
let matchValue;
|
|
361
|
+
let outArg = minValue_1();
|
|
362
|
+
matchValue = [tryParse_4(v.Value, new FSharpRef(() => outArg, (v_1) => {
|
|
363
|
+
outArg = v_1;
|
|
364
|
+
})), outArg];
|
|
365
|
+
if (matchValue[0]) {
|
|
366
|
+
return matchValue[1];
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
throw new Error((toText(printf("%s: %A"))("Expected a DateTimeOffset")(v.Value) + "\\nParameter name: ") + "value");
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
default:
|
|
373
|
+
throw new Error((toText(printf("%s: %A"))("Expected a DateTimeOffset")(anyElse) + "\\nParameter name: ") + "value");
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export function option(decoder, value) {
|
|
378
|
+
let matchResult, v, anyElse;
|
|
379
|
+
switch (value.tag) {
|
|
380
|
+
case 1: {
|
|
381
|
+
matchResult = 0;
|
|
382
|
+
v = value.fields[0];
|
|
383
|
+
break;
|
|
384
|
+
}
|
|
385
|
+
case 3: {
|
|
386
|
+
if (!isEmpty(value.fields[0])) {
|
|
387
|
+
if (head(value.fields[0]).tag === 1) {
|
|
388
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
389
|
+
matchResult = 0;
|
|
390
|
+
v = head(value.fields[0]).fields[0];
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
matchResult = 1;
|
|
394
|
+
anyElse = value;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
matchResult = 1;
|
|
399
|
+
anyElse = value;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
matchResult = 1;
|
|
404
|
+
anyElse = value;
|
|
405
|
+
}
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
default: {
|
|
409
|
+
matchResult = 1;
|
|
410
|
+
anyElse = value;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
switch (matchResult) {
|
|
414
|
+
case 0:
|
|
415
|
+
if (v.Value === "null") {
|
|
416
|
+
return void 0;
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
return some(decoder(value));
|
|
420
|
+
}
|
|
421
|
+
default:
|
|
422
|
+
throw new Error((toText(printf("%s: %A"))("Expected an option")(anyElse) + "\\nParameter name: ") + "value");
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export function string(value) {
|
|
427
|
+
let matchResult, v, anyElse;
|
|
428
|
+
switch (value.tag) {
|
|
429
|
+
case 1: {
|
|
430
|
+
matchResult = 0;
|
|
431
|
+
v = value.fields[0];
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
case 3: {
|
|
435
|
+
if (!isEmpty(value.fields[0])) {
|
|
436
|
+
if (head(value.fields[0]).tag === 1) {
|
|
437
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
438
|
+
matchResult = 0;
|
|
439
|
+
v = head(value.fields[0]).fields[0];
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
matchResult = 1;
|
|
443
|
+
anyElse = value;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
matchResult = 1;
|
|
448
|
+
anyElse = value;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
matchResult = 1;
|
|
453
|
+
anyElse = value;
|
|
454
|
+
}
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
default: {
|
|
458
|
+
matchResult = 1;
|
|
459
|
+
anyElse = value;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
switch (matchResult) {
|
|
463
|
+
case 0:
|
|
464
|
+
return v.Value;
|
|
465
|
+
default:
|
|
466
|
+
throw new Error((toText(printf("%s: %A"))("Expected a string")(anyElse) + "\\nParameter name: ") + "value");
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export function tuple2(decoderA, decoderB, value) {
|
|
471
|
+
let matchResult, a, b, anyElse;
|
|
472
|
+
switch (value.tag) {
|
|
473
|
+
case 3: {
|
|
474
|
+
if (!isEmpty(value.fields[0])) {
|
|
475
|
+
if (head(value.fields[0]).tag === 2) {
|
|
476
|
+
if (!isEmpty(head(value.fields[0]).fields[0])) {
|
|
477
|
+
if (!isEmpty(tail(head(value.fields[0]).fields[0]))) {
|
|
478
|
+
if (isEmpty(tail(tail(head(value.fields[0]).fields[0])))) {
|
|
479
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
480
|
+
matchResult = 0;
|
|
481
|
+
a = head(head(value.fields[0]).fields[0]);
|
|
482
|
+
b = head(tail(head(value.fields[0]).fields[0]));
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
matchResult = 1;
|
|
486
|
+
anyElse = value;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
matchResult = 1;
|
|
491
|
+
anyElse = value;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
matchResult = 1;
|
|
496
|
+
anyElse = value;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
matchResult = 1;
|
|
501
|
+
anyElse = value;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
matchResult = 1;
|
|
506
|
+
anyElse = value;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
matchResult = 1;
|
|
511
|
+
anyElse = value;
|
|
512
|
+
}
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
case 2: {
|
|
516
|
+
if (!isEmpty(value.fields[0])) {
|
|
517
|
+
if (!isEmpty(tail(value.fields[0]))) {
|
|
518
|
+
if (isEmpty(tail(tail(value.fields[0])))) {
|
|
519
|
+
matchResult = 0;
|
|
520
|
+
a = head(value.fields[0]);
|
|
521
|
+
b = head(tail(value.fields[0]));
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
matchResult = 1;
|
|
525
|
+
anyElse = value;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
matchResult = 1;
|
|
530
|
+
anyElse = value;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
matchResult = 1;
|
|
535
|
+
anyElse = value;
|
|
536
|
+
}
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
default: {
|
|
540
|
+
matchResult = 1;
|
|
541
|
+
anyElse = value;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
switch (matchResult) {
|
|
545
|
+
case 0:
|
|
546
|
+
return [decoderA(a), decoderB(b)];
|
|
547
|
+
default:
|
|
548
|
+
throw new Error((toText(printf("%s: %A"))("Expected a tuple2")(anyElse) + "\\nParameter name: ") + "value");
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export function tuple3(decoderA, decoderB, decoderC, value) {
|
|
553
|
+
let matchResult, a, b, c, anyElse;
|
|
554
|
+
switch (value.tag) {
|
|
555
|
+
case 3: {
|
|
556
|
+
if (!isEmpty(value.fields[0])) {
|
|
557
|
+
if (head(value.fields[0]).tag === 2) {
|
|
558
|
+
if (!isEmpty(head(value.fields[0]).fields[0])) {
|
|
559
|
+
if (!isEmpty(tail(head(value.fields[0]).fields[0]))) {
|
|
560
|
+
if (!isEmpty(tail(tail(head(value.fields[0]).fields[0])))) {
|
|
561
|
+
if (isEmpty(tail(tail(tail(head(value.fields[0]).fields[0]))))) {
|
|
562
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
563
|
+
matchResult = 0;
|
|
564
|
+
a = head(head(value.fields[0]).fields[0]);
|
|
565
|
+
b = head(tail(head(value.fields[0]).fields[0]));
|
|
566
|
+
c = head(tail(tail(head(value.fields[0]).fields[0])));
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
matchResult = 1;
|
|
570
|
+
anyElse = value;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
matchResult = 1;
|
|
575
|
+
anyElse = value;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
matchResult = 1;
|
|
580
|
+
anyElse = value;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
matchResult = 1;
|
|
585
|
+
anyElse = value;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
else {
|
|
589
|
+
matchResult = 1;
|
|
590
|
+
anyElse = value;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
matchResult = 1;
|
|
595
|
+
anyElse = value;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
matchResult = 1;
|
|
600
|
+
anyElse = value;
|
|
601
|
+
}
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
case 2: {
|
|
605
|
+
if (!isEmpty(value.fields[0])) {
|
|
606
|
+
if (!isEmpty(tail(value.fields[0]))) {
|
|
607
|
+
if (!isEmpty(tail(tail(value.fields[0])))) {
|
|
608
|
+
if (isEmpty(tail(tail(tail(value.fields[0]))))) {
|
|
609
|
+
matchResult = 0;
|
|
610
|
+
a = head(value.fields[0]);
|
|
611
|
+
b = head(tail(value.fields[0]));
|
|
612
|
+
c = head(tail(tail(value.fields[0])));
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
matchResult = 1;
|
|
616
|
+
anyElse = value;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
matchResult = 1;
|
|
621
|
+
anyElse = value;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
matchResult = 1;
|
|
626
|
+
anyElse = value;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
matchResult = 1;
|
|
631
|
+
anyElse = value;
|
|
632
|
+
}
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
default: {
|
|
636
|
+
matchResult = 1;
|
|
637
|
+
anyElse = value;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
switch (matchResult) {
|
|
641
|
+
case 0:
|
|
642
|
+
return [decoderA(a), decoderB(b), decoderC(c)];
|
|
643
|
+
default:
|
|
644
|
+
throw new Error((toText(printf("%s: %A"))("Expected a tuple3")(anyElse) + "\\nParameter name: ") + "value");
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export function tuple4(decoderA, decoderB, decoderC, decoderD, value) {
|
|
649
|
+
let matchResult, a, b, c, d, anyElse;
|
|
650
|
+
switch (value.tag) {
|
|
651
|
+
case 3: {
|
|
652
|
+
if (!isEmpty(value.fields[0])) {
|
|
653
|
+
if (head(value.fields[0]).tag === 2) {
|
|
654
|
+
if (!isEmpty(head(value.fields[0]).fields[0])) {
|
|
655
|
+
if (!isEmpty(tail(head(value.fields[0]).fields[0]))) {
|
|
656
|
+
if (!isEmpty(tail(tail(head(value.fields[0]).fields[0])))) {
|
|
657
|
+
if (!isEmpty(tail(tail(tail(head(value.fields[0]).fields[0]))))) {
|
|
658
|
+
if (isEmpty(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))) {
|
|
659
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
660
|
+
matchResult = 0;
|
|
661
|
+
a = head(head(value.fields[0]).fields[0]);
|
|
662
|
+
b = head(tail(head(value.fields[0]).fields[0]));
|
|
663
|
+
c = head(tail(tail(head(value.fields[0]).fields[0])));
|
|
664
|
+
d = head(tail(tail(tail(head(value.fields[0]).fields[0]))));
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
matchResult = 1;
|
|
668
|
+
anyElse = value;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
matchResult = 1;
|
|
673
|
+
anyElse = value;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
matchResult = 1;
|
|
678
|
+
anyElse = value;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
else {
|
|
682
|
+
matchResult = 1;
|
|
683
|
+
anyElse = value;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
matchResult = 1;
|
|
688
|
+
anyElse = value;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
692
|
+
matchResult = 1;
|
|
693
|
+
anyElse = value;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
matchResult = 1;
|
|
698
|
+
anyElse = value;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
matchResult = 1;
|
|
703
|
+
anyElse = value;
|
|
704
|
+
}
|
|
705
|
+
break;
|
|
706
|
+
}
|
|
707
|
+
case 2: {
|
|
708
|
+
if (!isEmpty(value.fields[0])) {
|
|
709
|
+
if (!isEmpty(tail(value.fields[0]))) {
|
|
710
|
+
if (!isEmpty(tail(tail(value.fields[0])))) {
|
|
711
|
+
if (!isEmpty(tail(tail(tail(value.fields[0]))))) {
|
|
712
|
+
if (isEmpty(tail(tail(tail(tail(value.fields[0])))))) {
|
|
713
|
+
matchResult = 0;
|
|
714
|
+
a = head(value.fields[0]);
|
|
715
|
+
b = head(tail(value.fields[0]));
|
|
716
|
+
c = head(tail(tail(value.fields[0])));
|
|
717
|
+
d = head(tail(tail(tail(value.fields[0]))));
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
matchResult = 1;
|
|
721
|
+
anyElse = value;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
matchResult = 1;
|
|
726
|
+
anyElse = value;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
else {
|
|
730
|
+
matchResult = 1;
|
|
731
|
+
anyElse = value;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
matchResult = 1;
|
|
736
|
+
anyElse = value;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
matchResult = 1;
|
|
741
|
+
anyElse = value;
|
|
742
|
+
}
|
|
743
|
+
break;
|
|
744
|
+
}
|
|
745
|
+
default: {
|
|
746
|
+
matchResult = 1;
|
|
747
|
+
anyElse = value;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
switch (matchResult) {
|
|
751
|
+
case 0:
|
|
752
|
+
return [decoderA(a), decoderB(b), decoderC(c), decoderD(d)];
|
|
753
|
+
default:
|
|
754
|
+
throw new Error((toText(printf("%s: %A"))("Expected a tuple4")(anyElse) + "\\nParameter name: ") + "value");
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
export function tuple5(decoderA, decoderB, decoderC, decoderD, decoderE, value) {
|
|
759
|
+
let matchResult, a, b, c, d, e, anyElse;
|
|
760
|
+
switch (value.tag) {
|
|
761
|
+
case 3: {
|
|
762
|
+
if (!isEmpty(value.fields[0])) {
|
|
763
|
+
if (head(value.fields[0]).tag === 2) {
|
|
764
|
+
if (!isEmpty(head(value.fields[0]).fields[0])) {
|
|
765
|
+
if (!isEmpty(tail(head(value.fields[0]).fields[0]))) {
|
|
766
|
+
if (!isEmpty(tail(tail(head(value.fields[0]).fields[0])))) {
|
|
767
|
+
if (!isEmpty(tail(tail(tail(head(value.fields[0]).fields[0]))))) {
|
|
768
|
+
if (!isEmpty(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))) {
|
|
769
|
+
if (isEmpty(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))))) {
|
|
770
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
771
|
+
matchResult = 0;
|
|
772
|
+
a = head(head(value.fields[0]).fields[0]);
|
|
773
|
+
b = head(tail(head(value.fields[0]).fields[0]));
|
|
774
|
+
c = head(tail(tail(head(value.fields[0]).fields[0])));
|
|
775
|
+
d = head(tail(tail(tail(head(value.fields[0]).fields[0]))));
|
|
776
|
+
e = head(tail(tail(tail(tail(head(value.fields[0]).fields[0])))));
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
matchResult = 1;
|
|
780
|
+
anyElse = value;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
matchResult = 1;
|
|
785
|
+
anyElse = value;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
else {
|
|
789
|
+
matchResult = 1;
|
|
790
|
+
anyElse = value;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
else {
|
|
794
|
+
matchResult = 1;
|
|
795
|
+
anyElse = value;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
else {
|
|
799
|
+
matchResult = 1;
|
|
800
|
+
anyElse = value;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
matchResult = 1;
|
|
805
|
+
anyElse = value;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
matchResult = 1;
|
|
810
|
+
anyElse = value;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
else {
|
|
814
|
+
matchResult = 1;
|
|
815
|
+
anyElse = value;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
matchResult = 1;
|
|
820
|
+
anyElse = value;
|
|
821
|
+
}
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
case 2: {
|
|
825
|
+
if (!isEmpty(value.fields[0])) {
|
|
826
|
+
if (!isEmpty(tail(value.fields[0]))) {
|
|
827
|
+
if (!isEmpty(tail(tail(value.fields[0])))) {
|
|
828
|
+
if (!isEmpty(tail(tail(tail(value.fields[0]))))) {
|
|
829
|
+
if (!isEmpty(tail(tail(tail(tail(value.fields[0])))))) {
|
|
830
|
+
if (isEmpty(tail(tail(tail(tail(tail(value.fields[0]))))))) {
|
|
831
|
+
matchResult = 0;
|
|
832
|
+
a = head(value.fields[0]);
|
|
833
|
+
b = head(tail(value.fields[0]));
|
|
834
|
+
c = head(tail(tail(value.fields[0])));
|
|
835
|
+
d = head(tail(tail(tail(value.fields[0]))));
|
|
836
|
+
e = head(tail(tail(tail(tail(value.fields[0])))));
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
matchResult = 1;
|
|
840
|
+
anyElse = value;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
else {
|
|
844
|
+
matchResult = 1;
|
|
845
|
+
anyElse = value;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
else {
|
|
849
|
+
matchResult = 1;
|
|
850
|
+
anyElse = value;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
matchResult = 1;
|
|
855
|
+
anyElse = value;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
else {
|
|
859
|
+
matchResult = 1;
|
|
860
|
+
anyElse = value;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
matchResult = 1;
|
|
865
|
+
anyElse = value;
|
|
866
|
+
}
|
|
867
|
+
break;
|
|
868
|
+
}
|
|
869
|
+
default: {
|
|
870
|
+
matchResult = 1;
|
|
871
|
+
anyElse = value;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
switch (matchResult) {
|
|
875
|
+
case 0:
|
|
876
|
+
return [decoderA(a), decoderB(b), decoderC(c), decoderD(d), decoderE(e)];
|
|
877
|
+
default:
|
|
878
|
+
throw new Error((toText(printf("%s: %A"))("Expected a tuple5")(anyElse) + "\\nParameter name: ") + "value");
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export function tuple6(decoderA, decoderB, decoderC, decoderD, decoderE, decoderF, value) {
|
|
883
|
+
let matchResult, a, b, c, d, e, f, anyElse;
|
|
884
|
+
switch (value.tag) {
|
|
885
|
+
case 3: {
|
|
886
|
+
if (!isEmpty(value.fields[0])) {
|
|
887
|
+
if (head(value.fields[0]).tag === 2) {
|
|
888
|
+
if (!isEmpty(head(value.fields[0]).fields[0])) {
|
|
889
|
+
if (!isEmpty(tail(head(value.fields[0]).fields[0]))) {
|
|
890
|
+
if (!isEmpty(tail(tail(head(value.fields[0]).fields[0])))) {
|
|
891
|
+
if (!isEmpty(tail(tail(tail(head(value.fields[0]).fields[0]))))) {
|
|
892
|
+
if (!isEmpty(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))) {
|
|
893
|
+
if (!isEmpty(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))))) {
|
|
894
|
+
if (isEmpty(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))))) {
|
|
895
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
896
|
+
matchResult = 0;
|
|
897
|
+
a = head(head(value.fields[0]).fields[0]);
|
|
898
|
+
b = head(tail(head(value.fields[0]).fields[0]));
|
|
899
|
+
c = head(tail(tail(head(value.fields[0]).fields[0])));
|
|
900
|
+
d = head(tail(tail(tail(head(value.fields[0]).fields[0]))));
|
|
901
|
+
e = head(tail(tail(tail(tail(head(value.fields[0]).fields[0])))));
|
|
902
|
+
f = head(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))));
|
|
903
|
+
}
|
|
904
|
+
else {
|
|
905
|
+
matchResult = 1;
|
|
906
|
+
anyElse = value;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
else {
|
|
910
|
+
matchResult = 1;
|
|
911
|
+
anyElse = value;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
else {
|
|
915
|
+
matchResult = 1;
|
|
916
|
+
anyElse = value;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
matchResult = 1;
|
|
921
|
+
anyElse = value;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
matchResult = 1;
|
|
926
|
+
anyElse = value;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
else {
|
|
930
|
+
matchResult = 1;
|
|
931
|
+
anyElse = value;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
else {
|
|
935
|
+
matchResult = 1;
|
|
936
|
+
anyElse = value;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
else {
|
|
940
|
+
matchResult = 1;
|
|
941
|
+
anyElse = value;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
else {
|
|
945
|
+
matchResult = 1;
|
|
946
|
+
anyElse = value;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
else {
|
|
950
|
+
matchResult = 1;
|
|
951
|
+
anyElse = value;
|
|
952
|
+
}
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
case 2: {
|
|
956
|
+
if (!isEmpty(value.fields[0])) {
|
|
957
|
+
if (!isEmpty(tail(value.fields[0]))) {
|
|
958
|
+
if (!isEmpty(tail(tail(value.fields[0])))) {
|
|
959
|
+
if (!isEmpty(tail(tail(tail(value.fields[0]))))) {
|
|
960
|
+
if (!isEmpty(tail(tail(tail(tail(value.fields[0])))))) {
|
|
961
|
+
if (!isEmpty(tail(tail(tail(tail(tail(value.fields[0]))))))) {
|
|
962
|
+
if (isEmpty(tail(tail(tail(tail(tail(tail(value.fields[0])))))))) {
|
|
963
|
+
matchResult = 0;
|
|
964
|
+
a = head(value.fields[0]);
|
|
965
|
+
b = head(tail(value.fields[0]));
|
|
966
|
+
c = head(tail(tail(value.fields[0])));
|
|
967
|
+
d = head(tail(tail(tail(value.fields[0]))));
|
|
968
|
+
e = head(tail(tail(tail(tail(value.fields[0])))));
|
|
969
|
+
f = head(tail(tail(tail(tail(tail(value.fields[0]))))));
|
|
970
|
+
}
|
|
971
|
+
else {
|
|
972
|
+
matchResult = 1;
|
|
973
|
+
anyElse = value;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
else {
|
|
977
|
+
matchResult = 1;
|
|
978
|
+
anyElse = value;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
matchResult = 1;
|
|
983
|
+
anyElse = value;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
else {
|
|
987
|
+
matchResult = 1;
|
|
988
|
+
anyElse = value;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
else {
|
|
992
|
+
matchResult = 1;
|
|
993
|
+
anyElse = value;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
else {
|
|
997
|
+
matchResult = 1;
|
|
998
|
+
anyElse = value;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
else {
|
|
1002
|
+
matchResult = 1;
|
|
1003
|
+
anyElse = value;
|
|
1004
|
+
}
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
default: {
|
|
1008
|
+
matchResult = 1;
|
|
1009
|
+
anyElse = value;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
switch (matchResult) {
|
|
1013
|
+
case 0:
|
|
1014
|
+
return [decoderA(a), decoderB(b), decoderC(c), decoderD(d), decoderE(e), decoderF(f)];
|
|
1015
|
+
default:
|
|
1016
|
+
throw new Error((toText(printf("%s: %A"))("Expected a tuple6")(anyElse) + "\\nParameter name: ") + "value");
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
export function tuple7(decoderA, decoderB, decoderC, decoderD, decoderE, decoderF, decoderG, value) {
|
|
1021
|
+
let matchResult, a, b, c, d, e, f, g, anyElse;
|
|
1022
|
+
switch (value.tag) {
|
|
1023
|
+
case 3: {
|
|
1024
|
+
if (!isEmpty(value.fields[0])) {
|
|
1025
|
+
if (head(value.fields[0]).tag === 2) {
|
|
1026
|
+
if (!isEmpty(head(value.fields[0]).fields[0])) {
|
|
1027
|
+
if (!isEmpty(tail(head(value.fields[0]).fields[0]))) {
|
|
1028
|
+
if (!isEmpty(tail(tail(head(value.fields[0]).fields[0])))) {
|
|
1029
|
+
if (!isEmpty(tail(tail(tail(head(value.fields[0]).fields[0]))))) {
|
|
1030
|
+
if (!isEmpty(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))) {
|
|
1031
|
+
if (!isEmpty(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))))) {
|
|
1032
|
+
if (!isEmpty(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))))) {
|
|
1033
|
+
if (isEmpty(tail(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))))))) {
|
|
1034
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
1035
|
+
matchResult = 0;
|
|
1036
|
+
a = head(head(value.fields[0]).fields[0]);
|
|
1037
|
+
b = head(tail(head(value.fields[0]).fields[0]));
|
|
1038
|
+
c = head(tail(tail(head(value.fields[0]).fields[0])));
|
|
1039
|
+
d = head(tail(tail(tail(head(value.fields[0]).fields[0]))));
|
|
1040
|
+
e = head(tail(tail(tail(tail(head(value.fields[0]).fields[0])))));
|
|
1041
|
+
f = head(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))));
|
|
1042
|
+
g = head(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))));
|
|
1043
|
+
}
|
|
1044
|
+
else {
|
|
1045
|
+
matchResult = 1;
|
|
1046
|
+
anyElse = value;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
else {
|
|
1050
|
+
matchResult = 1;
|
|
1051
|
+
anyElse = value;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
matchResult = 1;
|
|
1056
|
+
anyElse = value;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
else {
|
|
1060
|
+
matchResult = 1;
|
|
1061
|
+
anyElse = value;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
else {
|
|
1065
|
+
matchResult = 1;
|
|
1066
|
+
anyElse = value;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
matchResult = 1;
|
|
1071
|
+
anyElse = value;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
else {
|
|
1075
|
+
matchResult = 1;
|
|
1076
|
+
anyElse = value;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
else {
|
|
1080
|
+
matchResult = 1;
|
|
1081
|
+
anyElse = value;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
else {
|
|
1085
|
+
matchResult = 1;
|
|
1086
|
+
anyElse = value;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
else {
|
|
1090
|
+
matchResult = 1;
|
|
1091
|
+
anyElse = value;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
else {
|
|
1095
|
+
matchResult = 1;
|
|
1096
|
+
anyElse = value;
|
|
1097
|
+
}
|
|
1098
|
+
break;
|
|
1099
|
+
}
|
|
1100
|
+
case 2: {
|
|
1101
|
+
if (!isEmpty(value.fields[0])) {
|
|
1102
|
+
if (!isEmpty(tail(value.fields[0]))) {
|
|
1103
|
+
if (!isEmpty(tail(tail(value.fields[0])))) {
|
|
1104
|
+
if (!isEmpty(tail(tail(tail(value.fields[0]))))) {
|
|
1105
|
+
if (!isEmpty(tail(tail(tail(tail(value.fields[0])))))) {
|
|
1106
|
+
if (!isEmpty(tail(tail(tail(tail(tail(value.fields[0]))))))) {
|
|
1107
|
+
if (!isEmpty(tail(tail(tail(tail(tail(tail(value.fields[0])))))))) {
|
|
1108
|
+
if (isEmpty(tail(tail(tail(tail(tail(tail(tail(value.fields[0]))))))))) {
|
|
1109
|
+
matchResult = 0;
|
|
1110
|
+
a = head(value.fields[0]);
|
|
1111
|
+
b = head(tail(value.fields[0]));
|
|
1112
|
+
c = head(tail(tail(value.fields[0])));
|
|
1113
|
+
d = head(tail(tail(tail(value.fields[0]))));
|
|
1114
|
+
e = head(tail(tail(tail(tail(value.fields[0])))));
|
|
1115
|
+
f = head(tail(tail(tail(tail(tail(value.fields[0]))))));
|
|
1116
|
+
g = head(tail(tail(tail(tail(tail(tail(value.fields[0])))))));
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
matchResult = 1;
|
|
1120
|
+
anyElse = value;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
else {
|
|
1124
|
+
matchResult = 1;
|
|
1125
|
+
anyElse = value;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
else {
|
|
1129
|
+
matchResult = 1;
|
|
1130
|
+
anyElse = value;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
else {
|
|
1134
|
+
matchResult = 1;
|
|
1135
|
+
anyElse = value;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
else {
|
|
1139
|
+
matchResult = 1;
|
|
1140
|
+
anyElse = value;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
else {
|
|
1144
|
+
matchResult = 1;
|
|
1145
|
+
anyElse = value;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
else {
|
|
1149
|
+
matchResult = 1;
|
|
1150
|
+
anyElse = value;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
else {
|
|
1154
|
+
matchResult = 1;
|
|
1155
|
+
anyElse = value;
|
|
1156
|
+
}
|
|
1157
|
+
break;
|
|
1158
|
+
}
|
|
1159
|
+
default: {
|
|
1160
|
+
matchResult = 1;
|
|
1161
|
+
anyElse = value;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
switch (matchResult) {
|
|
1165
|
+
case 0:
|
|
1166
|
+
return [decoderA(a), decoderB(b), decoderC(c), decoderD(d), decoderE(e), decoderF(f), decoderG(g)];
|
|
1167
|
+
default:
|
|
1168
|
+
throw new Error((toText(printf("%s: %A"))("Expected a tuple7")(anyElse) + "\\nParameter name: ") + "value");
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
export function tuple8(decoderA, decoderB, decoderC, decoderD, decoderE, decoderF, decoderG, decoderH, value) {
|
|
1173
|
+
let matchResult, a, b, c, d, e, f, g, h, anyElse;
|
|
1174
|
+
switch (value.tag) {
|
|
1175
|
+
case 3: {
|
|
1176
|
+
if (!isEmpty(value.fields[0])) {
|
|
1177
|
+
if (head(value.fields[0]).tag === 2) {
|
|
1178
|
+
if (!isEmpty(head(value.fields[0]).fields[0])) {
|
|
1179
|
+
if (!isEmpty(tail(head(value.fields[0]).fields[0]))) {
|
|
1180
|
+
if (!isEmpty(tail(tail(head(value.fields[0]).fields[0])))) {
|
|
1181
|
+
if (!isEmpty(tail(tail(tail(head(value.fields[0]).fields[0]))))) {
|
|
1182
|
+
if (!isEmpty(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))) {
|
|
1183
|
+
if (!isEmpty(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))))) {
|
|
1184
|
+
if (!isEmpty(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))))) {
|
|
1185
|
+
if (!isEmpty(tail(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))))))) {
|
|
1186
|
+
if (isEmpty(tail(tail(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))))))) {
|
|
1187
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
1188
|
+
matchResult = 0;
|
|
1189
|
+
a = head(head(value.fields[0]).fields[0]);
|
|
1190
|
+
b = head(tail(head(value.fields[0]).fields[0]));
|
|
1191
|
+
c = head(tail(tail(head(value.fields[0]).fields[0])));
|
|
1192
|
+
d = head(tail(tail(tail(head(value.fields[0]).fields[0]))));
|
|
1193
|
+
e = head(tail(tail(tail(tail(head(value.fields[0]).fields[0])))));
|
|
1194
|
+
f = head(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))));
|
|
1195
|
+
g = head(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0])))))));
|
|
1196
|
+
h = head(tail(tail(tail(tail(tail(tail(tail(head(value.fields[0]).fields[0]))))))));
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
matchResult = 1;
|
|
1200
|
+
anyElse = value;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
else {
|
|
1204
|
+
matchResult = 1;
|
|
1205
|
+
anyElse = value;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
else {
|
|
1209
|
+
matchResult = 1;
|
|
1210
|
+
anyElse = value;
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
else {
|
|
1214
|
+
matchResult = 1;
|
|
1215
|
+
anyElse = value;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
else {
|
|
1219
|
+
matchResult = 1;
|
|
1220
|
+
anyElse = value;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
else {
|
|
1224
|
+
matchResult = 1;
|
|
1225
|
+
anyElse = value;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
matchResult = 1;
|
|
1230
|
+
anyElse = value;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
matchResult = 1;
|
|
1235
|
+
anyElse = value;
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
else {
|
|
1239
|
+
matchResult = 1;
|
|
1240
|
+
anyElse = value;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
else {
|
|
1244
|
+
matchResult = 1;
|
|
1245
|
+
anyElse = value;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
else {
|
|
1249
|
+
matchResult = 1;
|
|
1250
|
+
anyElse = value;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
else {
|
|
1254
|
+
matchResult = 1;
|
|
1255
|
+
anyElse = value;
|
|
1256
|
+
}
|
|
1257
|
+
break;
|
|
1258
|
+
}
|
|
1259
|
+
case 2: {
|
|
1260
|
+
if (!isEmpty(value.fields[0])) {
|
|
1261
|
+
if (!isEmpty(tail(value.fields[0]))) {
|
|
1262
|
+
if (!isEmpty(tail(tail(value.fields[0])))) {
|
|
1263
|
+
if (!isEmpty(tail(tail(tail(value.fields[0]))))) {
|
|
1264
|
+
if (!isEmpty(tail(tail(tail(tail(value.fields[0])))))) {
|
|
1265
|
+
if (!isEmpty(tail(tail(tail(tail(tail(value.fields[0]))))))) {
|
|
1266
|
+
if (!isEmpty(tail(tail(tail(tail(tail(tail(value.fields[0])))))))) {
|
|
1267
|
+
if (!isEmpty(tail(tail(tail(tail(tail(tail(tail(value.fields[0]))))))))) {
|
|
1268
|
+
if (isEmpty(tail(tail(tail(tail(tail(tail(tail(tail(value.fields[0])))))))))) {
|
|
1269
|
+
matchResult = 0;
|
|
1270
|
+
a = head(value.fields[0]);
|
|
1271
|
+
b = head(tail(value.fields[0]));
|
|
1272
|
+
c = head(tail(tail(value.fields[0])));
|
|
1273
|
+
d = head(tail(tail(tail(value.fields[0]))));
|
|
1274
|
+
e = head(tail(tail(tail(tail(value.fields[0])))));
|
|
1275
|
+
f = head(tail(tail(tail(tail(tail(value.fields[0]))))));
|
|
1276
|
+
g = head(tail(tail(tail(tail(tail(tail(value.fields[0])))))));
|
|
1277
|
+
h = head(tail(tail(tail(tail(tail(tail(tail(value.fields[0]))))))));
|
|
1278
|
+
}
|
|
1279
|
+
else {
|
|
1280
|
+
matchResult = 1;
|
|
1281
|
+
anyElse = value;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
else {
|
|
1285
|
+
matchResult = 1;
|
|
1286
|
+
anyElse = value;
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
else {
|
|
1290
|
+
matchResult = 1;
|
|
1291
|
+
anyElse = value;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
else {
|
|
1295
|
+
matchResult = 1;
|
|
1296
|
+
anyElse = value;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
else {
|
|
1300
|
+
matchResult = 1;
|
|
1301
|
+
anyElse = value;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
matchResult = 1;
|
|
1306
|
+
anyElse = value;
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
else {
|
|
1310
|
+
matchResult = 1;
|
|
1311
|
+
anyElse = value;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
matchResult = 1;
|
|
1316
|
+
anyElse = value;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
else {
|
|
1320
|
+
matchResult = 1;
|
|
1321
|
+
anyElse = value;
|
|
1322
|
+
}
|
|
1323
|
+
break;
|
|
1324
|
+
}
|
|
1325
|
+
default: {
|
|
1326
|
+
matchResult = 1;
|
|
1327
|
+
anyElse = value;
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
switch (matchResult) {
|
|
1331
|
+
case 0:
|
|
1332
|
+
return [decoderA(a), decoderB(b), decoderC(c), decoderD(d), decoderE(e), decoderF(f), decoderG(g), decoderH(h)];
|
|
1333
|
+
default:
|
|
1334
|
+
throw new Error((toText(printf("%s: %A"))("Expected a tuple8")(anyElse) + "\\nParameter name: ") + "value");
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
export function list(decoder, value) {
|
|
1339
|
+
let matchResult, v, anyElse;
|
|
1340
|
+
switch (value.tag) {
|
|
1341
|
+
case 2: {
|
|
1342
|
+
matchResult = 0;
|
|
1343
|
+
v = value.fields[0];
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
case 3: {
|
|
1347
|
+
if (!isEmpty(value.fields[0])) {
|
|
1348
|
+
if (head(value.fields[0]).tag === 2) {
|
|
1349
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
1350
|
+
matchResult = 0;
|
|
1351
|
+
v = head(value.fields[0]).fields[0];
|
|
1352
|
+
}
|
|
1353
|
+
else {
|
|
1354
|
+
matchResult = 1;
|
|
1355
|
+
anyElse = value;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
else {
|
|
1359
|
+
matchResult = 1;
|
|
1360
|
+
anyElse = value;
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
else {
|
|
1364
|
+
matchResult = 1;
|
|
1365
|
+
anyElse = value;
|
|
1366
|
+
}
|
|
1367
|
+
break;
|
|
1368
|
+
}
|
|
1369
|
+
default: {
|
|
1370
|
+
matchResult = 1;
|
|
1371
|
+
anyElse = value;
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
switch (matchResult) {
|
|
1375
|
+
case 0:
|
|
1376
|
+
return map_1(decoder, v);
|
|
1377
|
+
default:
|
|
1378
|
+
throw new Error((toText(printf("%s: %A"))("Expected a list")(anyElse) + "\\nParameter name: ") + "value");
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
export function array(decoder, value) {
|
|
1383
|
+
let matchResult, v, anyElse;
|
|
1384
|
+
switch (value.tag) {
|
|
1385
|
+
case 2: {
|
|
1386
|
+
matchResult = 0;
|
|
1387
|
+
v = value.fields[0];
|
|
1388
|
+
break;
|
|
1389
|
+
}
|
|
1390
|
+
case 3: {
|
|
1391
|
+
if (!isEmpty(value.fields[0])) {
|
|
1392
|
+
if (head(value.fields[0]).tag === 2) {
|
|
1393
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
1394
|
+
matchResult = 0;
|
|
1395
|
+
v = head(value.fields[0]).fields[0];
|
|
1396
|
+
}
|
|
1397
|
+
else {
|
|
1398
|
+
matchResult = 1;
|
|
1399
|
+
anyElse = value;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
else {
|
|
1403
|
+
matchResult = 1;
|
|
1404
|
+
anyElse = value;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
else {
|
|
1408
|
+
matchResult = 1;
|
|
1409
|
+
anyElse = value;
|
|
1410
|
+
}
|
|
1411
|
+
break;
|
|
1412
|
+
}
|
|
1413
|
+
default: {
|
|
1414
|
+
matchResult = 1;
|
|
1415
|
+
anyElse = value;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
switch (matchResult) {
|
|
1419
|
+
case 0:
|
|
1420
|
+
return toArray(map_1(decoder, v));
|
|
1421
|
+
default:
|
|
1422
|
+
throw new Error((toText(printf("%s: %A"))("Expected an array")(anyElse) + "\\nParameter name: ") + "value");
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
export function seq(decoder, value) {
|
|
1427
|
+
let matchResult, v, anyElse;
|
|
1428
|
+
switch (value.tag) {
|
|
1429
|
+
case 2: {
|
|
1430
|
+
matchResult = 0;
|
|
1431
|
+
v = value.fields[0];
|
|
1432
|
+
break;
|
|
1433
|
+
}
|
|
1434
|
+
case 3: {
|
|
1435
|
+
if (!isEmpty(value.fields[0])) {
|
|
1436
|
+
if (head(value.fields[0]).tag === 2) {
|
|
1437
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
1438
|
+
matchResult = 0;
|
|
1439
|
+
v = head(value.fields[0]).fields[0];
|
|
1440
|
+
}
|
|
1441
|
+
else {
|
|
1442
|
+
matchResult = 1;
|
|
1443
|
+
anyElse = value;
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
else {
|
|
1447
|
+
matchResult = 1;
|
|
1448
|
+
anyElse = value;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
else {
|
|
1452
|
+
matchResult = 1;
|
|
1453
|
+
anyElse = value;
|
|
1454
|
+
}
|
|
1455
|
+
break;
|
|
1456
|
+
}
|
|
1457
|
+
default: {
|
|
1458
|
+
matchResult = 1;
|
|
1459
|
+
anyElse = value;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
switch (matchResult) {
|
|
1463
|
+
case 0:
|
|
1464
|
+
return map_2(decoder, v);
|
|
1465
|
+
default:
|
|
1466
|
+
throw new Error((toText(printf("%s: %A"))("Expected a seq")(anyElse) + "\\nParameter name: ") + "value");
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
export function resizearray(decoder, value) {
|
|
1471
|
+
let matchResult, v, anyElse;
|
|
1472
|
+
switch (value.tag) {
|
|
1473
|
+
case 2: {
|
|
1474
|
+
matchResult = 0;
|
|
1475
|
+
v = value.fields[0];
|
|
1476
|
+
break;
|
|
1477
|
+
}
|
|
1478
|
+
case 3: {
|
|
1479
|
+
if (!isEmpty(value.fields[0])) {
|
|
1480
|
+
if (head(value.fields[0]).tag === 2) {
|
|
1481
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
1482
|
+
matchResult = 0;
|
|
1483
|
+
v = head(value.fields[0]).fields[0];
|
|
1484
|
+
}
|
|
1485
|
+
else {
|
|
1486
|
+
matchResult = 1;
|
|
1487
|
+
anyElse = value;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
else {
|
|
1491
|
+
matchResult = 1;
|
|
1492
|
+
anyElse = value;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
else {
|
|
1496
|
+
matchResult = 1;
|
|
1497
|
+
anyElse = value;
|
|
1498
|
+
}
|
|
1499
|
+
break;
|
|
1500
|
+
}
|
|
1501
|
+
default: {
|
|
1502
|
+
matchResult = 1;
|
|
1503
|
+
anyElse = value;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
switch (matchResult) {
|
|
1507
|
+
case 0: {
|
|
1508
|
+
const collection = map_1(decoder, v);
|
|
1509
|
+
return Array.from(collection);
|
|
1510
|
+
}
|
|
1511
|
+
default:
|
|
1512
|
+
throw new Error((toText(printf("%s: %A"))("Expected a resizearray")(anyElse) + "\\nParameter name: ") + "value");
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
export function values(decoder, value) {
|
|
1517
|
+
let matchResult, v, anyElse_1;
|
|
1518
|
+
switch (value.tag) {
|
|
1519
|
+
case 2: {
|
|
1520
|
+
matchResult = 0;
|
|
1521
|
+
v = value.fields[0];
|
|
1522
|
+
break;
|
|
1523
|
+
}
|
|
1524
|
+
case 3: {
|
|
1525
|
+
if (!isEmpty(value.fields[0])) {
|
|
1526
|
+
if (head(value.fields[0]).tag === 2) {
|
|
1527
|
+
if (isEmpty(tail(value.fields[0]))) {
|
|
1528
|
+
matchResult = 0;
|
|
1529
|
+
v = head(value.fields[0]).fields[0];
|
|
1530
|
+
}
|
|
1531
|
+
else {
|
|
1532
|
+
matchResult = 0;
|
|
1533
|
+
v = value.fields[0];
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
else {
|
|
1537
|
+
matchResult = 0;
|
|
1538
|
+
v = value.fields[0];
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
else {
|
|
1542
|
+
matchResult = 0;
|
|
1543
|
+
v = value.fields[0];
|
|
1544
|
+
}
|
|
1545
|
+
break;
|
|
1546
|
+
}
|
|
1547
|
+
default: {
|
|
1548
|
+
matchResult = 1;
|
|
1549
|
+
anyElse_1 = value;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
switch (matchResult) {
|
|
1553
|
+
case 0:
|
|
1554
|
+
return map_1((_arg) => {
|
|
1555
|
+
if (_arg.tag === 1) {
|
|
1556
|
+
return decoder(_arg);
|
|
1557
|
+
}
|
|
1558
|
+
else {
|
|
1559
|
+
throw new Error((toText(printf("%s: %A"))("Expected a values")(_arg) + "\\nParameter name: ") + "value");
|
|
1560
|
+
}
|
|
1561
|
+
}, v);
|
|
1562
|
+
default:
|
|
1563
|
+
throw new Error((toText(printf("%s: %A"))("Expected a values")(anyElse_1) + "\\nParameter name: ") + "value");
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
export class Getter {
|
|
1568
|
+
constructor(ele) {
|
|
1569
|
+
let _this, _this_1, _this_2;
|
|
1570
|
+
this.required = ((_this = this, {
|
|
1571
|
+
Field(fieldName, dec) {
|
|
1572
|
+
let arg_3;
|
|
1573
|
+
if (ele.tag === 3) {
|
|
1574
|
+
const x = map_3((_arg_1) => {
|
|
1575
|
+
if (_arg_1.tag === 0) {
|
|
1576
|
+
return dec(_arg_1.fields[1]);
|
|
1577
|
+
}
|
|
1578
|
+
else {
|
|
1579
|
+
throw new Error((toText(printf("%s: %A"))("Expected a mapping")(ele) + "\\nParameter name: ") + "value");
|
|
1580
|
+
}
|
|
1581
|
+
}, tryFind((_arg) => {
|
|
1582
|
+
if (_arg.tag === 0) {
|
|
1583
|
+
return _arg.fields[0].Value === fieldName;
|
|
1584
|
+
}
|
|
1585
|
+
else {
|
|
1586
|
+
return false;
|
|
1587
|
+
}
|
|
1588
|
+
}, ele.fields[0]));
|
|
1589
|
+
if (x == null) {
|
|
1590
|
+
throw new Error((((arg_3 = toText(printf("Field not found: %s"))(fieldName), toText(printf("%s: %A"))(arg_3)(ele))) + "\\nParameter name: ") + "value");
|
|
1591
|
+
}
|
|
1592
|
+
else {
|
|
1593
|
+
return value_1(x);
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
else {
|
|
1597
|
+
throw new Error((toText(printf("%s: %A"))("Expected an object")(ele) + "\\nParameter name: ") + "value");
|
|
1598
|
+
}
|
|
1599
|
+
},
|
|
1600
|
+
}));
|
|
1601
|
+
this.optional = ((_this_1 = this, {
|
|
1602
|
+
Field(fieldName_1, dec_1) {
|
|
1603
|
+
if (ele.tag === 3) {
|
|
1604
|
+
return map_3((_arg_3) => {
|
|
1605
|
+
if (_arg_3.tag === 0) {
|
|
1606
|
+
return dec_1(_arg_3.fields[1]);
|
|
1607
|
+
}
|
|
1608
|
+
else {
|
|
1609
|
+
throw new Error((toText(printf("%s: %A"))("Expected a mapping")(ele) + "\\nParameter name: ") + "value");
|
|
1610
|
+
}
|
|
1611
|
+
}, tryFind((_arg_2) => {
|
|
1612
|
+
if (_arg_2.tag === 0) {
|
|
1613
|
+
return _arg_2.fields[0].Value === fieldName_1;
|
|
1614
|
+
}
|
|
1615
|
+
else {
|
|
1616
|
+
return false;
|
|
1617
|
+
}
|
|
1618
|
+
}, ele.fields[0]));
|
|
1619
|
+
}
|
|
1620
|
+
else {
|
|
1621
|
+
throw new Error((toText(printf("%s: %A"))("Expected an object")(ele) + "\\nParameter name: ") + "value");
|
|
1622
|
+
}
|
|
1623
|
+
},
|
|
1624
|
+
}));
|
|
1625
|
+
this.overflow = ((_this_2 = this, {
|
|
1626
|
+
FieldList(fieldNames) {
|
|
1627
|
+
if (ele.tag === 3) {
|
|
1628
|
+
const overflow = map_1((_arg_5) => {
|
|
1629
|
+
if (_arg_5.tag === 0) {
|
|
1630
|
+
return [_arg_5.fields[0].Value, _arg_5.fields[1]];
|
|
1631
|
+
}
|
|
1632
|
+
else {
|
|
1633
|
+
throw new Error((toText(printf("%s: %A"))("Expected a mapping")(ele) + "\\nParameter name: ") + "value");
|
|
1634
|
+
}
|
|
1635
|
+
}, filter((_arg_4) => {
|
|
1636
|
+
if (_arg_4.tag === 0) {
|
|
1637
|
+
return exists((x_1) => (x_1 === _arg_4.fields[0].Value), fieldNames);
|
|
1638
|
+
}
|
|
1639
|
+
else {
|
|
1640
|
+
return false;
|
|
1641
|
+
}
|
|
1642
|
+
}, ele.fields[0]));
|
|
1643
|
+
const dict_1 = new Map([]);
|
|
1644
|
+
iterate((tupledArg) => {
|
|
1645
|
+
addToDict(dict_1, tupledArg[0], tupledArg[1]);
|
|
1646
|
+
}, overflow);
|
|
1647
|
+
return dict_1;
|
|
1648
|
+
}
|
|
1649
|
+
else {
|
|
1650
|
+
throw new Error((toText(printf("%s: %A"))("Expected an object")(ele) + "\\nParameter name: ") + "value");
|
|
1651
|
+
}
|
|
1652
|
+
},
|
|
1653
|
+
}));
|
|
1654
|
+
}
|
|
1655
|
+
get Required() {
|
|
1656
|
+
const __ = this;
|
|
1657
|
+
return __.required;
|
|
1658
|
+
}
|
|
1659
|
+
get Optional() {
|
|
1660
|
+
const __ = this;
|
|
1661
|
+
return __.optional;
|
|
1662
|
+
}
|
|
1663
|
+
get Overflow() {
|
|
1664
|
+
const __ = this;
|
|
1665
|
+
return __.overflow;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
export function Getter_$reflection() {
|
|
1670
|
+
return class_type("YAMLicious.Decode.Getter", void 0, Getter);
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
export function Getter_$ctor_D9C929(ele) {
|
|
1674
|
+
return new Getter(ele);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
export function object(getter, value) {
|
|
1678
|
+
return getter(Getter_$ctor_D9C929(value));
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
export function read(yaml) {
|
|
1682
|
+
return read_1(yaml);
|
|
1683
|
+
}
|
|
1684
|
+
|