firefly-compiler 0.4.16 → 0.4.17

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 (83) hide show
  1. package/compiler/Compiler.ff +0 -1
  2. package/compiler/Deriver.ff +3 -3
  3. package/core/Array.ff +154 -2
  4. package/core/BrowserSystem.ff +0 -4
  5. package/core/Int.ff +2 -2
  6. package/core/IntMap.ff +11 -0
  7. package/core/List.ff +2 -2
  8. package/core/Map.ff +11 -0
  9. package/core/StringMap.ff +11 -0
  10. package/guide/Main.ff +2 -1
  11. package/output/js/ff/compiler/Builder.mjs +0 -2
  12. package/output/js/ff/compiler/Compiler.mjs +1 -3
  13. package/output/js/ff/compiler/Dependencies.mjs +0 -2
  14. package/output/js/ff/compiler/Deriver.mjs +4 -6
  15. package/output/js/ff/compiler/Dictionaries.mjs +0 -2
  16. package/output/js/ff/compiler/Environment.mjs +0 -2
  17. package/output/js/ff/compiler/Inference.mjs +0 -2
  18. package/output/js/ff/compiler/JsEmitter.mjs +0 -2
  19. package/output/js/ff/compiler/JsImporter.mjs +0 -2
  20. package/output/js/ff/compiler/LspHook.mjs +0 -2
  21. package/output/js/ff/compiler/Main.mjs +0 -2
  22. package/output/js/ff/compiler/Parser.mjs +0 -2
  23. package/output/js/ff/compiler/Patterns.mjs +0 -2
  24. package/output/js/ff/compiler/Resolver.mjs +0 -2
  25. package/output/js/ff/compiler/Substitution.mjs +0 -2
  26. package/output/js/ff/compiler/Syntax.mjs +0 -2
  27. package/output/js/ff/compiler/Token.mjs +0 -2
  28. package/output/js/ff/compiler/Tokenizer.mjs +0 -2
  29. package/output/js/ff/compiler/Unification.mjs +0 -2
  30. package/output/js/ff/compiler/Wildcards.mjs +0 -2
  31. package/output/js/ff/compiler/Workspace.mjs +0 -2
  32. package/output/js/ff/core/Any.mjs +0 -2
  33. package/output/js/ff/core/Array.mjs +368 -4
  34. package/output/js/ff/core/AssetSystem.mjs +0 -2
  35. package/output/js/ff/core/Atomic.mjs +0 -2
  36. package/output/js/ff/core/Bool.mjs +0 -2
  37. package/output/js/ff/core/Box.mjs +0 -2
  38. package/output/js/ff/core/BrowserSystem.mjs +0 -10
  39. package/output/js/ff/core/Buffer.mjs +0 -2
  40. package/output/js/ff/core/BuildSystem.mjs +0 -2
  41. package/output/js/ff/core/Channel.mjs +0 -2
  42. package/output/js/ff/core/Char.mjs +0 -2
  43. package/output/js/ff/core/Core.mjs +0 -2
  44. package/output/js/ff/core/Duration.mjs +0 -2
  45. package/output/js/ff/core/Equal.mjs +0 -2
  46. package/output/js/ff/core/Error.mjs +0 -2
  47. package/output/js/ff/core/FileHandle.mjs +0 -2
  48. package/output/js/ff/core/Float.mjs +0 -2
  49. package/output/js/ff/core/HttpClient.mjs +0 -2
  50. package/output/js/ff/core/Instant.mjs +0 -2
  51. package/output/js/ff/core/Int.mjs +4 -6
  52. package/output/js/ff/core/IntMap.mjs +38 -2
  53. package/output/js/ff/core/JsSystem.mjs +0 -2
  54. package/output/js/ff/core/JsValue.mjs +0 -2
  55. package/output/js/ff/core/Json.mjs +0 -2
  56. package/output/js/ff/core/List.mjs +4 -6
  57. package/output/js/ff/core/Lock.mjs +0 -2
  58. package/output/js/ff/core/Log.mjs +0 -2
  59. package/output/js/ff/core/Map.mjs +40 -2
  60. package/output/js/ff/core/NodeSystem.mjs +0 -2
  61. package/output/js/ff/core/Nothing.mjs +0 -2
  62. package/output/js/ff/core/Option.mjs +0 -2
  63. package/output/js/ff/core/Ordering.mjs +0 -2
  64. package/output/js/ff/core/Pair.mjs +0 -2
  65. package/output/js/ff/core/Path.mjs +0 -2
  66. package/output/js/ff/core/Random.mjs +0 -2
  67. package/output/js/ff/core/RbMap.mjs +0 -2
  68. package/output/js/ff/core/Serializable.mjs +0 -2
  69. package/output/js/ff/core/Set.mjs +0 -2
  70. package/output/js/ff/core/Show.mjs +0 -2
  71. package/output/js/ff/core/SourceLocation.mjs +0 -2
  72. package/output/js/ff/core/Stack.mjs +0 -2
  73. package/output/js/ff/core/Stream.mjs +0 -2
  74. package/output/js/ff/core/String.mjs +0 -2
  75. package/output/js/ff/core/StringMap.mjs +38 -2
  76. package/output/js/ff/core/Task.mjs +0 -2
  77. package/output/js/ff/core/Try.mjs +0 -2
  78. package/output/js/ff/core/Unit.mjs +0 -2
  79. package/package.json +1 -1
  80. package/vscode/package.json +1 -1
  81. package/websocket/.firefly/package.ff +1 -0
  82. package/{core → websocket}/WebSocket.ff +4 -0
  83. package/output/js/ff/core/WebSocket.mjs +0 -200
