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,1015 +1,1025 @@
1
-
2
-
3
- import * as ff_compiler_Environment from "../../ff/compiler/Environment.mjs"
4
-
5
- import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
6
-
7
- import * as ff_core_Any from "../../ff/core/Any.mjs"
8
-
9
- import * as ff_core_Array from "../../ff/core/Array.mjs"
10
-
11
- import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
12
-
13
- import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
14
-
15
- import * as ff_core_Bool from "../../ff/core/Bool.mjs"
16
-
17
- import * as ff_core_Box from "../../ff/core/Box.mjs"
18
-
19
- import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
20
-
21
- import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
22
-
23
- import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
24
-
25
- import * as ff_core_Channel from "../../ff/core/Channel.mjs"
26
-
27
- import * as ff_core_Char from "../../ff/core/Char.mjs"
28
-
29
- import * as ff_core_Core from "../../ff/core/Core.mjs"
30
-
31
- import * as ff_core_Duration from "../../ff/core/Duration.mjs"
32
-
33
- import * as ff_core_Equal from "../../ff/core/Equal.mjs"
34
-
35
- import * as ff_core_Error from "../../ff/core/Error.mjs"
36
-
37
- import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
38
-
39
- import * as ff_core_Float from "../../ff/core/Float.mjs"
40
-
41
- import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
42
-
43
- import * as ff_core_Instant from "../../ff/core/Instant.mjs"
44
-
45
- import * as ff_core_Int from "../../ff/core/Int.mjs"
46
-
47
- import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
48
-
49
- import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
-
51
- import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
-
53
- import * as ff_core_List from "../../ff/core/List.mjs"
54
-
55
- import * as ff_core_Lock from "../../ff/core/Lock.mjs"
56
-
57
- import * as ff_core_Log from "../../ff/core/Log.mjs"
58
-
59
- import * as ff_core_Map from "../../ff/core/Map.mjs"
60
-
61
- import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
62
-
63
- import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
64
-
65
- import * as ff_core_Option from "../../ff/core/Option.mjs"
66
-
67
- import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
68
-
69
- import * as ff_core_Pair from "../../ff/core/Pair.mjs"
70
-
71
- import * as ff_core_Path from "../../ff/core/Path.mjs"
72
-
73
- import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
74
-
75
- import * as ff_core_Set from "../../ff/core/Set.mjs"
76
-
77
- import * as ff_core_Show from "../../ff/core/Show.mjs"
78
-
79
- import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
-
81
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
-
83
- import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
-
85
- import * as ff_core_String from "../../ff/core/String.mjs"
86
-
87
- import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
88
-
89
- import * as ff_core_Task from "../../ff/core/Task.mjs"
90
-
91
- import * as ff_core_Try from "../../ff/core/Try.mjs"
92
-
93
- import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
-
95
- // type Environment
96
- export function Environment(modulePrefix_, symbols_, traits_, imports_, effect_, selfVariable_) {
97
- return {modulePrefix_, symbols_, traits_, imports_, effect_, selfVariable_};
98
- }
99
-
100
- // type Scheme
101
- export function Scheme(isVariable_, isMutable_, isNewtype_, isTraitMethod_, signature_) {
102
- return {isVariable_, isMutable_, isNewtype_, isTraitMethod_, signature_};
103
- }
104
-
105
- // type Instantiated
106
- export function Instantiated(typeArguments_, scheme_) {
107
- return {typeArguments_, scheme_};
108
- }
109
-
110
-
111
-
112
- export function make_(module_, otherModules_, alreadyFlat_) {
113
- const processed_ = ff_compiler_Environment.processModule_(module_, true, alreadyFlat_);
114
- const otherProcessed_ = ff_core_List.List_map(otherModules_, ((_w1) => {
115
- return ff_compiler_Environment.processModule_(_w1, false, false)
116
- }));
117
- return ff_compiler_Environment.Environment(ff_compiler_Environment.fullName_(module_, ""), ff_core_Map.Map_addAll(processed_.symbols_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
118
- return _w1.symbols_
119
- })), ff_core_Map.empty_(), ((_w1, _w2) => {
120
- return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
121
- })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(processed_.traits_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
122
- return _w1.traits_
123
- })), ff_core_Map.empty_(), ((_w1, _w2) => {
124
- return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
125
- })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.List_map(module_.imports_, ((i_) => {
126
- return ff_core_Pair.Pair(i_.alias_, i_)
127
- })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty()), ff_core_Option.None())
128
- }
129
-
130
- export function fullName_(module_, name_) {
131
- return ((((ff_compiler_Syntax.PackagePair_groupName(module_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(module_.file_, 3)) + ".") + name_)
132
- }
133
-
134
- export function fail_(at_, message_) {
135
- return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
136
- }
137
-
138
- export function processModule_(module_, isCurrentModule_, alreadyFlat_) {
139
- const functions_ = ff_core_List.List_map(module_.functions_, ((d_) => {
140
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, d_.signature_))
141
- }));
142
- const lets_ = ff_core_List.List_map(module_.lets_, ((d_) => {
143
- const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
144
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), ff_compiler_Environment.Scheme(true, false, false, false, ff_compiler_Syntax.Signature(d_.at_, d_.name_, false, ff_core_List.Empty(), ff_core_List.Empty(), ff_core_List.Empty(), d_.variableType_, noEffect_)))
145
- }));
146
- const traitMethods_ = ff_core_List.List_flatMap(module_.traits_, ((definition_) => {
147
- const generics_ = ff_core_List.List_map(definition_.generics_, ((name_) => {
148
- return ff_compiler_Syntax.TConstructor(definition_.at_, name_, ff_core_List.Empty())
149
- }));
150
- const constraint_ = ff_compiler_Syntax.Constraint(definition_.at_, ff_compiler_Environment.fullName_(module_, definition_.name_), generics_);
151
- const outerConstraints_ = (alreadyFlat_
152
- ? ff_core_List.Empty()
153
- : definition_.constraints_);
154
- return ff_core_List.List_map(definition_.methods_, ((methodSignature_) => {
155
- const generics_ = ff_core_List.List_partition(ff_core_List.List_addAll(definition_.generics_, methodSignature_.generics_), ((_w1) => {
156
- return (_w1 === "Q$")
157
- }));
158
- const signature_ = (((_c) => {
159
- return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(ff_core_List.List_takeFirst(generics_.first_, 1), generics_.second_), ff_core_List.Link(constraint_, ff_core_List.List_addAll(outerConstraints_, methodSignature_.constraints_)), _c.parameters_, _c.returnType_, _c.effect_)
160
- }))(methodSignature_);
161
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, signature_.name_), ff_compiler_Environment.Scheme(false, false, false, true, signature_))
162
- }))
163
- }));
164
- const extends_ = ff_core_List.List_flatMap(module_.extends_, ((d_) => {
165
- {
166
- const _1 = d_.type_;
167
- {
168
- if(_1.TVariable) {
169
- const t_ = _1;
170
- return ff_compiler_Environment.fail_(t_.at_, ("Unexpected type variable: $" + t_.index_))
171
- return
172
- }
173
- }
174
- {
175
- if(_1.TConstructor) {
176
- const t_ = _1;
177
- const prefix_ = (t_.name_ + "_");
178
- const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, d_.type_, ff_core_Option.None());
179
- return ff_core_List.List_map(d_.methods_, ((method_) => {
180
- const effect_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
181
- return (_w1 === "Q$")
182
- }));
183
- const normalGenerics_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
184
- return (_w1 !== "Q$")
185
- }));
186
- const outerGenerics_ = (alreadyFlat_
187
- ? ff_core_List.Empty()
188
- : d_.generics_);
189
- const outerConstraints_ = (alreadyFlat_
190
- ? ff_core_List.Empty()
191
- : d_.constraints_);
192
- return ff_core_Pair.Pair((prefix_ + method_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, (((_c) => {
193
- return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(outerConstraints_, method_.signature_.constraints_), ff_core_List.Link(selfParameter_, method_.signature_.parameters_), _c.returnType_, _c.effect_)
194
- }))(method_.signature_)))
195
- }))
196
- return
197
- }
198
- }
199
- }
200
- }));
201
- const fields_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
202
- const prefix_ = (d_.name_ + "_");
203
- const t_ = ff_compiler_Syntax.TConstructor(d_.at_, d_.name_, ff_core_List.List_map(d_.generics_, ((g_) => {
204
- return ff_compiler_Syntax.TConstructor(d_.at_, g_, ff_core_List.Empty())
205
- })));
206
- const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, t_, ff_core_Option.None());
207
- return ff_core_List.List_map(d_.commonFields_, ((f_) => {
208
- const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
209
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, (prefix_ + f_.name_)), ff_compiler_Environment.Scheme(true, f_.mutable_, d_.newtype_, false, ff_compiler_Syntax.Signature(f_.at_, f_.name_, true, d_.generics_, d_.constraints_, ff_core_List.Link(selfParameter_, ff_core_List.Empty()), f_.valueType_, noEffect_)))
210
- }))
211
- }));
212
- const variants_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
213
- const returnType_ = ff_compiler_Syntax.TConstructor(d_.at_, ff_compiler_Environment.fullName_(module_, d_.name_), ff_core_List.List_map(d_.generics_, ((typeParameter_) => {
214
- return ff_compiler_Syntax.TConstructor(d_.at_, typeParameter_, ff_core_List.Empty())
215
- })));
216
- return ff_core_List.List_map(d_.variants_, ((variant_) => {
217
- const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
218
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, variant_.name_), ff_compiler_Environment.Scheme(false, false, d_.newtype_, false, ff_compiler_Syntax.Signature(variant_.at_, variant_.name_, false, d_.generics_, d_.constraints_, ff_core_List.List_addAll(d_.commonFields_, variant_.fields_), returnType_, noEffect_)))
219
- }))
220
- }));
221
- const traits_ = ff_core_List.List_map(module_.traits_, ((d_) => {
222
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), d_)
223
- }));
224
- const effect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty());
225
- return ff_compiler_Environment.Environment("", ff_core_List.List_toMap(ff_core_List.List_addAll(functions_, ff_core_List.List_addAll(lets_, ff_core_List.List_addAll(fields_, ff_core_List.List_addAll(extends_, ff_core_List.List_addAll(variants_, traitMethods_))))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), effect_, ff_core_Option.None())
226
- }
227
-
228
- export async function make_$(module_, otherModules_, alreadyFlat_, $task) {
229
- const processed_ = ff_compiler_Environment.processModule_(module_, true, alreadyFlat_);
230
- const otherProcessed_ = ff_core_List.List_map(otherModules_, ((_w1) => {
231
- return ff_compiler_Environment.processModule_(_w1, false, false)
232
- }));
233
- return ff_compiler_Environment.Environment(ff_compiler_Environment.fullName_(module_, ""), ff_core_Map.Map_addAll(processed_.symbols_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
234
- return _w1.symbols_
235
- })), ff_core_Map.empty_(), ((_w1, _w2) => {
236
- return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
237
- })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(processed_.traits_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
238
- return _w1.traits_
239
- })), ff_core_Map.empty_(), ((_w1, _w2) => {
240
- return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
241
- })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.List_map(module_.imports_, ((i_) => {
242
- return ff_core_Pair.Pair(i_.alias_, i_)
243
- })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty()), ff_core_Option.None())
244
- }
245
-
246
- export async function fullName_$(module_, name_, $task) {
247
- return ((((ff_compiler_Syntax.PackagePair_groupName(module_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(module_.file_, 3)) + ".") + name_)
248
- }
249
-
250
- export async function fail_$(at_, message_, $task) {
251
- return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
252
- }
253
-
254
- export async function processModule_$(module_, isCurrentModule_, alreadyFlat_, $task) {
255
- const functions_ = ff_core_List.List_map(module_.functions_, ((d_) => {
256
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, d_.signature_))
257
- }));
258
- const lets_ = ff_core_List.List_map(module_.lets_, ((d_) => {
259
- const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
260
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), ff_compiler_Environment.Scheme(true, false, false, false, ff_compiler_Syntax.Signature(d_.at_, d_.name_, false, ff_core_List.Empty(), ff_core_List.Empty(), ff_core_List.Empty(), d_.variableType_, noEffect_)))
261
- }));
262
- const traitMethods_ = ff_core_List.List_flatMap(module_.traits_, ((definition_) => {
263
- const generics_ = ff_core_List.List_map(definition_.generics_, ((name_) => {
264
- return ff_compiler_Syntax.TConstructor(definition_.at_, name_, ff_core_List.Empty())
265
- }));
266
- const constraint_ = ff_compiler_Syntax.Constraint(definition_.at_, ff_compiler_Environment.fullName_(module_, definition_.name_), generics_);
267
- const outerConstraints_ = (alreadyFlat_
268
- ? ff_core_List.Empty()
269
- : definition_.constraints_);
270
- return ff_core_List.List_map(definition_.methods_, ((methodSignature_) => {
271
- const generics_ = ff_core_List.List_partition(ff_core_List.List_addAll(definition_.generics_, methodSignature_.generics_), ((_w1) => {
272
- return (_w1 === "Q$")
273
- }));
274
- const signature_ = (((_c) => {
275
- return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(ff_core_List.List_takeFirst(generics_.first_, 1), generics_.second_), ff_core_List.Link(constraint_, ff_core_List.List_addAll(outerConstraints_, methodSignature_.constraints_)), _c.parameters_, _c.returnType_, _c.effect_)
276
- }))(methodSignature_);
277
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, signature_.name_), ff_compiler_Environment.Scheme(false, false, false, true, signature_))
278
- }))
279
- }));
280
- const extends_ = ff_core_List.List_flatMap(module_.extends_, ((d_) => {
281
- {
282
- const _1 = d_.type_;
283
- {
284
- if(_1.TVariable) {
285
- const t_ = _1;
286
- return ff_compiler_Environment.fail_(t_.at_, ("Unexpected type variable: $" + t_.index_))
287
- return
288
- }
289
- }
290
- {
291
- if(_1.TConstructor) {
292
- const t_ = _1;
293
- const prefix_ = (t_.name_ + "_");
294
- const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, d_.type_, ff_core_Option.None());
295
- return ff_core_List.List_map(d_.methods_, ((method_) => {
296
- const effect_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
297
- return (_w1 === "Q$")
298
- }));
299
- const normalGenerics_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
300
- return (_w1 !== "Q$")
301
- }));
302
- const outerGenerics_ = (alreadyFlat_
303
- ? ff_core_List.Empty()
304
- : d_.generics_);
305
- const outerConstraints_ = (alreadyFlat_
306
- ? ff_core_List.Empty()
307
- : d_.constraints_);
308
- return ff_core_Pair.Pair((prefix_ + method_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, (((_c) => {
309
- return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(outerConstraints_, method_.signature_.constraints_), ff_core_List.Link(selfParameter_, method_.signature_.parameters_), _c.returnType_, _c.effect_)
310
- }))(method_.signature_)))
311
- }))
312
- return
313
- }
314
- }
315
- }
316
- }));
317
- const fields_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
318
- const prefix_ = (d_.name_ + "_");
319
- const t_ = ff_compiler_Syntax.TConstructor(d_.at_, d_.name_, ff_core_List.List_map(d_.generics_, ((g_) => {
320
- return ff_compiler_Syntax.TConstructor(d_.at_, g_, ff_core_List.Empty())
321
- })));
322
- const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, t_, ff_core_Option.None());
323
- return ff_core_List.List_map(d_.commonFields_, ((f_) => {
324
- const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
325
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, (prefix_ + f_.name_)), ff_compiler_Environment.Scheme(true, f_.mutable_, d_.newtype_, false, ff_compiler_Syntax.Signature(f_.at_, f_.name_, true, d_.generics_, d_.constraints_, ff_core_List.Link(selfParameter_, ff_core_List.Empty()), f_.valueType_, noEffect_)))
326
- }))
327
- }));
328
- const variants_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
329
- const returnType_ = ff_compiler_Syntax.TConstructor(d_.at_, ff_compiler_Environment.fullName_(module_, d_.name_), ff_core_List.List_map(d_.generics_, ((typeParameter_) => {
330
- return ff_compiler_Syntax.TConstructor(d_.at_, typeParameter_, ff_core_List.Empty())
331
- })));
332
- return ff_core_List.List_map(d_.variants_, ((variant_) => {
333
- const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
334
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, variant_.name_), ff_compiler_Environment.Scheme(false, false, d_.newtype_, false, ff_compiler_Syntax.Signature(variant_.at_, variant_.name_, false, d_.generics_, d_.constraints_, ff_core_List.List_addAll(d_.commonFields_, variant_.fields_), returnType_, noEffect_)))
335
- }))
336
- }));
337
- const traits_ = ff_core_List.List_map(module_.traits_, ((d_) => {
338
- return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), d_)
339
- }));
340
- const effect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty());
341
- return ff_compiler_Environment.Environment("", ff_core_List.List_toMap(ff_core_List.List_addAll(functions_, ff_core_List.List_addAll(lets_, ff_core_List.List_addAll(fields_, ff_core_List.List_addAll(extends_, ff_core_List.List_addAll(variants_, traitMethods_))))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), effect_, ff_core_Option.None())
342
- }
343
-
344
-
345
-
346
- export const ff_core_Any_HasAnyTag$ff_compiler_Environment_Environment = {
347
- anyTag_() {
348
- return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Environment" + "[") + "]"))
349
- },
350
- async anyTag_$($task) {
351
- return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Environment" + "[") + "]"))
352
- }
353
- };
354
-
355
- export const ff_core_Any_HasAnyTag$ff_compiler_Environment_Scheme = {
356
- anyTag_() {
357
- return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Scheme" + "[") + "]"))
358
- },
359
- async anyTag_$($task) {
360
- return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Scheme" + "[") + "]"))
361
- }
362
- };
363
-
364
- export const ff_core_Any_HasAnyTag$ff_compiler_Environment_Instantiated = {
365
- anyTag_() {
366
- return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Instantiated" + "[") + "]"))
367
- },
368
- async anyTag_$($task) {
369
- return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Instantiated" + "[") + "]"))
370
- }
371
- };
372
-
373
- export const ff_core_Show_Show$ff_compiler_Environment_Environment = {
374
- show_(value_) {
375
- {
376
- const value_a = value_;
377
- {
378
- const z_ = value_a;
379
- return ((((((((((((("Environment" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.modulePrefix_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme).show_(z_.symbols_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DTrait).show_(z_.traits_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DImport).show_(z_.imports_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type.show_(z_.effect_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.selfVariable_)) + ")")
380
- return
381
- }
382
- }
383
- },
384
- async show_$(value_, $task) {
385
- {
386
- const value_a = value_;
387
- {
388
- const z_ = value_a;
389
- return ((((((((((((("Environment" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.modulePrefix_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme).show_(z_.symbols_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DTrait).show_(z_.traits_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DImport).show_(z_.imports_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type.show_(z_.effect_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.selfVariable_)) + ")")
390
- return
391
- }
392
- }
393
- }
394
- };
395
-
396
- export const ff_core_Show_Show$ff_compiler_Environment_Scheme = {
397
- show_(value_) {
398
- {
399
- const value_a = value_;
400
- {
401
- const z_ = value_a;
402
- return ((((((((((("Scheme" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isVariable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isMutable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isNewtype_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isTraitMethod_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Signature.show_(z_.signature_)) + ")")
403
- return
404
- }
405
- }
406
- },
407
- async show_$(value_, $task) {
408
- {
409
- const value_a = value_;
410
- {
411
- const z_ = value_a;
412
- return ((((((((((("Scheme" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isVariable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isMutable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isNewtype_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isTraitMethod_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Signature.show_(z_.signature_)) + ")")
413
- return
414
- }
415
- }
416
- }
417
- };
418
-
419
- export const ff_core_Show_Show$ff_compiler_Environment_Instantiated = {
420
- show_(value_) {
421
- {
422
- const value_a = value_;
423
- {
424
- const z_ = value_a;
425
- return ((((("Instantiated" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type)).show_(z_.typeArguments_)) + ", ") + ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme.show_(z_.scheme_)) + ")")
426
- return
427
- }
428
- }
429
- },
430
- async show_$(value_, $task) {
431
- {
432
- const value_a = value_;
433
- {
434
- const z_ = value_a;
435
- return ((((("Instantiated" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type)).show_(z_.typeArguments_)) + ", ") + ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme.show_(z_.scheme_)) + ")")
436
- return
437
- }
438
- }
439
- }
440
- };
441
-
442
- export const ff_core_Equal_Equal$ff_compiler_Environment_Environment = {
443
- equals_(x_, y_) {
444
- {
445
- const x_a = x_;
446
- const y_a = y_;
447
- {
448
- const _guard1 = (x_ === y_);
449
- if(_guard1) {
450
- return true
451
- return
452
- }
453
- }
454
- {
455
- return ((x_.modulePrefix_ === y_.modulePrefix_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme).equals_(x_.symbols_, y_.symbols_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DTrait).equals_(x_.traits_, y_.traits_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DImport).equals_(x_.imports_, y_.imports_) && (ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type.equals_(x_.effect_, y_.effect_) && ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.selfVariable_, y_.selfVariable_))))))
456
- return
457
- }
458
- }
459
- },
460
- async equals_$(x_, y_, $task) {
461
- {
462
- const x_a = x_;
463
- const y_a = y_;
464
- {
465
- const _guard1 = (x_ === y_);
466
- if(_guard1) {
467
- return true
468
- return
469
- }
470
- }
471
- {
472
- return ((x_.modulePrefix_ === y_.modulePrefix_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme).equals_(x_.symbols_, y_.symbols_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DTrait).equals_(x_.traits_, y_.traits_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DImport).equals_(x_.imports_, y_.imports_) && (ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type.equals_(x_.effect_, y_.effect_) && ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.selfVariable_, y_.selfVariable_))))))
473
- return
474
- }
475
- }
476
- }
477
- };
478
-
479
- export const ff_core_Equal_Equal$ff_compiler_Environment_Scheme = {
480
- equals_(x_, y_) {
481
- {
482
- const x_a = x_;
483
- const y_a = y_;
484
- {
485
- const _guard1 = (x_ === y_);
486
- if(_guard1) {
487
- return true
488
- return
489
- }
490
- }
491
- {
492
- return ((x_.isVariable_ === y_.isVariable_) && ((x_.isMutable_ === y_.isMutable_) && ((x_.isNewtype_ === y_.isNewtype_) && ((x_.isTraitMethod_ === y_.isTraitMethod_) && ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Signature.equals_(x_.signature_, y_.signature_)))))
493
- return
494
- }
495
- }
496
- },
497
- async equals_$(x_, y_, $task) {
498
- {
499
- const x_a = x_;
500
- const y_a = y_;
501
- {
502
- const _guard1 = (x_ === y_);
503
- if(_guard1) {
504
- return true
505
- return
506
- }
507
- }
508
- {
509
- return ((x_.isVariable_ === y_.isVariable_) && ((x_.isMutable_ === y_.isMutable_) && ((x_.isNewtype_ === y_.isNewtype_) && ((x_.isTraitMethod_ === y_.isTraitMethod_) && ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Signature.equals_(x_.signature_, y_.signature_)))))
510
- return
511
- }
512
- }
513
- }
514
- };
515
-
516
- export const ff_core_Equal_Equal$ff_compiler_Environment_Instantiated = {
517
- equals_(x_, y_) {
518
- {
519
- const x_a = x_;
520
- const y_a = y_;
521
- {
522
- const _guard1 = (x_ === y_);
523
- if(_guard1) {
524
- return true
525
- return
526
- }
527
- }
528
- {
529
- return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type)).equals_(x_.typeArguments_, y_.typeArguments_) && ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme.equals_(x_.scheme_, y_.scheme_))
530
- return
531
- }
532
- }
533
- },
534
- async equals_$(x_, y_, $task) {
535
- {
536
- const x_a = x_;
537
- const y_a = y_;
538
- {
539
- const _guard1 = (x_ === y_);
540
- if(_guard1) {
541
- return true
542
- return
543
- }
544
- }
545
- {
546
- return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type)).equals_(x_.typeArguments_, y_.typeArguments_) && ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme.equals_(x_.scheme_, y_.scheme_))
547
- return
548
- }
549
- }
550
- }
551
- };
552
-
553
- export const ff_core_Ordering_Order$ff_compiler_Environment_Environment = {
554
- compare_(x_, y_) {
555
- {
556
- const x_a = x_;
557
- const y_a = y_;
558
- {
559
- const _guard1 = (x_ === y_);
560
- if(_guard1) {
561
- return ff_core_Ordering.OrderingSame()
562
- return
563
- }
564
- }
565
- {
566
- const modulePrefixOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.modulePrefix_, y_.modulePrefix_);
567
- if((modulePrefixOrdering_ !== ff_core_Ordering.OrderingSame())) {
568
- return modulePrefixOrdering_
569
- } else {
570
- const symbolsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme).compare_(x_.symbols_, y_.symbols_);
571
- if((symbolsOrdering_ !== ff_core_Ordering.OrderingSame())) {
572
- return symbolsOrdering_
573
- } else {
574
- const traitsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DTrait).compare_(x_.traits_, y_.traits_);
575
- if((traitsOrdering_ !== ff_core_Ordering.OrderingSame())) {
576
- return traitsOrdering_
577
- } else {
578
- const importsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DImport).compare_(x_.imports_, y_.imports_);
579
- if((importsOrdering_ !== ff_core_Ordering.OrderingSame())) {
580
- return importsOrdering_
581
- } else {
582
- const effectOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type.compare_(x_.effect_, y_.effect_);
583
- if((effectOrdering_ !== ff_core_Ordering.OrderingSame())) {
584
- return effectOrdering_
585
- } else {
586
- const selfVariableOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.selfVariable_, y_.selfVariable_);
587
- if((selfVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
588
- return selfVariableOrdering_
589
- } else {
590
- return ff_core_Ordering.OrderingSame()
591
- }
592
- }
593
- }
594
- }
595
- }
596
- }
597
- return
598
- }
599
- }
600
- },
601
- async compare_$(x_, y_, $task) {
602
- {
603
- const x_a = x_;
604
- const y_a = y_;
605
- {
606
- const _guard1 = (x_ === y_);
607
- if(_guard1) {
608
- return ff_core_Ordering.OrderingSame()
609
- return
610
- }
611
- }
612
- {
613
- const modulePrefixOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.modulePrefix_, y_.modulePrefix_);
614
- if((modulePrefixOrdering_ !== ff_core_Ordering.OrderingSame())) {
615
- return modulePrefixOrdering_
616
- } else {
617
- const symbolsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme).compare_(x_.symbols_, y_.symbols_);
618
- if((symbolsOrdering_ !== ff_core_Ordering.OrderingSame())) {
619
- return symbolsOrdering_
620
- } else {
621
- const traitsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DTrait).compare_(x_.traits_, y_.traits_);
622
- if((traitsOrdering_ !== ff_core_Ordering.OrderingSame())) {
623
- return traitsOrdering_
624
- } else {
625
- const importsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DImport).compare_(x_.imports_, y_.imports_);
626
- if((importsOrdering_ !== ff_core_Ordering.OrderingSame())) {
627
- return importsOrdering_
628
- } else {
629
- const effectOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type.compare_(x_.effect_, y_.effect_);
630
- if((effectOrdering_ !== ff_core_Ordering.OrderingSame())) {
631
- return effectOrdering_
632
- } else {
633
- const selfVariableOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.selfVariable_, y_.selfVariable_);
634
- if((selfVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
635
- return selfVariableOrdering_
636
- } else {
637
- return ff_core_Ordering.OrderingSame()
638
- }
639
- }
640
- }
641
- }
642
- }
643
- }
644
- return
645
- }
646
- }
647
- }
648
- };
649
-
650
- export const ff_core_Ordering_Order$ff_compiler_Environment_Scheme = {
651
- compare_(x_, y_) {
652
- {
653
- const x_a = x_;
654
- const y_a = y_;
655
- {
656
- const _guard1 = (x_ === y_);
657
- if(_guard1) {
658
- return ff_core_Ordering.OrderingSame()
659
- return
660
- }
661
- }
662
- {
663
- const isVariableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isVariable_, y_.isVariable_);
664
- if((isVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
665
- return isVariableOrdering_
666
- } else {
667
- const isMutableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isMutable_, y_.isMutable_);
668
- if((isMutableOrdering_ !== ff_core_Ordering.OrderingSame())) {
669
- return isMutableOrdering_
670
- } else {
671
- const isNewtypeOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isNewtype_, y_.isNewtype_);
672
- if((isNewtypeOrdering_ !== ff_core_Ordering.OrderingSame())) {
673
- return isNewtypeOrdering_
674
- } else {
675
- const isTraitMethodOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isTraitMethod_, y_.isTraitMethod_);
676
- if((isTraitMethodOrdering_ !== ff_core_Ordering.OrderingSame())) {
677
- return isTraitMethodOrdering_
678
- } else {
679
- const signatureOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Signature.compare_(x_.signature_, y_.signature_);
680
- if((signatureOrdering_ !== ff_core_Ordering.OrderingSame())) {
681
- return signatureOrdering_
682
- } else {
683
- return ff_core_Ordering.OrderingSame()
684
- }
685
- }
686
- }
687
- }
688
- }
689
- return
690
- }
691
- }
692
- },
693
- async compare_$(x_, y_, $task) {
694
- {
695
- const x_a = x_;
696
- const y_a = y_;
697
- {
698
- const _guard1 = (x_ === y_);
699
- if(_guard1) {
700
- return ff_core_Ordering.OrderingSame()
701
- return
702
- }
703
- }
704
- {
705
- const isVariableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isVariable_, y_.isVariable_);
706
- if((isVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
707
- return isVariableOrdering_
708
- } else {
709
- const isMutableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isMutable_, y_.isMutable_);
710
- if((isMutableOrdering_ !== ff_core_Ordering.OrderingSame())) {
711
- return isMutableOrdering_
712
- } else {
713
- const isNewtypeOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isNewtype_, y_.isNewtype_);
714
- if((isNewtypeOrdering_ !== ff_core_Ordering.OrderingSame())) {
715
- return isNewtypeOrdering_
716
- } else {
717
- const isTraitMethodOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isTraitMethod_, y_.isTraitMethod_);
718
- if((isTraitMethodOrdering_ !== ff_core_Ordering.OrderingSame())) {
719
- return isTraitMethodOrdering_
720
- } else {
721
- const signatureOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Signature.compare_(x_.signature_, y_.signature_);
722
- if((signatureOrdering_ !== ff_core_Ordering.OrderingSame())) {
723
- return signatureOrdering_
724
- } else {
725
- return ff_core_Ordering.OrderingSame()
726
- }
727
- }
728
- }
729
- }
730
- }
731
- return
732
- }
733
- }
734
- }
735
- };
736
-
737
- export const ff_core_Ordering_Order$ff_compiler_Environment_Instantiated = {
738
- compare_(x_, y_) {
739
- {
740
- const x_a = x_;
741
- const y_a = y_;
742
- {
743
- const _guard1 = (x_ === y_);
744
- if(_guard1) {
745
- return ff_core_Ordering.OrderingSame()
746
- return
747
- }
748
- }
749
- {
750
- const typeArgumentsOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type)).compare_(x_.typeArguments_, y_.typeArguments_);
751
- if((typeArgumentsOrdering_ !== ff_core_Ordering.OrderingSame())) {
752
- return typeArgumentsOrdering_
753
- } else {
754
- const schemeOrdering_ = ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme.compare_(x_.scheme_, y_.scheme_);
755
- if((schemeOrdering_ !== ff_core_Ordering.OrderingSame())) {
756
- return schemeOrdering_
757
- } else {
758
- return ff_core_Ordering.OrderingSame()
759
- }
760
- }
761
- return
762
- }
763
- }
764
- },
765
- async compare_$(x_, y_, $task) {
766
- {
767
- const x_a = x_;
768
- const y_a = y_;
769
- {
770
- const _guard1 = (x_ === y_);
771
- if(_guard1) {
772
- return ff_core_Ordering.OrderingSame()
773
- return
774
- }
775
- }
776
- {
777
- const typeArgumentsOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type)).compare_(x_.typeArguments_, y_.typeArguments_);
778
- if((typeArgumentsOrdering_ !== ff_core_Ordering.OrderingSame())) {
779
- return typeArgumentsOrdering_
780
- } else {
781
- const schemeOrdering_ = ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme.compare_(x_.scheme_, y_.scheme_);
782
- if((schemeOrdering_ !== ff_core_Ordering.OrderingSame())) {
783
- return schemeOrdering_
784
- } else {
785
- return ff_core_Ordering.OrderingSame()
786
- }
787
- }
788
- return
789
- }
790
- }
791
- }
792
- };
793
-
794
- export const ff_core_Serializable_Serializable$ff_compiler_Environment_Environment = {
795
- serializeUsing_(serialization_, value_) {
796
- {
797
- const serialization_a = serialization_;
798
- const value_a = value_;
799
- {
800
- const v_ = value_a;
801
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
802
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
803
- serialization_.offset_ += 1;
804
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.modulePrefix_);
805
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).serializeUsing_(serialization_, v_.symbols_);
806
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).serializeUsing_(serialization_, v_.traits_);
807
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).serializeUsing_(serialization_, v_.imports_);
808
- ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.serializeUsing_(serialization_, v_.effect_);
809
- ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.selfVariable_)
810
- return
811
- }
812
- }
813
- },
814
- deserializeUsing_(serialization_) {
815
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
816
- serialization_.offset_ += 1;
817
- {
818
- const _1 = variantIndex_;
819
- {
820
- if(_1 == 0) {
821
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
822
- return ff_compiler_Environment.Environment(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
823
- return
824
- }
825
- }
826
- {
827
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
828
- return
829
- }
830
- }
831
- },
832
- async serializeUsing_$(serialization_, value_, $task) {
833
- {
834
- const serialization_a = serialization_;
835
- const value_a = value_;
836
- {
837
- const v_ = value_a;
838
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
839
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
840
- serialization_.offset_ += 1;
841
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.modulePrefix_);
842
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).serializeUsing_(serialization_, v_.symbols_);
843
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).serializeUsing_(serialization_, v_.traits_);
844
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).serializeUsing_(serialization_, v_.imports_);
845
- ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.serializeUsing_(serialization_, v_.effect_);
846
- ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.selfVariable_)
847
- return
848
- }
849
- }
850
- },
851
- async deserializeUsing_$(serialization_, $task) {
852
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
853
- serialization_.offset_ += 1;
854
- {
855
- const _1 = variantIndex_;
856
- {
857
- if(_1 == 0) {
858
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
859
- return ff_compiler_Environment.Environment(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
860
- return
861
- }
862
- }
863
- {
864
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
865
- return
866
- }
867
- }
868
- }
869
- };
870
-
871
- export const ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme = {
872
- serializeUsing_(serialization_, value_) {
873
- {
874
- const serialization_a = serialization_;
875
- const value_a = value_;
876
- {
877
- const v_ = value_a;
878
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
879
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
880
- serialization_.offset_ += 1;
881
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isVariable_);
882
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isMutable_);
883
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isNewtype_);
884
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isTraitMethod_);
885
- ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.serializeUsing_(serialization_, v_.signature_)
886
- return
887
- }
888
- }
889
- },
890
- deserializeUsing_(serialization_) {
891
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
892
- serialization_.offset_ += 1;
893
- {
894
- const _1 = variantIndex_;
895
- {
896
- if(_1 == 0) {
897
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
898
- return ff_compiler_Environment.Scheme(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.deserializeUsing_(serialization_))
899
- return
900
- }
901
- }
902
- {
903
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
904
- return
905
- }
906
- }
907
- },
908
- async serializeUsing_$(serialization_, value_, $task) {
909
- {
910
- const serialization_a = serialization_;
911
- const value_a = value_;
912
- {
913
- const v_ = value_a;
914
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
915
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
916
- serialization_.offset_ += 1;
917
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isVariable_);
918
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isMutable_);
919
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isNewtype_);
920
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isTraitMethod_);
921
- ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.serializeUsing_(serialization_, v_.signature_)
922
- return
923
- }
924
- }
925
- },
926
- async deserializeUsing_$(serialization_, $task) {
927
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
928
- serialization_.offset_ += 1;
929
- {
930
- const _1 = variantIndex_;
931
- {
932
- if(_1 == 0) {
933
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
934
- return ff_compiler_Environment.Scheme(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.deserializeUsing_(serialization_))
935
- return
936
- }
937
- }
938
- {
939
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
940
- return
941
- }
942
- }
943
- }
944
- };
945
-
946
- export const ff_core_Serializable_Serializable$ff_compiler_Environment_Instantiated = {
947
- serializeUsing_(serialization_, value_) {
948
- {
949
- const serialization_a = serialization_;
950
- const value_a = value_;
951
- {
952
- const v_ = value_a;
953
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
954
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
955
- serialization_.offset_ += 1;
956
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).serializeUsing_(serialization_, v_.typeArguments_);
957
- ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.serializeUsing_(serialization_, v_.scheme_)
958
- return
959
- }
960
- }
961
- },
962
- deserializeUsing_(serialization_) {
963
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
964
- serialization_.offset_ += 1;
965
- {
966
- const _1 = variantIndex_;
967
- {
968
- if(_1 == 0) {
969
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
970
- return ff_compiler_Environment.Instantiated(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).deserializeUsing_(serialization_), ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.deserializeUsing_(serialization_))
971
- return
972
- }
973
- }
974
- {
975
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
976
- return
977
- }
978
- }
979
- },
980
- async serializeUsing_$(serialization_, value_, $task) {
981
- {
982
- const serialization_a = serialization_;
983
- const value_a = value_;
984
- {
985
- const v_ = value_a;
986
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
987
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
988
- serialization_.offset_ += 1;
989
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).serializeUsing_(serialization_, v_.typeArguments_);
990
- ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.serializeUsing_(serialization_, v_.scheme_)
991
- return
992
- }
993
- }
994
- },
995
- async deserializeUsing_$(serialization_, $task) {
996
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
997
- serialization_.offset_ += 1;
998
- {
999
- const _1 = variantIndex_;
1000
- {
1001
- if(_1 == 0) {
1002
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
1003
- return ff_compiler_Environment.Instantiated(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).deserializeUsing_(serialization_), ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.deserializeUsing_(serialization_))
1004
- return
1005
- }
1006
- }
1007
- {
1008
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1009
- return
1010
- }
1011
- }
1012
- }
1013
- };
1014
-
1015
-
1
+
2
+
3
+ import * as ff_compiler_Environment from "../../ff/compiler/Environment.mjs"
4
+
5
+ import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
6
+
7
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
8
+
9
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
10
+
11
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
12
+
13
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
14
+
15
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
16
+
17
+ import * as ff_core_Box from "../../ff/core/Box.mjs"
18
+
19
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
20
+
21
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
22
+
23
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
24
+
25
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
26
+
27
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
28
+
29
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
30
+
31
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
32
+
33
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
34
+
35
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
36
+
37
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
38
+
39
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
40
+
41
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
42
+
43
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
44
+
45
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
46
+
47
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
48
+
49
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
+
51
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
+
53
+ import * as ff_core_List from "../../ff/core/List.mjs"
54
+
55
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
56
+
57
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
58
+
59
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
60
+
61
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
62
+
63
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
64
+
65
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
66
+
67
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
68
+
69
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
70
+
71
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
72
+
73
+ import * as ff_core_Random from "../../ff/core/Random.mjs"
74
+
75
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
76
+
77
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
78
+
79
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
80
+
81
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
82
+
83
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
84
+
85
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
86
+
87
+ import * as ff_core_String from "../../ff/core/String.mjs"
88
+
89
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
90
+
91
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
92
+
93
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
94
+
95
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
96
+
97
+ import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
98
+
99
+ // type Environment
100
+ export function Environment(modulePrefix_, symbols_, traits_, imports_, effect_, selfVariable_) {
101
+ return {modulePrefix_, symbols_, traits_, imports_, effect_, selfVariable_};
102
+ }
103
+
104
+ // type Scheme
105
+ export function Scheme(isVariable_, isMutable_, isNewtype_, isTraitMethod_, signature_) {
106
+ return {isVariable_, isMutable_, isNewtype_, isTraitMethod_, signature_};
107
+ }
108
+
109
+ // type Instantiated
110
+ export function Instantiated(typeArguments_, scheme_) {
111
+ return {typeArguments_, scheme_};
112
+ }
113
+
114
+
115
+
116
+ export function make_(module_, otherModules_, alreadyFlat_) {
117
+ const processed_ = ff_compiler_Environment.processModule_(module_, true, alreadyFlat_);
118
+ const otherProcessed_ = ff_core_List.List_map(otherModules_, ((_w1) => {
119
+ return ff_compiler_Environment.processModule_(_w1, false, false)
120
+ }));
121
+ return ff_compiler_Environment.Environment(ff_compiler_Environment.fullName_(module_, ""), ff_core_Map.Map_addAll(processed_.symbols_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
122
+ return _w1.symbols_
123
+ })), ff_core_Map.empty_(), ((_w1, _w2) => {
124
+ return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
125
+ })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(processed_.traits_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
126
+ return _w1.traits_
127
+ })), ff_core_Map.empty_(), ((_w1, _w2) => {
128
+ return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
129
+ })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.List_map(module_.imports_, ((i_) => {
130
+ return ff_core_Pair.Pair(i_.alias_, i_)
131
+ })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty()), ff_core_Option.None())
132
+ }
133
+
134
+ export function fullName_(module_, name_) {
135
+ return ((((ff_compiler_Syntax.PackagePair_groupName(module_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(module_.file_, 3)) + ".") + name_)
136
+ }
137
+
138
+ export function fail_(at_, message_) {
139
+ return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
140
+ }
141
+
142
+ export function processModule_(module_, isCurrentModule_, alreadyFlat_) {
143
+ const functions_ = ff_core_List.List_map(module_.functions_, ((d_) => {
144
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, d_.signature_))
145
+ }));
146
+ const lets_ = ff_core_List.List_map(module_.lets_, ((d_) => {
147
+ const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
148
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), ff_compiler_Environment.Scheme(true, false, false, false, ff_compiler_Syntax.Signature(d_.at_, d_.name_, false, ff_core_List.Empty(), ff_core_List.Empty(), ff_core_List.Empty(), d_.variableType_, noEffect_)))
149
+ }));
150
+ const traitMethods_ = ff_core_List.List_flatMap(module_.traits_, ((definition_) => {
151
+ const generics_ = ff_core_List.List_map(definition_.generics_, ((name_) => {
152
+ return ff_compiler_Syntax.TConstructor(definition_.at_, name_, ff_core_List.Empty())
153
+ }));
154
+ const constraint_ = ff_compiler_Syntax.Constraint(definition_.at_, ff_compiler_Environment.fullName_(module_, definition_.name_), generics_);
155
+ const outerConstraints_ = (alreadyFlat_
156
+ ? ff_core_List.Empty()
157
+ : definition_.constraints_);
158
+ return ff_core_List.List_map(definition_.methods_, ((methodSignature_) => {
159
+ const generics_ = ff_core_List.List_partition(ff_core_List.List_addAll(definition_.generics_, methodSignature_.generics_), ((_w1) => {
160
+ return (_w1 === "Q$")
161
+ }));
162
+ const signature_ = (((_c) => {
163
+ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(ff_core_List.List_takeFirst(generics_.first_, 1), generics_.second_), ff_core_List.Link(constraint_, ff_core_List.List_addAll(outerConstraints_, methodSignature_.constraints_)), _c.parameters_, _c.returnType_, _c.effect_)
164
+ }))(methodSignature_);
165
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, signature_.name_), ff_compiler_Environment.Scheme(false, false, false, true, signature_))
166
+ }))
167
+ }));
168
+ const extends_ = ff_core_List.List_flatMap(module_.extends_, ((d_) => {
169
+ {
170
+ const _1 = d_.type_;
171
+ {
172
+ if(_1.TVariable) {
173
+ const t_ = _1;
174
+ return ff_compiler_Environment.fail_(t_.at_, ("Unexpected type variable: $" + t_.index_))
175
+ return
176
+ }
177
+ }
178
+ {
179
+ if(_1.TConstructor) {
180
+ const t_ = _1;
181
+ const prefix_ = (t_.name_ + "_");
182
+ const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, d_.type_, ff_core_Option.None());
183
+ return ff_core_List.List_map(d_.methods_, ((method_) => {
184
+ const effect_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
185
+ return (_w1 === "Q$")
186
+ }));
187
+ const normalGenerics_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
188
+ return (_w1 !== "Q$")
189
+ }));
190
+ const outerGenerics_ = (alreadyFlat_
191
+ ? ff_core_List.Empty()
192
+ : d_.generics_);
193
+ const outerConstraints_ = (alreadyFlat_
194
+ ? ff_core_List.Empty()
195
+ : d_.constraints_);
196
+ return ff_core_Pair.Pair((prefix_ + method_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, (((_c) => {
197
+ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(outerConstraints_, method_.signature_.constraints_), ff_core_List.Link(selfParameter_, method_.signature_.parameters_), _c.returnType_, _c.effect_)
198
+ }))(method_.signature_)))
199
+ }))
200
+ return
201
+ }
202
+ }
203
+ }
204
+ }));
205
+ const fields_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
206
+ const prefix_ = (d_.name_ + "_");
207
+ const t_ = ff_compiler_Syntax.TConstructor(d_.at_, d_.name_, ff_core_List.List_map(d_.generics_, ((g_) => {
208
+ return ff_compiler_Syntax.TConstructor(d_.at_, g_, ff_core_List.Empty())
209
+ })));
210
+ const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, t_, ff_core_Option.None());
211
+ return ff_core_List.List_map(d_.commonFields_, ((f_) => {
212
+ const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
213
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, (prefix_ + f_.name_)), ff_compiler_Environment.Scheme(true, f_.mutable_, d_.newtype_, false, ff_compiler_Syntax.Signature(f_.at_, f_.name_, true, d_.generics_, d_.constraints_, ff_core_List.Link(selfParameter_, ff_core_List.Empty()), f_.valueType_, noEffect_)))
214
+ }))
215
+ }));
216
+ const variants_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
217
+ const returnType_ = ff_compiler_Syntax.TConstructor(d_.at_, ff_compiler_Environment.fullName_(module_, d_.name_), ff_core_List.List_map(d_.generics_, ((typeParameter_) => {
218
+ return ff_compiler_Syntax.TConstructor(d_.at_, typeParameter_, ff_core_List.Empty())
219
+ })));
220
+ return ff_core_List.List_map(d_.variants_, ((variant_) => {
221
+ const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
222
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, variant_.name_), ff_compiler_Environment.Scheme(false, false, d_.newtype_, false, ff_compiler_Syntax.Signature(variant_.at_, variant_.name_, false, d_.generics_, d_.constraints_, ff_core_List.List_addAll(d_.commonFields_, variant_.fields_), returnType_, noEffect_)))
223
+ }))
224
+ }));
225
+ const traits_ = ff_core_List.List_map(module_.traits_, ((d_) => {
226
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), d_)
227
+ }));
228
+ const effect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty());
229
+ return ff_compiler_Environment.Environment("", ff_core_List.List_toMap(ff_core_List.List_addAll(functions_, ff_core_List.List_addAll(lets_, ff_core_List.List_addAll(fields_, ff_core_List.List_addAll(extends_, ff_core_List.List_addAll(variants_, traitMethods_))))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), effect_, ff_core_Option.None())
230
+ }
231
+
232
+ export async function make_$(module_, otherModules_, alreadyFlat_, $task) {
233
+ const processed_ = ff_compiler_Environment.processModule_(module_, true, alreadyFlat_);
234
+ const otherProcessed_ = ff_core_List.List_map(otherModules_, ((_w1) => {
235
+ return ff_compiler_Environment.processModule_(_w1, false, false)
236
+ }));
237
+ return ff_compiler_Environment.Environment(ff_compiler_Environment.fullName_(module_, ""), ff_core_Map.Map_addAll(processed_.symbols_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
238
+ return _w1.symbols_
239
+ })), ff_core_Map.empty_(), ((_w1, _w2) => {
240
+ return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
241
+ })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(processed_.traits_, ff_core_List.List_foldLeft(ff_core_List.List_map(otherProcessed_, ((_w1) => {
242
+ return _w1.traits_
243
+ })), ff_core_Map.empty_(), ((_w1, _w2) => {
244
+ return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
245
+ })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.List_map(module_.imports_, ((i_) => {
246
+ return ff_core_Pair.Pair(i_.alias_, i_)
247
+ })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty()), ff_core_Option.None())
248
+ }
249
+
250
+ export async function fullName_$(module_, name_, $task) {
251
+ return ((((ff_compiler_Syntax.PackagePair_groupName(module_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(module_.file_, 3)) + ".") + name_)
252
+ }
253
+
254
+ export async function fail_$(at_, message_, $task) {
255
+ return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
256
+ }
257
+
258
+ export async function processModule_$(module_, isCurrentModule_, alreadyFlat_, $task) {
259
+ const functions_ = ff_core_List.List_map(module_.functions_, ((d_) => {
260
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, d_.signature_))
261
+ }));
262
+ const lets_ = ff_core_List.List_map(module_.lets_, ((d_) => {
263
+ const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
264
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), ff_compiler_Environment.Scheme(true, false, false, false, ff_compiler_Syntax.Signature(d_.at_, d_.name_, false, ff_core_List.Empty(), ff_core_List.Empty(), ff_core_List.Empty(), d_.variableType_, noEffect_)))
265
+ }));
266
+ const traitMethods_ = ff_core_List.List_flatMap(module_.traits_, ((definition_) => {
267
+ const generics_ = ff_core_List.List_map(definition_.generics_, ((name_) => {
268
+ return ff_compiler_Syntax.TConstructor(definition_.at_, name_, ff_core_List.Empty())
269
+ }));
270
+ const constraint_ = ff_compiler_Syntax.Constraint(definition_.at_, ff_compiler_Environment.fullName_(module_, definition_.name_), generics_);
271
+ const outerConstraints_ = (alreadyFlat_
272
+ ? ff_core_List.Empty()
273
+ : definition_.constraints_);
274
+ return ff_core_List.List_map(definition_.methods_, ((methodSignature_) => {
275
+ const generics_ = ff_core_List.List_partition(ff_core_List.List_addAll(definition_.generics_, methodSignature_.generics_), ((_w1) => {
276
+ return (_w1 === "Q$")
277
+ }));
278
+ const signature_ = (((_c) => {
279
+ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(ff_core_List.List_takeFirst(generics_.first_, 1), generics_.second_), ff_core_List.Link(constraint_, ff_core_List.List_addAll(outerConstraints_, methodSignature_.constraints_)), _c.parameters_, _c.returnType_, _c.effect_)
280
+ }))(methodSignature_);
281
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, signature_.name_), ff_compiler_Environment.Scheme(false, false, false, true, signature_))
282
+ }))
283
+ }));
284
+ const extends_ = ff_core_List.List_flatMap(module_.extends_, ((d_) => {
285
+ {
286
+ const _1 = d_.type_;
287
+ {
288
+ if(_1.TVariable) {
289
+ const t_ = _1;
290
+ return ff_compiler_Environment.fail_(t_.at_, ("Unexpected type variable: $" + t_.index_))
291
+ return
292
+ }
293
+ }
294
+ {
295
+ if(_1.TConstructor) {
296
+ const t_ = _1;
297
+ const prefix_ = (t_.name_ + "_");
298
+ const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, d_.type_, ff_core_Option.None());
299
+ return ff_core_List.List_map(d_.methods_, ((method_) => {
300
+ const effect_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
301
+ return (_w1 === "Q$")
302
+ }));
303
+ const normalGenerics_ = ff_core_List.List_filter(method_.signature_.generics_, ((_w1) => {
304
+ return (_w1 !== "Q$")
305
+ }));
306
+ const outerGenerics_ = (alreadyFlat_
307
+ ? ff_core_List.Empty()
308
+ : d_.generics_);
309
+ const outerConstraints_ = (alreadyFlat_
310
+ ? ff_core_List.Empty()
311
+ : d_.constraints_);
312
+ return ff_core_Pair.Pair((prefix_ + method_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, (((_c) => {
313
+ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(outerConstraints_, method_.signature_.constraints_), ff_core_List.Link(selfParameter_, method_.signature_.parameters_), _c.returnType_, _c.effect_)
314
+ }))(method_.signature_)))
315
+ }))
316
+ return
317
+ }
318
+ }
319
+ }
320
+ }));
321
+ const fields_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
322
+ const prefix_ = (d_.name_ + "_");
323
+ const t_ = ff_compiler_Syntax.TConstructor(d_.at_, d_.name_, ff_core_List.List_map(d_.generics_, ((g_) => {
324
+ return ff_compiler_Syntax.TConstructor(d_.at_, g_, ff_core_List.Empty())
325
+ })));
326
+ const selfParameter_ = ff_compiler_Syntax.Parameter(d_.at_, false, d_.name_, t_, ff_core_Option.None());
327
+ return ff_core_List.List_map(d_.commonFields_, ((f_) => {
328
+ const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
329
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, (prefix_ + f_.name_)), ff_compiler_Environment.Scheme(true, f_.mutable_, d_.newtype_, false, ff_compiler_Syntax.Signature(f_.at_, f_.name_, true, d_.generics_, d_.constraints_, ff_core_List.Link(selfParameter_, ff_core_List.Empty()), f_.valueType_, noEffect_)))
330
+ }))
331
+ }));
332
+ const variants_ = ff_core_List.List_flatMap(module_.types_, ((d_) => {
333
+ const returnType_ = ff_compiler_Syntax.TConstructor(d_.at_, ff_compiler_Environment.fullName_(module_, d_.name_), ff_core_List.List_map(d_.generics_, ((typeParameter_) => {
334
+ return ff_compiler_Syntax.TConstructor(d_.at_, typeParameter_, ff_core_List.Empty())
335
+ })));
336
+ return ff_core_List.List_map(d_.variants_, ((variant_) => {
337
+ const noEffect_ = ff_compiler_Syntax.TConstructor(d_.at_, "ff:core/Nothing.Nothing", ff_core_List.Empty());
338
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, variant_.name_), ff_compiler_Environment.Scheme(false, false, d_.newtype_, false, ff_compiler_Syntax.Signature(variant_.at_, variant_.name_, false, d_.generics_, d_.constraints_, ff_core_List.List_addAll(d_.commonFields_, variant_.fields_), returnType_, noEffect_)))
339
+ }))
340
+ }));
341
+ const traits_ = ff_core_List.List_map(module_.traits_, ((d_) => {
342
+ return ff_core_Pair.Pair(ff_compiler_Environment.fullName_(module_, d_.name_), d_)
343
+ }));
344
+ const effect_ = ff_compiler_Syntax.TConstructor(ff_compiler_Syntax.Location(module_.file_, 0, 0), "ff:core/Nothing.Nothing", ff_core_List.Empty());
345
+ return ff_compiler_Environment.Environment("", ff_core_List.List_toMap(ff_core_List.List_addAll(functions_, ff_core_List.List_addAll(lets_, ff_core_List.List_addAll(fields_, ff_core_List.List_addAll(extends_, ff_core_List.List_addAll(variants_, traitMethods_))))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), effect_, ff_core_Option.None())
346
+ }
347
+
348
+
349
+
350
+ export const ff_core_Any_HasAnyTag$ff_compiler_Environment_Environment = {
351
+ anyTag_() {
352
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Environment" + "[") + "]"))
353
+ },
354
+ async anyTag_$($task) {
355
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Environment" + "[") + "]"))
356
+ }
357
+ };
358
+
359
+ export const ff_core_Any_HasAnyTag$ff_compiler_Environment_Scheme = {
360
+ anyTag_() {
361
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Scheme" + "[") + "]"))
362
+ },
363
+ async anyTag_$($task) {
364
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Scheme" + "[") + "]"))
365
+ }
366
+ };
367
+
368
+ export const ff_core_Any_HasAnyTag$ff_compiler_Environment_Instantiated = {
369
+ anyTag_() {
370
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Instantiated" + "[") + "]"))
371
+ },
372
+ async anyTag_$($task) {
373
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Environment.Instantiated" + "[") + "]"))
374
+ }
375
+ };
376
+
377
+ export const ff_core_Show_Show$ff_compiler_Environment_Environment = {
378
+ show_(value_) {
379
+ {
380
+ const value_a = value_;
381
+ {
382
+ const z_ = value_a;
383
+ return ((((((((((((("Environment" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.modulePrefix_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme).show_(z_.symbols_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DTrait).show_(z_.traits_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DImport).show_(z_.imports_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type.show_(z_.effect_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.selfVariable_)) + ")")
384
+ return
385
+ }
386
+ }
387
+ },
388
+ async show_$(value_, $task) {
389
+ {
390
+ const value_a = value_;
391
+ {
392
+ const z_ = value_a;
393
+ return ((((((((((((("Environment" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.modulePrefix_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme).show_(z_.symbols_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DTrait).show_(z_.traits_)) + ", ") + ff_core_Map.ff_core_Show_Show$ff_core_Map_Map(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_DImport).show_(z_.imports_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type.show_(z_.effect_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.selfVariable_)) + ")")
394
+ return
395
+ }
396
+ }
397
+ }
398
+ };
399
+
400
+ export const ff_core_Show_Show$ff_compiler_Environment_Scheme = {
401
+ show_(value_) {
402
+ {
403
+ const value_a = value_;
404
+ {
405
+ const z_ = value_a;
406
+ return ((((((((((("Scheme" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isVariable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isMutable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isNewtype_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isTraitMethod_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Signature.show_(z_.signature_)) + ")")
407
+ return
408
+ }
409
+ }
410
+ },
411
+ async show_$(value_, $task) {
412
+ {
413
+ const value_a = value_;
414
+ {
415
+ const z_ = value_a;
416
+ return ((((((((((("Scheme" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isVariable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isMutable_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isNewtype_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_Bool_Bool.show_(z_.isTraitMethod_)) + ", ") + ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Signature.show_(z_.signature_)) + ")")
417
+ return
418
+ }
419
+ }
420
+ }
421
+ };
422
+
423
+ export const ff_core_Show_Show$ff_compiler_Environment_Instantiated = {
424
+ show_(value_) {
425
+ {
426
+ const value_a = value_;
427
+ {
428
+ const z_ = value_a;
429
+ return ((((("Instantiated" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type)).show_(z_.typeArguments_)) + ", ") + ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme.show_(z_.scheme_)) + ")")
430
+ return
431
+ }
432
+ }
433
+ },
434
+ async show_$(value_, $task) {
435
+ {
436
+ const value_a = value_;
437
+ {
438
+ const z_ = value_a;
439
+ return ((((("Instantiated" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show.ff_core_Show_Show$ff_core_String_String, ff_compiler_Syntax.ff_core_Show_Show$ff_compiler_Syntax_Type)).show_(z_.typeArguments_)) + ", ") + ff_compiler_Environment.ff_core_Show_Show$ff_compiler_Environment_Scheme.show_(z_.scheme_)) + ")")
440
+ return
441
+ }
442
+ }
443
+ }
444
+ };
445
+
446
+ export const ff_core_Equal_Equal$ff_compiler_Environment_Environment = {
447
+ equals_(x_, y_) {
448
+ {
449
+ const x_a = x_;
450
+ const y_a = y_;
451
+ {
452
+ const _guard1 = (x_ === y_);
453
+ if(_guard1) {
454
+ return true
455
+ return
456
+ }
457
+ }
458
+ {
459
+ return ((x_.modulePrefix_ === y_.modulePrefix_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme).equals_(x_.symbols_, y_.symbols_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DTrait).equals_(x_.traits_, y_.traits_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DImport).equals_(x_.imports_, y_.imports_) && (ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type.equals_(x_.effect_, y_.effect_) && ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.selfVariable_, y_.selfVariable_))))))
460
+ return
461
+ }
462
+ }
463
+ },
464
+ async equals_$(x_, y_, $task) {
465
+ {
466
+ const x_a = x_;
467
+ const y_a = y_;
468
+ {
469
+ const _guard1 = (x_ === y_);
470
+ if(_guard1) {
471
+ return true
472
+ return
473
+ }
474
+ }
475
+ {
476
+ return ((x_.modulePrefix_ === y_.modulePrefix_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme).equals_(x_.symbols_, y_.symbols_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DTrait).equals_(x_.traits_, y_.traits_) && (ff_core_Map.ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_DImport).equals_(x_.imports_, y_.imports_) && (ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type.equals_(x_.effect_, y_.effect_) && ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.selfVariable_, y_.selfVariable_))))))
477
+ return
478
+ }
479
+ }
480
+ }
481
+ };
482
+
483
+ export const ff_core_Equal_Equal$ff_compiler_Environment_Scheme = {
484
+ equals_(x_, y_) {
485
+ {
486
+ const x_a = x_;
487
+ const y_a = y_;
488
+ {
489
+ const _guard1 = (x_ === y_);
490
+ if(_guard1) {
491
+ return true
492
+ return
493
+ }
494
+ }
495
+ {
496
+ return ((x_.isVariable_ === y_.isVariable_) && ((x_.isMutable_ === y_.isMutable_) && ((x_.isNewtype_ === y_.isNewtype_) && ((x_.isTraitMethod_ === y_.isTraitMethod_) && ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Signature.equals_(x_.signature_, y_.signature_)))))
497
+ return
498
+ }
499
+ }
500
+ },
501
+ async equals_$(x_, y_, $task) {
502
+ {
503
+ const x_a = x_;
504
+ const y_a = y_;
505
+ {
506
+ const _guard1 = (x_ === y_);
507
+ if(_guard1) {
508
+ return true
509
+ return
510
+ }
511
+ }
512
+ {
513
+ return ((x_.isVariable_ === y_.isVariable_) && ((x_.isMutable_ === y_.isMutable_) && ((x_.isNewtype_ === y_.isNewtype_) && ((x_.isTraitMethod_ === y_.isTraitMethod_) && ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Signature.equals_(x_.signature_, y_.signature_)))))
514
+ return
515
+ }
516
+ }
517
+ }
518
+ };
519
+
520
+ export const ff_core_Equal_Equal$ff_compiler_Environment_Instantiated = {
521
+ equals_(x_, y_) {
522
+ {
523
+ const x_a = x_;
524
+ const y_a = y_;
525
+ {
526
+ const _guard1 = (x_ === y_);
527
+ if(_guard1) {
528
+ return true
529
+ return
530
+ }
531
+ }
532
+ {
533
+ return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type)).equals_(x_.typeArguments_, y_.typeArguments_) && ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme.equals_(x_.scheme_, y_.scheme_))
534
+ return
535
+ }
536
+ }
537
+ },
538
+ async equals_$(x_, y_, $task) {
539
+ {
540
+ const x_a = x_;
541
+ const y_a = y_;
542
+ {
543
+ const _guard1 = (x_ === y_);
544
+ if(_guard1) {
545
+ return true
546
+ return
547
+ }
548
+ }
549
+ {
550
+ return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String, ff_compiler_Syntax.ff_core_Equal_Equal$ff_compiler_Syntax_Type)).equals_(x_.typeArguments_, y_.typeArguments_) && ff_compiler_Environment.ff_core_Equal_Equal$ff_compiler_Environment_Scheme.equals_(x_.scheme_, y_.scheme_))
551
+ return
552
+ }
553
+ }
554
+ }
555
+ };
556
+
557
+ export const ff_core_Ordering_Order$ff_compiler_Environment_Environment = {
558
+ compare_(x_, y_) {
559
+ {
560
+ const x_a = x_;
561
+ const y_a = y_;
562
+ {
563
+ const _guard1 = (x_ === y_);
564
+ if(_guard1) {
565
+ return ff_core_Ordering.OrderingSame()
566
+ return
567
+ }
568
+ }
569
+ {
570
+ const modulePrefixOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.modulePrefix_, y_.modulePrefix_);
571
+ if((modulePrefixOrdering_ !== ff_core_Ordering.OrderingSame())) {
572
+ return modulePrefixOrdering_
573
+ } else {
574
+ const symbolsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme).compare_(x_.symbols_, y_.symbols_);
575
+ if((symbolsOrdering_ !== ff_core_Ordering.OrderingSame())) {
576
+ return symbolsOrdering_
577
+ } else {
578
+ const traitsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DTrait).compare_(x_.traits_, y_.traits_);
579
+ if((traitsOrdering_ !== ff_core_Ordering.OrderingSame())) {
580
+ return traitsOrdering_
581
+ } else {
582
+ const importsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DImport).compare_(x_.imports_, y_.imports_);
583
+ if((importsOrdering_ !== ff_core_Ordering.OrderingSame())) {
584
+ return importsOrdering_
585
+ } else {
586
+ const effectOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type.compare_(x_.effect_, y_.effect_);
587
+ if((effectOrdering_ !== ff_core_Ordering.OrderingSame())) {
588
+ return effectOrdering_
589
+ } else {
590
+ const selfVariableOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.selfVariable_, y_.selfVariable_);
591
+ if((selfVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
592
+ return selfVariableOrdering_
593
+ } else {
594
+ return ff_core_Ordering.OrderingSame()
595
+ }
596
+ }
597
+ }
598
+ }
599
+ }
600
+ }
601
+ return
602
+ }
603
+ }
604
+ },
605
+ async compare_$(x_, y_, $task) {
606
+ {
607
+ const x_a = x_;
608
+ const y_a = y_;
609
+ {
610
+ const _guard1 = (x_ === y_);
611
+ if(_guard1) {
612
+ return ff_core_Ordering.OrderingSame()
613
+ return
614
+ }
615
+ }
616
+ {
617
+ const modulePrefixOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.modulePrefix_, y_.modulePrefix_);
618
+ if((modulePrefixOrdering_ !== ff_core_Ordering.OrderingSame())) {
619
+ return modulePrefixOrdering_
620
+ } else {
621
+ const symbolsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme).compare_(x_.symbols_, y_.symbols_);
622
+ if((symbolsOrdering_ !== ff_core_Ordering.OrderingSame())) {
623
+ return symbolsOrdering_
624
+ } else {
625
+ const traitsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DTrait).compare_(x_.traits_, y_.traits_);
626
+ if((traitsOrdering_ !== ff_core_Ordering.OrderingSame())) {
627
+ return traitsOrdering_
628
+ } else {
629
+ const importsOrdering_ = ff_core_Map.ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_DImport).compare_(x_.imports_, y_.imports_);
630
+ if((importsOrdering_ !== ff_core_Ordering.OrderingSame())) {
631
+ return importsOrdering_
632
+ } else {
633
+ const effectOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type.compare_(x_.effect_, y_.effect_);
634
+ if((effectOrdering_ !== ff_core_Ordering.OrderingSame())) {
635
+ return effectOrdering_
636
+ } else {
637
+ const selfVariableOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.selfVariable_, y_.selfVariable_);
638
+ if((selfVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
639
+ return selfVariableOrdering_
640
+ } else {
641
+ return ff_core_Ordering.OrderingSame()
642
+ }
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ return
649
+ }
650
+ }
651
+ }
652
+ };
653
+
654
+ export const ff_core_Ordering_Order$ff_compiler_Environment_Scheme = {
655
+ compare_(x_, y_) {
656
+ {
657
+ const x_a = x_;
658
+ const y_a = y_;
659
+ {
660
+ const _guard1 = (x_ === y_);
661
+ if(_guard1) {
662
+ return ff_core_Ordering.OrderingSame()
663
+ return
664
+ }
665
+ }
666
+ {
667
+ const isVariableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isVariable_, y_.isVariable_);
668
+ if((isVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
669
+ return isVariableOrdering_
670
+ } else {
671
+ const isMutableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isMutable_, y_.isMutable_);
672
+ if((isMutableOrdering_ !== ff_core_Ordering.OrderingSame())) {
673
+ return isMutableOrdering_
674
+ } else {
675
+ const isNewtypeOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isNewtype_, y_.isNewtype_);
676
+ if((isNewtypeOrdering_ !== ff_core_Ordering.OrderingSame())) {
677
+ return isNewtypeOrdering_
678
+ } else {
679
+ const isTraitMethodOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isTraitMethod_, y_.isTraitMethod_);
680
+ if((isTraitMethodOrdering_ !== ff_core_Ordering.OrderingSame())) {
681
+ return isTraitMethodOrdering_
682
+ } else {
683
+ const signatureOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Signature.compare_(x_.signature_, y_.signature_);
684
+ if((signatureOrdering_ !== ff_core_Ordering.OrderingSame())) {
685
+ return signatureOrdering_
686
+ } else {
687
+ return ff_core_Ordering.OrderingSame()
688
+ }
689
+ }
690
+ }
691
+ }
692
+ }
693
+ return
694
+ }
695
+ }
696
+ },
697
+ async compare_$(x_, y_, $task) {
698
+ {
699
+ const x_a = x_;
700
+ const y_a = y_;
701
+ {
702
+ const _guard1 = (x_ === y_);
703
+ if(_guard1) {
704
+ return ff_core_Ordering.OrderingSame()
705
+ return
706
+ }
707
+ }
708
+ {
709
+ const isVariableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isVariable_, y_.isVariable_);
710
+ if((isVariableOrdering_ !== ff_core_Ordering.OrderingSame())) {
711
+ return isVariableOrdering_
712
+ } else {
713
+ const isMutableOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isMutable_, y_.isMutable_);
714
+ if((isMutableOrdering_ !== ff_core_Ordering.OrderingSame())) {
715
+ return isMutableOrdering_
716
+ } else {
717
+ const isNewtypeOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isNewtype_, y_.isNewtype_);
718
+ if((isNewtypeOrdering_ !== ff_core_Ordering.OrderingSame())) {
719
+ return isNewtypeOrdering_
720
+ } else {
721
+ const isTraitMethodOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_Bool_Bool.compare_(x_.isTraitMethod_, y_.isTraitMethod_);
722
+ if((isTraitMethodOrdering_ !== ff_core_Ordering.OrderingSame())) {
723
+ return isTraitMethodOrdering_
724
+ } else {
725
+ const signatureOrdering_ = ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Signature.compare_(x_.signature_, y_.signature_);
726
+ if((signatureOrdering_ !== ff_core_Ordering.OrderingSame())) {
727
+ return signatureOrdering_
728
+ } else {
729
+ return ff_core_Ordering.OrderingSame()
730
+ }
731
+ }
732
+ }
733
+ }
734
+ }
735
+ return
736
+ }
737
+ }
738
+ }
739
+ };
740
+
741
+ export const ff_core_Ordering_Order$ff_compiler_Environment_Instantiated = {
742
+ compare_(x_, y_) {
743
+ {
744
+ const x_a = x_;
745
+ const y_a = y_;
746
+ {
747
+ const _guard1 = (x_ === y_);
748
+ if(_guard1) {
749
+ return ff_core_Ordering.OrderingSame()
750
+ return
751
+ }
752
+ }
753
+ {
754
+ const typeArgumentsOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type)).compare_(x_.typeArguments_, y_.typeArguments_);
755
+ if((typeArgumentsOrdering_ !== ff_core_Ordering.OrderingSame())) {
756
+ return typeArgumentsOrdering_
757
+ } else {
758
+ const schemeOrdering_ = ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme.compare_(x_.scheme_, y_.scheme_);
759
+ if((schemeOrdering_ !== ff_core_Ordering.OrderingSame())) {
760
+ return schemeOrdering_
761
+ } else {
762
+ return ff_core_Ordering.OrderingSame()
763
+ }
764
+ }
765
+ return
766
+ }
767
+ }
768
+ },
769
+ async compare_$(x_, y_, $task) {
770
+ {
771
+ const x_a = x_;
772
+ const y_a = y_;
773
+ {
774
+ const _guard1 = (x_ === y_);
775
+ if(_guard1) {
776
+ return ff_core_Ordering.OrderingSame()
777
+ return
778
+ }
779
+ }
780
+ {
781
+ const typeArgumentsOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Ordering_Order$ff_compiler_Syntax_Type)).compare_(x_.typeArguments_, y_.typeArguments_);
782
+ if((typeArgumentsOrdering_ !== ff_core_Ordering.OrderingSame())) {
783
+ return typeArgumentsOrdering_
784
+ } else {
785
+ const schemeOrdering_ = ff_compiler_Environment.ff_core_Ordering_Order$ff_compiler_Environment_Scheme.compare_(x_.scheme_, y_.scheme_);
786
+ if((schemeOrdering_ !== ff_core_Ordering.OrderingSame())) {
787
+ return schemeOrdering_
788
+ } else {
789
+ return ff_core_Ordering.OrderingSame()
790
+ }
791
+ }
792
+ return
793
+ }
794
+ }
795
+ }
796
+ };
797
+
798
+ export const ff_core_Serializable_Serializable$ff_compiler_Environment_Environment = {
799
+ serializeUsing_(serialization_, value_) {
800
+ {
801
+ const serialization_a = serialization_;
802
+ const value_a = value_;
803
+ {
804
+ const v_ = value_a;
805
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
806
+ ff_core_Serializable.Serialization_autoResize(serialization_, 1);
807
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
808
+ serialization_.offset_ += 1;
809
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.modulePrefix_);
810
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).serializeUsing_(serialization_, v_.symbols_);
811
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).serializeUsing_(serialization_, v_.traits_);
812
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).serializeUsing_(serialization_, v_.imports_);
813
+ ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.serializeUsing_(serialization_, v_.effect_);
814
+ ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.selfVariable_)
815
+ return
816
+ }
817
+ }
818
+ },
819
+ deserializeUsing_(serialization_) {
820
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
821
+ serialization_.offset_ += 1;
822
+ {
823
+ const _1 = variantIndex_;
824
+ {
825
+ if(_1 == 0) {
826
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
827
+ return ff_compiler_Environment.Environment(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
828
+ return
829
+ }
830
+ }
831
+ {
832
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
833
+ return
834
+ }
835
+ }
836
+ },
837
+ async serializeUsing_$(serialization_, value_, $task) {
838
+ {
839
+ const serialization_a = serialization_;
840
+ const value_a = value_;
841
+ {
842
+ const v_ = value_a;
843
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
844
+ ff_core_Serializable.Serialization_autoResize(serialization_, 1);
845
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
846
+ serialization_.offset_ += 1;
847
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.modulePrefix_);
848
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).serializeUsing_(serialization_, v_.symbols_);
849
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).serializeUsing_(serialization_, v_.traits_);
850
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).serializeUsing_(serialization_, v_.imports_);
851
+ ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.serializeUsing_(serialization_, v_.effect_);
852
+ ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.selfVariable_)
853
+ return
854
+ }
855
+ }
856
+ },
857
+ async deserializeUsing_$(serialization_, $task) {
858
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
859
+ serialization_.offset_ += 1;
860
+ {
861
+ const _1 = variantIndex_;
862
+ {
863
+ if(_1 == 0) {
864
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
865
+ return ff_compiler_Environment.Environment(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DTrait).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_DImport).deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_))
866
+ return
867
+ }
868
+ }
869
+ {
870
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
871
+ return
872
+ }
873
+ }
874
+ }
875
+ };
876
+
877
+ export const ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme = {
878
+ serializeUsing_(serialization_, value_) {
879
+ {
880
+ const serialization_a = serialization_;
881
+ const value_a = value_;
882
+ {
883
+ const v_ = value_a;
884
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
885
+ ff_core_Serializable.Serialization_autoResize(serialization_, 1);
886
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
887
+ serialization_.offset_ += 1;
888
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isVariable_);
889
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isMutable_);
890
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isNewtype_);
891
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isTraitMethod_);
892
+ ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.serializeUsing_(serialization_, v_.signature_)
893
+ return
894
+ }
895
+ }
896
+ },
897
+ deserializeUsing_(serialization_) {
898
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
899
+ serialization_.offset_ += 1;
900
+ {
901
+ const _1 = variantIndex_;
902
+ {
903
+ if(_1 == 0) {
904
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
905
+ return ff_compiler_Environment.Scheme(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.deserializeUsing_(serialization_))
906
+ return
907
+ }
908
+ }
909
+ {
910
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
911
+ return
912
+ }
913
+ }
914
+ },
915
+ async serializeUsing_$(serialization_, value_, $task) {
916
+ {
917
+ const serialization_a = serialization_;
918
+ const value_a = value_;
919
+ {
920
+ const v_ = value_a;
921
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
922
+ ff_core_Serializable.Serialization_autoResize(serialization_, 1);
923
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
924
+ serialization_.offset_ += 1;
925
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isVariable_);
926
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isMutable_);
927
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isNewtype_);
928
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.serializeUsing_(serialization_, v_.isTraitMethod_);
929
+ ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.serializeUsing_(serialization_, v_.signature_)
930
+ return
931
+ }
932
+ }
933
+ },
934
+ async deserializeUsing_$(serialization_, $task) {
935
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
936
+ serialization_.offset_ += 1;
937
+ {
938
+ const _1 = variantIndex_;
939
+ {
940
+ if(_1 == 0) {
941
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
942
+ return ff_compiler_Environment.Scheme(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_), ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Signature.deserializeUsing_(serialization_))
943
+ return
944
+ }
945
+ }
946
+ {
947
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
948
+ return
949
+ }
950
+ }
951
+ }
952
+ };
953
+
954
+ export const ff_core_Serializable_Serializable$ff_compiler_Environment_Instantiated = {
955
+ serializeUsing_(serialization_, value_) {
956
+ {
957
+ const serialization_a = serialization_;
958
+ const value_a = value_;
959
+ {
960
+ const v_ = value_a;
961
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
962
+ ff_core_Serializable.Serialization_autoResize(serialization_, 1);
963
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
964
+ serialization_.offset_ += 1;
965
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).serializeUsing_(serialization_, v_.typeArguments_);
966
+ ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.serializeUsing_(serialization_, v_.scheme_)
967
+ return
968
+ }
969
+ }
970
+ },
971
+ deserializeUsing_(serialization_) {
972
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
973
+ serialization_.offset_ += 1;
974
+ {
975
+ const _1 = variantIndex_;
976
+ {
977
+ if(_1 == 0) {
978
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
979
+ return ff_compiler_Environment.Instantiated(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).deserializeUsing_(serialization_), ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.deserializeUsing_(serialization_))
980
+ return
981
+ }
982
+ }
983
+ {
984
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
985
+ return
986
+ }
987
+ }
988
+ },
989
+ async serializeUsing_$(serialization_, value_, $task) {
990
+ {
991
+ const serialization_a = serialization_;
992
+ const value_a = value_;
993
+ {
994
+ const v_ = value_a;
995
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
996
+ ff_core_Serializable.Serialization_autoResize(serialization_, 1);
997
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
998
+ serialization_.offset_ += 1;
999
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).serializeUsing_(serialization_, v_.typeArguments_);
1000
+ ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.serializeUsing_(serialization_, v_.scheme_)
1001
+ return
1002
+ }
1003
+ }
1004
+ },
1005
+ async deserializeUsing_$(serialization_, $task) {
1006
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1007
+ serialization_.offset_ += 1;
1008
+ {
1009
+ const _1 = variantIndex_;
1010
+ {
1011
+ if(_1 == 0) {
1012
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
1013
+ return ff_compiler_Environment.Instantiated(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Syntax.ff_core_Serializable_Serializable$ff_compiler_Syntax_Type)).deserializeUsing_(serialization_), ff_compiler_Environment.ff_core_Serializable_Serializable$ff_compiler_Environment_Scheme.deserializeUsing_(serialization_))
1014
+ return
1015
+ }
1016
+ }
1017
+ {
1018
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1019
+ return
1020
+ }
1021
+ }
1022
+ }
1023
+ };
1024
+
1025
+