firefly-compiler 0.4.6 → 0.4.8

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.
Files changed (90) hide show
  1. package/compiler/Compiler.ff +2 -0
  2. package/compiler/Deriver.ff +7 -0
  3. package/core/Array.ff +17 -4
  4. package/core/AssetSystem.ff +1 -1
  5. package/core/BrowserSystem.ff +27 -0
  6. package/core/List.ff +4 -0
  7. package/core/Lock.ff +2 -2
  8. package/core/Random.ff +148 -0
  9. package/core/SourceLocation.ff +27 -0
  10. package/core/Task.ff +3 -0
  11. package/core/WebSocket.ff +127 -0
  12. package/httpserver/HttpServer.ff +1 -1
  13. package/lux/Css.ff +648 -0
  14. package/lux/CssTest.ff +48 -0
  15. package/lux/Lux.ff +33 -18
  16. package/lux/Main.ff +4 -1
  17. package/output/js/ff/compiler/Builder.mjs +448 -444
  18. package/output/js/ff/compiler/Compiler.mjs +420 -416
  19. package/output/js/ff/compiler/Dependencies.mjs +393 -389
  20. package/output/js/ff/compiler/Deriver.mjs +1178 -1170
  21. package/output/js/ff/compiler/Dictionaries.mjs +1315 -1309
  22. package/output/js/ff/compiler/Environment.mjs +1025 -1015
  23. package/output/js/ff/compiler/Inference.mjs +4272 -4268
  24. package/output/js/ff/compiler/JsEmitter.mjs +5405 -5391
  25. package/output/js/ff/compiler/JsImporter.mjs +270 -266
  26. package/output/js/ff/compiler/LspHook.mjs +799 -793
  27. package/output/js/ff/compiler/Main.mjs +1691 -1675
  28. package/output/js/ff/compiler/Parser.mjs +4016 -4008
  29. package/output/js/ff/compiler/Patterns.mjs +935 -927
  30. package/output/js/ff/compiler/Resolver.mjs +2311 -2307
  31. package/output/js/ff/compiler/Substitution.mjs +1154 -1150
  32. package/output/js/ff/compiler/Syntax.mjs +12566 -12434
  33. package/output/js/ff/compiler/Token.mjs +3152 -3096
  34. package/output/js/ff/compiler/Tokenizer.mjs +597 -593
  35. package/output/js/ff/compiler/Unification.mjs +1762 -1752
  36. package/output/js/ff/compiler/Wildcards.mjs +612 -608
  37. package/output/js/ff/compiler/Workspace.mjs +695 -687
  38. package/output/js/ff/core/Any.mjs +147 -143
  39. package/output/js/ff/core/Array.mjs +573 -547
  40. package/output/js/ff/core/AssetSystem.mjs +278 -274
  41. package/output/js/ff/core/Atomic.mjs +158 -154
  42. package/output/js/ff/core/Bool.mjs +156 -152
  43. package/output/js/ff/core/Box.mjs +116 -112
  44. package/output/js/ff/core/BrowserSystem.mjs +181 -126
  45. package/output/js/ff/core/Buffer.mjs +399 -395
  46. package/output/js/ff/core/BuildSystem.mjs +300 -296
  47. package/output/js/ff/core/Channel.mjs +193 -189
  48. package/output/js/ff/core/Char.mjs +153 -149
  49. package/output/js/ff/core/Core.mjs +304 -300
  50. package/output/js/ff/core/Duration.mjs +120 -116
  51. package/output/js/ff/core/Equal.mjs +183 -179
  52. package/output/js/ff/core/Error.mjs +146 -142
  53. package/output/js/ff/core/FileHandle.mjs +154 -150
  54. package/output/js/ff/core/Float.mjs +229 -225
  55. package/output/js/ff/core/HttpClient.mjs +195 -191
  56. package/output/js/ff/core/Instant.mjs +113 -109
  57. package/output/js/ff/core/Int.mjs +269 -265
  58. package/output/js/ff/core/IntMap.mjs +284 -280
  59. package/output/js/ff/core/JsSystem.mjs +242 -238
  60. package/output/js/ff/core/JsValue.mjs +712 -708
  61. package/output/js/ff/core/List.mjs +2346 -2334
  62. package/output/js/ff/core/Lock.mjs +235 -231
  63. package/output/js/ff/core/Log.mjs +167 -163
  64. package/output/js/ff/core/Map.mjs +366 -362
  65. package/output/js/ff/core/NodeSystem.mjs +298 -294
  66. package/output/js/ff/core/Nothing.mjs +108 -104
  67. package/output/js/ff/core/Option.mjs +1023 -1015
  68. package/output/js/ff/core/Ordering.mjs +734 -730
  69. package/output/js/ff/core/Pair.mjs +337 -331
  70. package/output/js/ff/core/Path.mjs +549 -545
  71. package/output/js/ff/core/Random.mjs +340 -0
  72. package/output/js/ff/core/RbMap.mjs +1944 -1940
  73. package/output/js/ff/core/Serializable.mjs +432 -428
  74. package/output/js/ff/core/Set.mjs +258 -254
  75. package/output/js/ff/core/Show.mjs +209 -205
  76. package/output/js/ff/core/SourceLocation.mjs +273 -229
  77. package/output/js/ff/core/Stack.mjs +533 -529
  78. package/output/js/ff/core/Stream.mjs +1308 -1304
  79. package/output/js/ff/core/String.mjs +369 -365
  80. package/output/js/ff/core/StringMap.mjs +284 -280
  81. package/output/js/ff/core/Task.mjs +325 -319
  82. package/output/js/ff/core/Try.mjs +511 -507
  83. package/output/js/ff/core/Unit.mjs +155 -151
  84. package/output/js/ff/core/WebSocket.mjs +198 -0
  85. package/package.json +1 -1
  86. package/vscode/package.json +1 -1
  87. package/webserver/.firefly/include/package-lock.json +16 -0
  88. package/webserver/.firefly/include/package.json +5 -0
  89. package/webserver/.firefly/package.ff +2 -0
  90. package/webserver/WebServer.ff +608 -0