@@ -107,7 +107,6 @@ coreImports: List[DImport] =
107
107
  "Task"
108
108
  "Try"
109
109
  "Unit"
110
- "WebSocket"
111
110
  ].map {moduleName =>
112
111
  DImport(
113
112
  at = Location("<prelude>", 1, 1)
@@ -73,10 +73,10 @@ extend self: Deriver {
73
73
  self.makeMethodCall(at, self.makeSimpleCall(at, "ff:core/Any.anyTag", [], [_]), "show", [])
74
74
  }
75
75
  let strings =
76
- [EString(at, "\"[\""), ...typeArgumentStrings.insertBetween([EString(at, "\",\"")]), EString(at, "\"]\"")]
76
+ [EString(at, "\"[\""), ...typeArgumentStrings.separate([EString(at, "\",\"")]), EString(at, "\"]\"")]
77
77
  let body = FireflyTarget(
78
78
  Lambda(at, noEffect, [MatchCase(
79
- at = at,
79
+ at = at
80
80
  patterns = []
81
81
  guards = []
82
82
  body = self.makeSimpleCall(at, "ff:core/Any.internalAnyTag", [
@@ -160,7 +160,7 @@ extend self: Deriver {
160
160
  self.makeSimpleCall(at, "ff:core/Show.show", [
161
161
  EField(at, False, EVariable(at, "z"), field.name)
162
162
  ])
163
- }.insertBetween([EString(at, "\", \"")])
163
+ }.separate([EString(at, "\", \"")])
164
164
  EString(at, "\")\"")
165
165
  ]}
166
166
  MatchCase(
package/core/Array.ff CHANGED
@@ -73,7 +73,32 @@ extend self[T]: Array[T] {
73
73
  dropLast(count: Int = 1): Array[T]
74
74
  target js sync "return self_.slice(0, self_.length - count_)"
75
75
 
76
- update(index: Int, body: T => T): Array[T]
76
+ pairs(): Array[Pair[Int, T]] {
77
+ mutable i = 0
78
+ self.map {x =>
79
+ let r = Pair(i, x)
80
+ i += 1
81
+ r
82
+ }
83
+ }
84
+
85
+ slice(from: Int, until: Int): Array[T] {
86
+ self.dropFirst(from).takeFirst(until - from)
87
+ }
88
+
89
+ foldLeft[R](initial: R, body: (R, T) => R): R {
90
+ mutable result = initial
91
+ self.each {x =>
92
+ result = body(result, x)
93
+ }
94
+ result
95
+ }
96
+
97
+ update(index: Int, value: T): Array[T] {
98
+ self.modify(index) {_ => value}
99
+ }
100
+
101
+ modify(index: Int, body: T => T): Array[T]
77
102
  target js sync """
78
103
  if(index_ < 0 || index_ >= self_.length) {
79
104
  ff_core_Try.internalThrowGrabException_()
@@ -90,12 +115,28 @@ extend self[T]: Array[T] {
90
115
  result[index_] = await body_(result[index_], $task);
91
116
  return result;
92
117
  """
118
+
119
+ zip[S](that: Array[S]): Array[Pair[T, S]] {
120
+ if(self.size() <= that.size()) {
121
+ mutable i = -1
122
+ self.map {x =>
123
+ i += 1
124
+ Pair(x, that.grab(i))
125
+ }
126
+ } else {
127
+ mutable i = -1
128
+ that.map {y =>
129
+ i += 1
130
+ Pair(self.grab(i), y)
131
+ }
132
+ }
133
+ }
93
134
 
94
135
  chunk(chunkSize: Int): Array[Array[T]] {
95
136
  let results = Stack.make()
96
137
  let result = Stack.make()
97
138
  mutable added = 0
98
- self.each { item =>
139
+ self.each {item =>
99
140
  if(added < chunkSize) {
100
141
  added += 1
101
142
  } else {
@@ -168,6 +209,33 @@ extend self[T]: Array[T] {
168
209
  }
169
210
  result
170
211
  }
212
+
213
+ find(body: T => Bool): Option[T] {
214
+ mutable result = None
215
+ self.eachWhile {x =>
216
+ if(body(x)) {
217
+ result = Some(x)
218
+ False
219
+ } else {
220
+ True
221
+ }
222
+ }
223
+ result
224
+ }
225
+
226
+ filter(body: T => Bool): Array[T] {
227
+ let result = Stack.make()
228
+ self.each {x =>
229
+ if(body(x)) {
230
+ result.push(x)
231
+ }
232
+ }
233
+ result.drain()
234
+ }
235
+
236
+ partition(body: T => Bool): Pair[Array[T], Array[T]] {
237
+ Pair(self.filter(body), self.filter {!body(_)})
238
+ }
171
239
 
172
240
  map[S](body: T => S): Array[S]
173
241
  target js sync """
@@ -188,6 +256,28 @@ extend self[T]: Array[T] {
188
256
  }
189
257
  results.drain()
190
258
  }
259
+
260
+ collect[R](body: T => Option[R]): Array[R] {
261
+ mutable result = Stack.make()
262
+ self.each {x =>
263
+ body(x).each {result.push(_)}
264
+ }
265
+ result.drain()
266
+ }
267
+
268
+ collectFirst[R](body: T => Option[R]): Option[R] {
269
+ mutable result = None
270
+ self.eachWhile {x =>
271
+ body(x).{
272
+ | None =>
273
+ True
274
+ | o =>
275
+ result = o
276
+ False
277
+ }
278
+ }
279
+ result
280
+ }
191
281
 
192
282
  sortBy[S: Order](body: T => S): Array[T] {
193
283
  self.sortWith {Ordering.compare(body(_), body(_))}
@@ -198,6 +288,23 @@ extend self[T]: Array[T] {
198
288
  stack.sortWith(ordering)
199
289
  stack.drain()
200
290
  }
291
+
292
+ reverse(): Array[T] {
293
+ 1.to(self.size()).toArray().map {i =>
294
+ self.grab(self.size() - i)
295
+ }
296
+ }
297
+
298
+ separate(separator: Array[T]): Array[T] {
299
+ let stack = Stack.make()
300
+ self.pairs().each {| Pair(i, x) =>
301
+ if(i != 0) {
302
+ stack.pushArray(separator)
303
+ }
304
+ stack.push(x)
305
+ }
306
+ stack.drain()
307
+ }
201
308
 
202
309
  }
203
310
 
@@ -210,13 +317,58 @@ extend self[T: Order]: Array[T] {
210
317
  toSet(): Set[T] {
211
318
  self.toList().toSet()
212
319
  }
320
+
321
+ distinct(): Array[T] {
322
+ mutable seen = [].toSet()
323
+ self.filter {
324
+ | item {!seen.contains(item)} =>
325
+ seen = seen.add(item)
326
+ True
327
+ | _ =>
328
+ False
329
+ }
330
+ }
331
+
332
+ }
333
+
334
+ extend self[T]: Array[Array[T]] {
335
+
336
+ flatten(): Array[T] {
337
+ let result = Stack.make()
338
+ self.each {xs =>
339
+ result.pushArray(xs)
340
+ }
341
+ result.drain()
342
+ }
213
343
 
214
344
  }
215
345
 
216
346
  extend self[K: Order, V]: Array[Pair[K, V]] {
347
+
217
348
  toMap(): Map[K, V] {
218
349
  self.toList().toMap()
219
350
  }
351
+
352
+ group(): Map[K, Array[V]] {
353
+ mutable map = Map.empty[K, Stack[V]]()
354
+ self.each {| Pair(k, v) => map = map.push(k, v)}
355
+ map.mapValues {_, v => v.drain()}
356
+ }
357
+
358
+ }
359
+
360
+ extend self[K, V]: Array[Pair[K, V]] {
361
+
362
+ unzip(): Pair[Array[K], Array[V]] {
363
+ let first = Stack.make()
364
+ let second = Stack.make()
365
+ self.each {| Pair(x, y) =>
366
+ first.push(x)
367
+ second.push(y)
368
+ }
369
+ Pair(first.drain(), second.drain())
370
+ }
371
+
220
372
  }
221
373
 
222
374
  extend self: Array[String] {
@@ -4,10 +4,6 @@ extend self: BrowserSystem {
4
4
 
5
5
  httpClient(): HttpClient
6
6
  target js async "return null"
7
-
8
- webSocket(url: String): WebSocket {
9
- WebSocket.internalOpenBrowserWebSocket(self, url)
10
- }
11
7
 
12
8
  mainTask(): Task
13
9
  target js async "return self_.task_"
package/core/Int.ff CHANGED
@@ -20,10 +20,10 @@ extend self: Int {
20
20
  bitXor(that: Int): Int
21
21
  target js sync "return self_ ^ that_;"
22
22
 
23
- bitLeft(bits: Int = 1): Int
23
+ bitLeft(bits: Int): Int
24
24
  target js sync "return self_ << bits_;"
25
25
 
26
- bitRight(bits: Int = 1, signed: Bool = True): Int
26
+ bitRight(bits: Int, signed: Bool = True): Int
27
27
  target js sync "return signed_ ? self_ >> bits_ : self_ >>> bits_;"
28
28
 
29
29
  to(inclusiveEnd: Int): List[Int] {
package/core/IntMap.ff CHANGED
@@ -83,3 +83,14 @@ extend self[V]: IntMap[V] {
83
83
  }
84
84
 
85
85
  }
86
+
87
+ extend self[V]: IntMap[Stack[V]] {
88
+
89
+ push(key: Int, value: V) {
90
+ self.get(key).{
91
+ | None => self.set(key, [value].toStack())
92
+ | Some(stack) => stack.push(value)
93
+ }
94
+ }
95
+
96
+ }
package/core/List.ff CHANGED
@@ -241,7 +241,7 @@ extend self[T]: List[T] {
241
241
  go(initial, self)
242
242
  }
243
243
 
244
- updated(index: Int, value: T): List[T] {
244
+ update(index: Int, value: T): List[T] {
245
245
  function go(list: List[T], i: Int, result: List[T]): List[T] {
246
246
  list.{
247
247
  | [] =>
@@ -348,7 +348,7 @@ extend self[T]: List[T] {
348
348
  )
349
349
  }
350
350
 
351
- insertBetween(separator: List[T]): List[T] {
351
+ separate(separator: List[T]): List[T] {
352
352
  self.flatMap {e => [...separator, e]}.dropFirst(separator.size())
353
353
  }
354
354
 
package/core/Map.ff CHANGED
@@ -107,6 +107,17 @@ extend self[K: Order, V]: Map[K, List[V]] {
107
107
 
108
108
  }
109
109
 
110
+ extend self[K: Order, V]: Map[K, Stack[V]] {
111
+
112
+ push(key: K, value: V): Map[K, Stack[V]] {
113
+ self.get(key).{
114
+ | None => self.add(key, [value].toStack())
115
+ | Some(stack) => stack.push(value); self
116
+ }
117
+ }
118
+
119
+ }
120
+
110
121
  instance Map[K: Equal: Order, V: Equal]: Equal {
111
122
  equals(x: Map[K, V], y: Map[K, V]): Bool {
112
123
  Equal.equals(x.pairs(), y.pairs())
package/core/StringMap.ff CHANGED
@@ -83,3 +83,14 @@ extend self[V]: StringMap[V] {
83
83
  }
84
84
 
85
85
  }
86
+
87
+ extend self[V]: StringMap[Stack[V]] {
88
+
89
+ push(key: String, value: V) {
90
+ self.get(key).{
91
+ | None => self.set(key, [value].toStack())
92
+ | Some(stack) => stack.push(value)
93
+ }
94
+ }
95
+
96
+ }
package/guide/Main.ff CHANGED
@@ -1,3 +1,4 @@
1
1
  nodeMain(system: NodeSystem) {
2
- Json.object()
2
+ let text = system.httpClient().fetch("https://www.example.com/").readText()
3
+ system.writeLine(text)
3
4
  }
@@ -112,8 +112,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
112
112
 
113
113
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
114
114
 
115
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
116
-
117
115
  // type PackageFiles
118
116
  export function PackageFiles(root_, packageFile_, files_) {
119
117
  return {root_, packageFile_, files_};
@@ -114,14 +114,12 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
114
114
 
115
115
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
116
116
 
117
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
118
-
119
117
  // type Compiler
120
118
  export function Compiler(emitTarget_, task_, compilerModulePath_, jsOutputPath_, packagePaths_, singleFilePackages_, virtualFiles_, lspHook_, parsedModules_, resolvedModules_, derivedModules_, inferredModules_, emittedModules_, phaseDurations_, phaseDurationDelta_) {
121
119
  return {emitTarget_, task_, compilerModulePath_, jsOutputPath_, packagePaths_, singleFilePackages_, virtualFiles_, lspHook_, parsedModules_, resolvedModules_, derivedModules_, inferredModules_, emittedModules_, phaseDurations_, phaseDurationDelta_};
122
120
  }
123
121
 
124
- export const coreImports_ = ff_core_List.List_map(ff_core_List.Link("Any", ff_core_List.Link("Array", ff_core_List.Link("AssetSystem", ff_core_List.Link("Atomic", ff_core_List.Link("Bool", ff_core_List.Link("Box", ff_core_List.Link("BrowserSystem", ff_core_List.Link("Buffer", ff_core_List.Link("BuildSystem", ff_core_List.Link("Channel", ff_core_List.Link("Char", ff_core_List.Link("Core", ff_core_List.Link("Duration", ff_core_List.Link("Equal", ff_core_List.Link("Error", ff_core_List.Link("FileHandle", ff_core_List.Link("Float", ff_core_List.Link("HttpClient", ff_core_List.Link("Instant", ff_core_List.Link("Int", ff_core_List.Link("IntMap", ff_core_List.Link("Json", ff_core_List.Link("JsValue", ff_core_List.Link("JsSystem", ff_core_List.Link("List", ff_core_List.Link("Lock", ff_core_List.Link("Log", ff_core_List.Link("Map", ff_core_List.Link("NodeSystem", ff_core_List.Link("Nothing", ff_core_List.Link("Option", ff_core_List.Link("Ordering", ff_core_List.Link("Pair", ff_core_List.Link("Path", ff_core_List.Link("Random", ff_core_List.Link("Serializable", ff_core_List.Link("Set", ff_core_List.Link("Show", ff_core_List.Link("SourceLocation", ff_core_List.Link("Stack", ff_core_List.Link("Stream", ff_core_List.Link("String", ff_core_List.Link("StringMap", ff_core_List.Link("Task", ff_core_List.Link("Try", ff_core_List.Link("Unit", ff_core_List.Link("WebSocket", ff_core_List.Empty()))))))))))))))))))))))))))))))))))))))))))))))), ((moduleName_) => {
122
+ export const coreImports_ = ff_core_List.List_map(ff_core_List.Link("Any", ff_core_List.Link("Array", ff_core_List.Link("AssetSystem", ff_core_List.Link("Atomic", ff_core_List.Link("Bool", ff_core_List.Link("Box", ff_core_List.Link("BrowserSystem", ff_core_List.Link("Buffer", ff_core_List.Link("BuildSystem", ff_core_List.Link("Channel", ff_core_List.Link("Char", ff_core_List.Link("Core", ff_core_List.Link("Duration", ff_core_List.Link("Equal", ff_core_List.Link("Error", ff_core_List.Link("FileHandle", ff_core_List.Link("Float", ff_core_List.Link("HttpClient", ff_core_List.Link("Instant", ff_core_List.Link("Int", ff_core_List.Link("IntMap", ff_core_List.Link("Json", ff_core_List.Link("JsValue", ff_core_List.Link("JsSystem", ff_core_List.Link("List", ff_core_List.Link("Lock", ff_core_List.Link("Log", ff_core_List.Link("Map", ff_core_List.Link("NodeSystem", ff_core_List.Link("Nothing", ff_core_List.Link("Option", ff_core_List.Link("Ordering", ff_core_List.Link("Pair", ff_core_List.Link("Path", ff_core_List.Link("Random", ff_core_List.Link("Serializable", ff_core_List.Link("Set", ff_core_List.Link("Show", ff_core_List.Link("SourceLocation", ff_core_List.Link("Stack", ff_core_List.Link("Stream", ff_core_List.Link("String", ff_core_List.Link("StringMap", ff_core_List.Link("Task", ff_core_List.Link("Try", ff_core_List.Link("Unit", ff_core_List.Empty())))))))))))))))))))))))))))))))))))))))))))))), ((moduleName_) => {
125
123
  return ff_compiler_Syntax.DImport(ff_compiler_Syntax.Location("<prelude>", 1, 1), moduleName_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_List.Empty(), moduleName_)
126
124
  }));
127
125
 
@@ -104,8 +104,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
104
104
 
105
105
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
106
106
 
107
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
108
-
109
107
  // type Dependencies
110
108
  export function Dependencies(workspace_, packages_, packagePaths_, singleFilePackages_) {
111
109
  return {workspace_, packages_, packagePaths_, singleFilePackages_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Deriver
102
100
  const Deriver$ = {Deriver: true};
103
101
  export function Deriver() {
@@ -159,7 +157,7 @@ const signature_ = ff_compiler_Syntax.Signature(at_, "anyTag", false, ff_core_Li
159
157
  const typeArgumentStrings_ = ff_core_List.List_map(typeArguments_, ((_w1) => {
160
158
  return ff_compiler_Deriver.Deriver_makeMethodCall(self_, at_, ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Any.anyTag", ff_core_List.Empty(), ff_core_List.Link(_w1, ff_core_List.Empty())), "show", ff_core_List.Empty())
161
159
  }));
162
- const strings_ = ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"[\""), ff_core_List.List_addAll(ff_core_List.List_insertBetween(typeArgumentStrings_, ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\",\""), ff_core_List.Empty())), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"]\""), ff_core_List.Empty())));
160
+ const strings_ = ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"[\""), ff_core_List.List_addAll(ff_core_List.List_separate(typeArgumentStrings_, ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\",\""), ff_core_List.Empty())), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"]\""), ff_core_List.Empty())));
163
161
  const body_ = ff_compiler_Syntax.FireflyTarget(ff_compiler_Syntax.Lambda(at_, noEffect_, ff_core_List.Link(ff_compiler_Syntax.MatchCase(at_, ff_core_List.Empty(), ff_core_List.Empty(), ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Any.internalAnyTag", ff_core_List.Link(ff_core_List.List_foldLeft(strings_, ff_compiler_Syntax.EString(at_, (("\"" + selfTypeName_) + "\"")), ((a_, b_) => {
164
162
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "+", ff_core_List.Link(a_, ff_core_List.Link(b_, ff_core_List.Empty())), ff_core_List.Empty())
165
163
  })), ff_core_List.Empty()), ff_core_List.Empty())), ff_core_List.Empty())));
@@ -208,7 +206,7 @@ const variantName_ = ((modulePrefix_ + ".") + variant_.name_);
208
206
  const fields_ = ff_core_List.List_addAll(declaration_.commonFields_, variant_.fields_);
209
207
  const strings_ = ((ff_core_List.List_size(fields_) === 0)
210
208
  ? ff_core_List.Empty()
211
- : ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"(\""), ff_core_List.List_addAll(ff_core_List.List_insertBetween(ff_core_List.List_map(fields_, ((field_) => {
209
+ : ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"(\""), ff_core_List.List_addAll(ff_core_List.List_separate(ff_core_List.List_map(fields_, ((field_) => {
212
210
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Show.show", ff_core_List.Link(ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "z"), field_.name_), ff_core_List.Empty()), ff_core_List.Empty())
213
211
  })), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\", \""), ff_core_List.Empty())), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\")\""), ff_core_List.Empty()))));
214
212
  return ff_compiler_Syntax.MatchCase(at_, ff_core_List.Link(ff_compiler_Syntax.PVariantAs(at_, variantName_, at_, ff_core_Option.Some("z")), ff_core_List.Empty()), ff_core_List.Empty(), ff_core_List.List_foldLeft(strings_, ff_compiler_Syntax.EString(at_, (("\"" + variant_.name_) + "\"")), ((a_, b_) => {
@@ -600,7 +598,7 @@ const signature_ = ff_compiler_Syntax.Signature(at_, "anyTag", false, ff_core_Li
600
598
  const typeArgumentStrings_ = ff_core_List.List_map(typeArguments_, ((_w1) => {
601
599
  return ff_compiler_Deriver.Deriver_makeMethodCall(self_, at_, ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Any.anyTag", ff_core_List.Empty(), ff_core_List.Link(_w1, ff_core_List.Empty())), "show", ff_core_List.Empty())
602
600
  }));
603
- const strings_ = ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"[\""), ff_core_List.List_addAll(ff_core_List.List_insertBetween(typeArgumentStrings_, ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\",\""), ff_core_List.Empty())), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"]\""), ff_core_List.Empty())));
601
+ const strings_ = ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"[\""), ff_core_List.List_addAll(ff_core_List.List_separate(typeArgumentStrings_, ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\",\""), ff_core_List.Empty())), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"]\""), ff_core_List.Empty())));
604
602
  const body_ = ff_compiler_Syntax.FireflyTarget(ff_compiler_Syntax.Lambda(at_, noEffect_, ff_core_List.Link(ff_compiler_Syntax.MatchCase(at_, ff_core_List.Empty(), ff_core_List.Empty(), ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Any.internalAnyTag", ff_core_List.Link(ff_core_List.List_foldLeft(strings_, ff_compiler_Syntax.EString(at_, (("\"" + selfTypeName_) + "\"")), ((a_, b_) => {
605
603
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "+", ff_core_List.Link(a_, ff_core_List.Link(b_, ff_core_List.Empty())), ff_core_List.Empty())
606
604
  })), ff_core_List.Empty()), ff_core_List.Empty())), ff_core_List.Empty())));
@@ -649,7 +647,7 @@ const variantName_ = ((modulePrefix_ + ".") + variant_.name_);
649
647
  const fields_ = ff_core_List.List_addAll(declaration_.commonFields_, variant_.fields_);
650
648
  const strings_ = ((ff_core_List.List_size(fields_) === 0)
651
649
  ? ff_core_List.Empty()
652
- : ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"(\""), ff_core_List.List_addAll(ff_core_List.List_insertBetween(ff_core_List.List_map(fields_, ((field_) => {
650
+ : ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\"(\""), ff_core_List.List_addAll(ff_core_List.List_separate(ff_core_List.List_map(fields_, ((field_) => {
653
651
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Show.show", ff_core_List.Link(ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "z"), field_.name_), ff_core_List.Empty()), ff_core_List.Empty())
654
652
  })), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\", \""), ff_core_List.Empty())), ff_core_List.Link(ff_compiler_Syntax.EString(at_, "\")\""), ff_core_List.Empty()))));
655
653
  return ff_compiler_Syntax.MatchCase(at_, ff_core_List.Link(ff_compiler_Syntax.PVariantAs(at_, variantName_, at_, ff_core_Option.Some("z")), ff_core_List.Empty()), ff_core_List.Empty(), ff_core_List.List_foldLeft(strings_, ff_compiler_Syntax.EString(at_, (("\"" + variant_.name_) + "\"")), ((a_, b_) => {
@@ -100,8 +100,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
100
100
 
101
101
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
102
102
 
103
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
104
-
105
103
  // type Dictionaries
106
104
  export function Dictionaries(instances_) {
107
105
  return {instances_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Environment
102
100
  export function Environment(modulePrefix_, symbols_, traits_, imports_, effect_, selfVariable_) {
103
101
  return {modulePrefix_, symbols_, traits_, imports_, effect_, selfVariable_};
@@ -104,8 +104,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
104
104
 
105
105
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
106
106
 
107
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
108
-
109
107
  // type Inference
110
108
  export function Inference(unification_, missing_, lspHook_) {
111
109
  return {unification_, missing_, lspHook_};
@@ -100,8 +100,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
100
100
 
101
101
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
102
102
 
103
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
104
-
105
103
  // type JsEmitter
106
104
  export function JsEmitter(otherModules_, jsImporter_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, emittingAsync_, tailCallUsed_) {
107
105
  return {otherModules_, jsImporter_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, emittingAsync_, tailCallUsed_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type JsImporter
102
100
  export function JsImporter(imports_) {
103
101
  return {imports_};
@@ -100,8 +100,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
100
100
 
101
101
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
102
102
 
103
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
104
-
105
103
  // type LspHook
106
104
  export function LspHook(at_, definedAt_, insertIdentifier_, trackSymbols_, stackOfResults_) {
107
105
  return {at_, definedAt_, insertIdentifier_, trackSymbols_, stackOfResults_};
@@ -116,8 +116,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
116
116
 
117
117
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
118
118
 
119
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
120
-
121
119
  // type MainCommand
122
120
  const BootstrapCommand$ = {BootstrapCommand: true};
123
121
  export function BootstrapCommand() {
@@ -102,8 +102,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
102
102
 
103
103
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
104
104
 
105
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
106
-
107
105
  // type Parser
108
106
  export function Parser(packagePair_, file_, tokens_, end_, targetIsNode_, lspHook_, lspEmittedArgumentHook_, offset_, nextUnificationVariableIndex_) {
109
107
  return {packagePair_, file_, tokens_, end_, targetIsNode_, lspHook_, lspEmittedArgumentHook_, offset_, nextUnificationVariableIndex_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type PatternInfo
102
100
  export function PatternInfo(variant_, otherVariants_, fields_) {
103
101
  return {variant_, otherVariants_, fields_};
@@ -98,8 +98,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
98
98
 
99
99
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
100
100
 
101
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
102
-
103
101
  // type Resolver
104
102
  export function Resolver(variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_) {
105
103
  return {variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Substitution
102
100
  export function Substitution(substitution_) {
103
101
  return {substitution_};
@@ -94,8 +94,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
94
94
 
95
95
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
96
96
 
97
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
98
-
99
97
  // type Location
100
98
  export function Location(file_, line_, column_) {
101
99
  return {file_, line_, column_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Token
102
100
  export function Token(file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_) {
103
101
  return {file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_};
@@ -100,8 +100,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
100
100
 
101
101
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
102
102
 
103
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
104
-
105
103
 
106
104
 
107
105
 
@@ -98,8 +98,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
98
98
 
99
99
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
100
100
 
101
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
102
-
103
101
  // type Unification
104
102
  export function Unification(substitution_, constraints_, nextUnificationVariableIndex_, instances_, affects_, attemptFixes_) {
105
103
  return {substitution_, constraints_, nextUnificationVariableIndex_, instances_, affects_, attemptFixes_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Wildcards
102
100
  export function Wildcards(seenWildcards_) {
103
101
  return {seenWildcards_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Workspace
102
100
  export function Workspace(rules_, defaultLocation_, packageDirectory_) {
103
101
  return {rules_, defaultLocation_, packageDirectory_};
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Any
98
96
 
99
97