@@ -1,507 +1,511 @@
1
-
2
-
3
- import * as ff_core_Any from "../../ff/core/Any.mjs"
4
-
5
- import * as ff_core_Array from "../../ff/core/Array.mjs"
6
-
7
- import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
8
-
9
- import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
10
-
11
- import * as ff_core_Bool from "../../ff/core/Bool.mjs"
12
-
13
- import * as ff_core_Box from "../../ff/core/Box.mjs"
14
-
15
- import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
16
-
17
- import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
18
-
19
- import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
20
-
21
- import * as ff_core_Channel from "../../ff/core/Channel.mjs"
22
-
23
- import * as ff_core_Char from "../../ff/core/Char.mjs"
24
-
25
- import * as ff_core_Core from "../../ff/core/Core.mjs"
26
-
27
- import * as ff_core_Duration from "../../ff/core/Duration.mjs"
28
-
29
- import * as ff_core_Equal from "../../ff/core/Equal.mjs"
30
-
31
- import * as ff_core_Error from "../../ff/core/Error.mjs"
32
-
33
- import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
34
-
35
- import * as ff_core_Float from "../../ff/core/Float.mjs"
36
-
37
- import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
38
-
39
- import * as ff_core_Instant from "../../ff/core/Instant.mjs"
40
-
41
- import * as ff_core_Int from "../../ff/core/Int.mjs"
42
-
43
- import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
44
-
45
- import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
-
47
- import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
-
49
- import * as ff_core_List from "../../ff/core/List.mjs"
50
-
51
- import * as ff_core_Lock from "../../ff/core/Lock.mjs"
52
-
53
- import * as ff_core_Log from "../../ff/core/Log.mjs"
54
-
55
- import * as ff_core_Map from "../../ff/core/Map.mjs"
56
-
57
- import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
58
-
59
- import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
60
-
61
- import * as ff_core_Option from "../../ff/core/Option.mjs"
62
-
63
- import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
64
-
65
- import * as ff_core_Pair from "../../ff/core/Pair.mjs"
66
-
67
- import * as ff_core_Path from "../../ff/core/Path.mjs"
68
-
69
- import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
70
-
71
- import * as ff_core_Set from "../../ff/core/Set.mjs"
72
-
73
- import * as ff_core_Show from "../../ff/core/Show.mjs"
74
-
75
- import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
76
-
77
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
78
-
79
- import * as ff_core_Stream from "../../ff/core/Stream.mjs"
80
-
81
- import * as ff_core_String from "../../ff/core/String.mjs"
82
-
83
- import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
84
-
85
- import * as ff_core_Task from "../../ff/core/Task.mjs"
86
-
87
- import * as ff_core_Try from "../../ff/core/Try.mjs"
88
-
89
- import * as ff_core_Unit from "../../ff/core/Unit.mjs"
90
-
91
- // type Try
92
- export function Success(value_) {
93
- return {Success: true, value_};
94
- }
95
- export function Failure(error_) {
96
- return {Failure: true, error_};
97
- }
98
-
99
-
100
-
101
- export function internalThrowGrabException_() {
102
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
103
- }
104
-
105
- export async function internalThrowGrabException_$($task) {
106
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
107
- }
108
-
109
- export function Try_map(self_, body_) {
110
- {
111
- const _1 = self_;
112
- {
113
- if(_1.Success) {
114
- const value_ = _1.value_;
115
- return ff_core_Core.try_((() => {
116
- return body_(value_)
117
- }))
118
- return
119
- }
120
- }
121
- {
122
- if(_1.Failure) {
123
- const error_ = _1.error_;
124
- return ff_core_Try.Failure(error_)
125
- return
126
- }
127
- }
128
- }
129
- }
130
-
131
- export function Try_flatMap(self_, body_) {
132
- return ff_core_Try.Try_flatten(ff_core_Try.Try_map(self_, body_))
133
- }
134
-
135
- export function Try_catch(self_, body_, ff_core_Any_HasAnyTag$E) {
136
- {
137
- const _1 = self_;
138
- {
139
- if(_1.Failure) {
140
- const error_ = _1.error_;
141
- const _guard1 = ff_core_Option.Option_flatMap(ff_core_Error.Error_exception(error_), ((any_) => {
142
- return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
143
- }));
144
- if(_guard1.Some) {
145
- const e_ = _guard1.value_;
146
- return ff_core_Core.try_((() => {
147
- return body_(e_, error_)
148
- }))
149
- return
150
- }
151
- }
152
- }
153
- {
154
- return self_
155
- return
156
- }
157
- }
158
- }
159
-
160
- export function Try_catchAny(self_, body_) {
161
- {
162
- const _1 = self_;
163
- {
164
- if(_1.Failure) {
165
- const error_ = _1.error_;
166
- return ff_core_Core.try_((() => {
167
- return body_(error_)
168
- }))
169
- return
170
- }
171
- }
172
- {
173
- return self_
174
- return
175
- }
176
- }
177
- }
178
-
179
- export function Try_finally(self_, body_) {
180
- {
181
- const _1 = self_;
182
- {
183
- if(_1.Success) {
184
- const value_ = _1.value_;
185
- return ff_core_Core.try_((() => {
186
- body_();
187
- return value_
188
- }))
189
- return
190
- }
191
- }
192
- {
193
- if(_1.Failure) {
194
- {
195
- const _1 = ff_core_Core.try_((() => {
196
- return body_()
197
- }));
198
- {
199
- if(_1.Success) {
200
- return self_
201
- return
202
- }
203
- }
204
- {
205
- if(_1.Failure) {
206
- const error_ = _1.error_;
207
- return ff_core_Try.Failure(error_)
208
- return
209
- }
210
- }
211
- }
212
- return
213
- }
214
- }
215
- }
216
- }
217
-
218
- export function Try_else(self_, body_) {
219
- {
220
- const _1 = self_;
221
- {
222
- if(_1.Success) {
223
- const value_ = _1.value_;
224
- return value_
225
- return
226
- }
227
- }
228
- {
229
- if(_1.Failure) {
230
- return body_()
231
- return
232
- }
233
- }
234
- }
235
- }
236
-
237
- export function Try_grab(self_) {
238
- {
239
- const _1 = self_;
240
- {
241
- if(_1.Success) {
242
- const value_ = _1.value_;
243
- return value_
244
- return
245
- }
246
- }
247
- {
248
- if(_1.Failure) {
249
- const error_ = _1.error_;
250
- return ff_core_Error.Error_rethrow(error_)
251
- return
252
- }
253
- }
254
- }
255
- }
256
-
257
- export function Try_toOption(self_) {
258
- {
259
- const _1 = self_;
260
- {
261
- if(_1.Success) {
262
- const value_ = _1.value_;
263
- return ff_core_Option.Some(value_)
264
- return
265
- }
266
- }
267
- {
268
- if(_1.Failure) {
269
- return ff_core_Option.None()
270
- return
271
- }
272
- }
273
- }
274
- }
275
-
276
- export async function Try_map$(self_, body_, $task) {
277
- {
278
- const _1 = self_;
279
- {
280
- if(_1.Success) {
281
- const value_ = _1.value_;
282
- return (await ff_core_Core.try_$((async ($task) => {
283
- return (await body_(value_, $task))
284
- }), $task))
285
- return
286
- }
287
- }
288
- {
289
- if(_1.Failure) {
290
- const error_ = _1.error_;
291
- return ff_core_Try.Failure(error_)
292
- return
293
- }
294
- }
295
- }
296
- }
297
-
298
- export async function Try_flatMap$(self_, body_, $task) {
299
- return ff_core_Try.Try_flatten((await ff_core_Try.Try_map$(self_, body_, $task)))
300
- }
301
-
302
- export async function Try_catch$(self_, body_, ff_core_Any_HasAnyTag$E, $task) {
303
- {
304
- const _1 = self_;
305
- {
306
- if(_1.Failure) {
307
- const error_ = _1.error_;
308
- const _guard1 = ff_core_Option.Option_flatMap(ff_core_Error.Error_exception(error_), ((any_) => {
309
- return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
310
- }));
311
- if(_guard1.Some) {
312
- const e_ = _guard1.value_;
313
- return (await ff_core_Core.try_$((async ($task) => {
314
- return (await body_(e_, error_, $task))
315
- }), $task))
316
- return
317
- }
318
- }
319
- }
320
- {
321
- return self_
322
- return
323
- }
324
- }
325
- }
326
-
327
- export async function Try_catchAny$(self_, body_, $task) {
328
- {
329
- const _1 = self_;
330
- {
331
- if(_1.Failure) {
332
- const error_ = _1.error_;
333
- return (await ff_core_Core.try_$((async ($task) => {
334
- return (await body_(error_, $task))
335
- }), $task))
336
- return
337
- }
338
- }
339
- {
340
- return self_
341
- return
342
- }
343
- }
344
- }
345
-
346
- export async function Try_finally$(self_, body_, $task) {
347
- {
348
- const _1 = self_;
349
- {
350
- if(_1.Success) {
351
- const value_ = _1.value_;
352
- return (await ff_core_Core.try_$((async ($task) => {
353
- (await body_($task));
354
- return value_
355
- }), $task))
356
- return
357
- }
358
- }
359
- {
360
- if(_1.Failure) {
361
- {
362
- const _1 = (await ff_core_Core.try_$((async ($task) => {
363
- return (await body_($task))
364
- }), $task));
365
- {
366
- if(_1.Success) {
367
- return self_
368
- return
369
- }
370
- }
371
- {
372
- if(_1.Failure) {
373
- const error_ = _1.error_;
374
- return ff_core_Try.Failure(error_)
375
- return
376
- }
377
- }
378
- }
379
- return
380
- }
381
- }
382
- }
383
- }
384
-
385
- export async function Try_else$(self_, body_, $task) {
386
- {
387
- const _1 = self_;
388
- {
389
- if(_1.Success) {
390
- const value_ = _1.value_;
391
- return value_
392
- return
393
- }
394
- }
395
- {
396
- if(_1.Failure) {
397
- return (await body_($task))
398
- return
399
- }
400
- }
401
- }
402
- }
403
-
404
- export async function Try_grab$(self_, $task) {
405
- {
406
- const _1 = self_;
407
- {
408
- if(_1.Success) {
409
- const value_ = _1.value_;
410
- return value_
411
- return
412
- }
413
- }
414
- {
415
- if(_1.Failure) {
416
- const error_ = _1.error_;
417
- return ff_core_Error.Error_rethrow(error_)
418
- return
419
- }
420
- }
421
- }
422
- }
423
-
424
- export async function Try_toOption$(self_, $task) {
425
- {
426
- const _1 = self_;
427
- {
428
- if(_1.Success) {
429
- const value_ = _1.value_;
430
- return ff_core_Option.Some(value_)
431
- return
432
- }
433
- }
434
- {
435
- if(_1.Failure) {
436
- return ff_core_Option.None()
437
- return
438
- }
439
- }
440
- }
441
- }
442
-
443
- export function Try_flatten(self_) {
444
- {
445
- const _1 = self_;
446
- {
447
- if(_1.Success) {
448
- const t_ = _1.value_;
449
- if(_1.value_.Success) {
450
- return t_
451
- return
452
- }
453
- }
454
- }
455
- {
456
- if(_1.Success) {
457
- const t_ = _1.value_;
458
- if(_1.value_.Failure) {
459
- return t_
460
- return
461
- }
462
- }
463
- }
464
- {
465
- if(_1.Failure) {
466
- const error_ = _1.error_;
467
- return ff_core_Try.Failure(error_)
468
- return
469
- }
470
- }
471
- }
472
- }
473
-
474
- export async function Try_flatten$(self_, $task) {
475
- {
476
- const _1 = self_;
477
- {
478
- if(_1.Success) {
479
- const t_ = _1.value_;
480
- if(_1.value_.Success) {
481
- return t_
482
- return
483
- }
484
- }
485
- }
486
- {
487
- if(_1.Success) {
488
- const t_ = _1.value_;
489
- if(_1.value_.Failure) {
490
- return t_
491
- return
492
- }
493
- }
494
- }
495
- {
496
- if(_1.Failure) {
497
- const error_ = _1.error_;
498
- return ff_core_Try.Failure(error_)
499
- return
500
- }
501
- }
502
- }
503
- }
504
-
505
-
506
-
507
-
1
+
2
+
3
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
4
+
5
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
6
+
7
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
8
+
9
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
10
+
11
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
12
+
13
+ import * as ff_core_Box from "../../ff/core/Box.mjs"
14
+
15
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
16
+
17
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
18
+
19
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
20
+
21
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
22
+
23
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
24
+
25
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
26
+
27
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
28
+
29
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
30
+
31
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
32
+
33
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
34
+
35
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
36
+
37
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
38
+
39
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
40
+
41
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
42
+
43
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
44
+
45
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
+
47
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
+
49
+ import * as ff_core_List from "../../ff/core/List.mjs"
50
+
51
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
52
+
53
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
54
+
55
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
56
+
57
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
58
+
59
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
60
+
61
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
62
+
63
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
64
+
65
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
66
+
67
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
68
+
69
+ import * as ff_core_Random from "../../ff/core/Random.mjs"
70
+
71
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
72
+
73
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
74
+
75
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
76
+
77
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
78
+
79
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
80
+
81
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
82
+
83
+ import * as ff_core_String from "../../ff/core/String.mjs"
84
+
85
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
86
+
87
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
88
+
89
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
90
+
91
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
92
+
93
+ import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
94
+
95
+ // type Try
96
+ export function Success(value_) {
97
+ return {Success: true, value_};
98
+ }
99
+ export function Failure(error_) {
100
+ return {Failure: true, error_};
101
+ }
102
+
103
+
104
+
105
+ export function internalThrowGrabException_() {
106
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
107
+ }
108
+
109
+ export async function internalThrowGrabException_$($task) {
110
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.GrabException(), ff_core_Core.ff_core_Any_HasAnyTag$ff_core_Core_GrabException)})
111
+ }
112
+
113
+ export function Try_map(self_, body_) {
114
+ {
115
+ const _1 = self_;
116
+ {
117
+ if(_1.Success) {
118
+ const value_ = _1.value_;
119
+ return ff_core_Core.try_((() => {
120
+ return body_(value_)
121
+ }))
122
+ return
123
+ }
124
+ }
125
+ {
126
+ if(_1.Failure) {
127
+ const error_ = _1.error_;
128
+ return ff_core_Try.Failure(error_)
129
+ return
130
+ }
131
+ }
132
+ }
133
+ }
134
+
135
+ export function Try_flatMap(self_, body_) {
136
+ return ff_core_Try.Try_flatten(ff_core_Try.Try_map(self_, body_))
137
+ }
138
+
139
+ export function Try_catch(self_, body_, ff_core_Any_HasAnyTag$E) {
140
+ {
141
+ const _1 = self_;
142
+ {
143
+ if(_1.Failure) {
144
+ const error_ = _1.error_;
145
+ const _guard1 = ff_core_Option.Option_flatMap(ff_core_Error.Error_exception(error_), ((any_) => {
146
+ return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
147
+ }));
148
+ if(_guard1.Some) {
149
+ const e_ = _guard1.value_;
150
+ return ff_core_Core.try_((() => {
151
+ return body_(e_, error_)
152
+ }))
153
+ return
154
+ }
155
+ }
156
+ }
157
+ {
158
+ return self_
159
+ return
160
+ }
161
+ }
162
+ }
163
+
164
+ export function Try_catchAny(self_, body_) {
165
+ {
166
+ const _1 = self_;
167
+ {
168
+ if(_1.Failure) {
169
+ const error_ = _1.error_;
170
+ return ff_core_Core.try_((() => {
171
+ return body_(error_)
172
+ }))
173
+ return
174
+ }
175
+ }
176
+ {
177
+ return self_
178
+ return
179
+ }
180
+ }
181
+ }
182
+
183
+ export function Try_finally(self_, body_) {
184
+ {
185
+ const _1 = self_;
186
+ {
187
+ if(_1.Success) {
188
+ const value_ = _1.value_;
189
+ return ff_core_Core.try_((() => {
190
+ body_();
191
+ return value_
192
+ }))
193
+ return
194
+ }
195
+ }
196
+ {
197
+ if(_1.Failure) {
198
+ {
199
+ const _1 = ff_core_Core.try_((() => {
200
+ return body_()
201
+ }));
202
+ {
203
+ if(_1.Success) {
204
+ return self_
205
+ return
206
+ }
207
+ }
208
+ {
209
+ if(_1.Failure) {
210
+ const error_ = _1.error_;
211
+ return ff_core_Try.Failure(error_)
212
+ return
213
+ }
214
+ }
215
+ }
216
+ return
217
+ }
218
+ }
219
+ }
220
+ }
221
+
222
+ export function Try_else(self_, body_) {
223
+ {
224
+ const _1 = self_;
225
+ {
226
+ if(_1.Success) {
227
+ const value_ = _1.value_;
228
+ return value_
229
+ return
230
+ }
231
+ }
232
+ {
233
+ if(_1.Failure) {
234
+ return body_()
235
+ return
236
+ }
237
+ }
238
+ }
239
+ }
240
+
241
+ export function Try_grab(self_) {
242
+ {
243
+ const _1 = self_;
244
+ {
245
+ if(_1.Success) {
246
+ const value_ = _1.value_;
247
+ return value_
248
+ return
249
+ }
250
+ }
251
+ {
252
+ if(_1.Failure) {
253
+ const error_ = _1.error_;
254
+ return ff_core_Error.Error_rethrow(error_)
255
+ return
256
+ }
257
+ }
258
+ }
259
+ }
260
+
261
+ export function Try_toOption(self_) {
262
+ {
263
+ const _1 = self_;
264
+ {
265
+ if(_1.Success) {
266
+ const value_ = _1.value_;
267
+ return ff_core_Option.Some(value_)
268
+ return
269
+ }
270
+ }
271
+ {
272
+ if(_1.Failure) {
273
+ return ff_core_Option.None()
274
+ return
275
+ }
276
+ }
277
+ }
278
+ }
279
+
280
+ export async function Try_map$(self_, body_, $task) {
281
+ {
282
+ const _1 = self_;
283
+ {
284
+ if(_1.Success) {
285
+ const value_ = _1.value_;
286
+ return (await ff_core_Core.try_$((async ($task) => {
287
+ return (await body_(value_, $task))
288
+ }), $task))
289
+ return
290
+ }
291
+ }
292
+ {
293
+ if(_1.Failure) {
294
+ const error_ = _1.error_;
295
+ return ff_core_Try.Failure(error_)
296
+ return
297
+ }
298
+ }
299
+ }
300
+ }
301
+
302
+ export async function Try_flatMap$(self_, body_, $task) {
303
+ return ff_core_Try.Try_flatten((await ff_core_Try.Try_map$(self_, body_, $task)))
304
+ }
305
+
306
+ export async function Try_catch$(self_, body_, ff_core_Any_HasAnyTag$E, $task) {
307
+ {
308
+ const _1 = self_;
309
+ {
310
+ if(_1.Failure) {
311
+ const error_ = _1.error_;
312
+ const _guard1 = ff_core_Option.Option_flatMap(ff_core_Error.Error_exception(error_), ((any_) => {
313
+ return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
314
+ }));
315
+ if(_guard1.Some) {
316
+ const e_ = _guard1.value_;
317
+ return (await ff_core_Core.try_$((async ($task) => {
318
+ return (await body_(e_, error_, $task))
319
+ }), $task))
320
+ return
321
+ }
322
+ }
323
+ }
324
+ {
325
+ return self_
326
+ return
327
+ }
328
+ }
329
+ }
330
+
331
+ export async function Try_catchAny$(self_, body_, $task) {
332
+ {
333
+ const _1 = self_;
334
+ {
335
+ if(_1.Failure) {
336
+ const error_ = _1.error_;
337
+ return (await ff_core_Core.try_$((async ($task) => {
338
+ return (await body_(error_, $task))
339
+ }), $task))
340
+ return
341
+ }
342
+ }
343
+ {
344
+ return self_
345
+ return
346
+ }
347
+ }
348
+ }
349
+
350
+ export async function Try_finally$(self_, body_, $task) {
351
+ {
352
+ const _1 = self_;
353
+ {
354
+ if(_1.Success) {
355
+ const value_ = _1.value_;
356
+ return (await ff_core_Core.try_$((async ($task) => {
357
+ (await body_($task));
358
+ return value_
359
+ }), $task))
360
+ return
361
+ }
362
+ }
363
+ {
364
+ if(_1.Failure) {
365
+ {
366
+ const _1 = (await ff_core_Core.try_$((async ($task) => {
367
+ return (await body_($task))
368
+ }), $task));
369
+ {
370
+ if(_1.Success) {
371
+ return self_
372
+ return
373
+ }
374
+ }
375
+ {
376
+ if(_1.Failure) {
377
+ const error_ = _1.error_;
378
+ return ff_core_Try.Failure(error_)
379
+ return
380
+ }
381
+ }
382
+ }
383
+ return
384
+ }
385
+ }
386
+ }
387
+ }
388
+
389
+ export async function Try_else$(self_, body_, $task) {
390
+ {
391
+ const _1 = self_;
392
+ {
393
+ if(_1.Success) {
394
+ const value_ = _1.value_;
395
+ return value_
396
+ return
397
+ }
398
+ }
399
+ {
400
+ if(_1.Failure) {
401
+ return (await body_($task))
402
+ return
403
+ }
404
+ }
405
+ }
406
+ }
407
+
408
+ export async function Try_grab$(self_, $task) {
409
+ {
410
+ const _1 = self_;
411
+ {
412
+ if(_1.Success) {
413
+ const value_ = _1.value_;
414
+ return value_
415
+ return
416
+ }
417
+ }
418
+ {
419
+ if(_1.Failure) {
420
+ const error_ = _1.error_;
421
+ return ff_core_Error.Error_rethrow(error_)
422
+ return
423
+ }
424
+ }
425
+ }
426
+ }
427
+
428
+ export async function Try_toOption$(self_, $task) {
429
+ {
430
+ const _1 = self_;
431
+ {
432
+ if(_1.Success) {
433
+ const value_ = _1.value_;
434
+ return ff_core_Option.Some(value_)
435
+ return
436
+ }
437
+ }
438
+ {
439
+ if(_1.Failure) {
440
+ return ff_core_Option.None()
441
+ return
442
+ }
443
+ }
444
+ }
445
+ }
446
+
447
+ export function Try_flatten(self_) {
448
+ {
449
+ const _1 = self_;
450
+ {
451
+ if(_1.Success) {
452
+ const t_ = _1.value_;
453
+ if(_1.value_.Success) {
454
+ return t_
455
+ return
456
+ }
457
+ }
458
+ }
459
+ {
460
+ if(_1.Success) {
461
+ const t_ = _1.value_;
462
+ if(_1.value_.Failure) {
463
+ return t_
464
+ return
465
+ }
466
+ }
467
+ }
468
+ {
469
+ if(_1.Failure) {
470
+ const error_ = _1.error_;
471
+ return ff_core_Try.Failure(error_)
472
+ return
473
+ }
474
+ }
475
+ }
476
+ }
477
+
478
+ export async function Try_flatten$(self_, $task) {
479
+ {
480
+ const _1 = self_;
481
+ {
482
+ if(_1.Success) {
483
+ const t_ = _1.value_;
484
+ if(_1.value_.Success) {
485
+ return t_
486
+ return
487
+ }
488
+ }
489
+ }
490
+ {
491
+ if(_1.Success) {
492
+ const t_ = _1.value_;
493
+ if(_1.value_.Failure) {
494
+ return t_
495
+ return
496
+ }
497
+ }
498
+ }
499
+ {
500
+ if(_1.Failure) {
501
+ const error_ = _1.error_;
502
+ return ff_core_Try.Failure(error_)
503
+ return
504
+ }
505
+ }
506
+ }
507
+ }
508
+
509
+
510
+
511
+