firefly-compiler 0.4.4

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 (221) hide show
  1. package/.firefly-workspace +1 -0
  2. package/.vscode/settings.json +5 -0
  3. package/LICENSE.txt +21 -0
  4. package/README.md +96 -0
  5. package/bin/firefly.mjs +2 -0
  6. package/compiler/.firefly/package.ff +1 -0
  7. package/compiler/Builder.ff +218 -0
  8. package/compiler/Compiler.ff +241 -0
  9. package/compiler/Dependencies.ff +179 -0
  10. package/compiler/Deriver.ff +647 -0
  11. package/compiler/Dictionaries.ff +205 -0
  12. package/compiler/Environment.ff +166 -0
  13. package/compiler/Inference.ff +1117 -0
  14. package/compiler/JsEmitter.ff +861 -0
  15. package/compiler/JsImporter.ff +56 -0
  16. package/compiler/LspHook.ff +188 -0
  17. package/compiler/Main.ff +237 -0
  18. package/compiler/Parser.ff +1383 -0
  19. package/compiler/Patterns.ff +111 -0
  20. package/compiler/Resolver.ff +620 -0
  21. package/compiler/Substitution.ff +178 -0
  22. package/compiler/Syntax.ff +299 -0
  23. package/compiler/Token.ff +180 -0
  24. package/compiler/Tokenizer.ff +278 -0
  25. package/compiler/Unification.ff +220 -0
  26. package/compiler/Wildcards.ff +50 -0
  27. package/compiler/Workspace.ff +88 -0
  28. package/core/.firefly/package.ff +2 -0
  29. package/core/Any.ff +30 -0
  30. package/core/Array.ff +249 -0
  31. package/core/AssetSystem.ff +61 -0
  32. package/core/Atomic.ff +64 -0
  33. package/core/Bool.ff +13 -0
  34. package/core/BrowserSystem.ff +14 -0
  35. package/core/Buffer.ff +211 -0
  36. package/core/BuildSystem.ff +144 -0
  37. package/core/Channel.ff +131 -0
  38. package/core/Char.ff +18 -0
  39. package/core/Core.ff +58 -0
  40. package/core/Duration.ff +15 -0
  41. package/core/Equal.ff +52 -0
  42. package/core/Error.ff +20 -0
  43. package/core/FileHandle.ff +41 -0
  44. package/core/Float.ff +41 -0
  45. package/core/HttpClient.ff +84 -0
  46. package/core/Instant.ff +9 -0
  47. package/core/Int.ff +61 -0
  48. package/core/IntMap.ff +85 -0
  49. package/core/JsSystem.ff +66 -0
  50. package/core/JsValue.ff +240 -0
  51. package/core/List.ff +440 -0
  52. package/core/Lock.ff +144 -0
  53. package/core/Log.ff +24 -0
  54. package/core/Map.ff +126 -0
  55. package/core/NodeSystem.ff +88 -0
  56. package/core/Nothing.ff +1 -0
  57. package/core/Option.ff +133 -0
  58. package/core/Ordering.ff +157 -0
  59. package/core/Pair.ff +55 -0
  60. package/core/Path.ff +393 -0
  61. package/core/RbMap.ff +216 -0
  62. package/core/Serializable.ff +173 -0
  63. package/core/Set.ff +38 -0
  64. package/core/Show.ff +43 -0
  65. package/core/Stack.ff +263 -0
  66. package/core/Stream.ff +406 -0
  67. package/core/String.ff +175 -0
  68. package/core/StringMap.ff +85 -0
  69. package/core/Task.ff +138 -0
  70. package/core/Try.ff +81 -0
  71. package/core/Unit.ff +3 -0
  72. package/experimental/random/AltGeneric.ff +44 -0
  73. package/experimental/random/Async.ff +68 -0
  74. package/experimental/random/Buffer2.ff +77 -0
  75. package/experimental/random/Cat.ff +12 -0
  76. package/experimental/random/Dictionary.ff +52 -0
  77. package/experimental/random/Example.ff +46 -0
  78. package/experimental/random/Generic.ff +102 -0
  79. package/experimental/random/HappyEyeballs.ff +40 -0
  80. package/experimental/random/HashMap.ff +72 -0
  81. package/experimental/random/IfElseUnit.ff +9 -0
  82. package/experimental/random/InputOutput.ff +23 -0
  83. package/experimental/random/ListVsArray.ff +45 -0
  84. package/experimental/random/Main.ff +44 -0
  85. package/experimental/random/MapTest.ff +67 -0
  86. package/experimental/random/OldTaskSystem.ff +210 -0
  87. package/experimental/random/PatternTest.ff +39 -0
  88. package/experimental/random/Patterns.ff +226 -0
  89. package/experimental/random/ReadBytesTest.ff +10 -0
  90. package/experimental/random/RunLength.ff +65 -0
  91. package/experimental/random/Scrape.ff +51 -0
  92. package/experimental/random/Serialization.ff +217 -0
  93. package/experimental/random/SerializationTest.ff +46 -0
  94. package/experimental/random/Serializer.ff +36 -0
  95. package/experimental/random/StdInOutErr.ff +4 -0
  96. package/experimental/random/Symbols.ff +74 -0
  97. package/experimental/random/Tag.ff +49 -0
  98. package/experimental/random/Tensor.ff +52 -0
  99. package/experimental/random/Try.ff +56 -0
  100. package/experimental/random/Tsv.ff +9 -0
  101. package/experimental/random/TypesAreModules.ff +87 -0
  102. package/experimental/random/blueprints/Blueprint.ff +52 -0
  103. package/experimental/random/blueprints/Main.ff +11 -0
  104. package/experimental/random/blueprints/Pretty.ff +58 -0
  105. package/experimental/random/blueprints/User.ff +64 -0
  106. package/experimental/random/blueprintsystem/BlueprintSystem.ff +48 -0
  107. package/experimental/random/blueprintsystem/Deserialize.ff +53 -0
  108. package/experimental/random/blueprintsystem/ReadJs.ff +13 -0
  109. package/experimental/random/blueprintsystem/User.ff +2 -0
  110. package/experimental/random/kahrs/Kahrs.ff +112 -0
  111. package/experimental/random/kahrs/TestKahrs.ff +22 -0
  112. package/experimental/random/kahrs/TestMap.ff +18 -0
  113. package/experimental/random/streaming/Gzip.ff +3 -0
  114. package/experimental/random/streaming/Main.ff +34 -0
  115. package/experimental/random/streaming/S3Bucket.ff +11 -0
  116. package/experimental/random/streaming/Tar.ff +5 -0
  117. package/experimental/rhymeapp/Main.ff +81 -0
  118. package/experimental/rhymeapp/index.html +14 -0
  119. package/firefly.sh +5 -0
  120. package/fireflysite/Main.ff +13 -0
  121. package/httpserver/.firefly/package.ff +1 -0
  122. package/httpserver/HttpServer.ff +184 -0
  123. package/lsp/.firefly/package.ff +1 -0
  124. package/lsp/CompletionHandler.ff +814 -0
  125. package/lsp/Handler.ff +551 -0
  126. package/lsp/HoverHandler.ff +82 -0
  127. package/lsp/LanguageServer.ff +229 -0
  128. package/lsp/SignatureHelpHandler.ff +55 -0
  129. package/lsp/SymbolHandler.ff +167 -0
  130. package/output/js/ff/compiler/Builder.mjs +483 -0
  131. package/output/js/ff/compiler/Compiler.mjs +410 -0
  132. package/output/js/ff/compiler/Dependencies.mjs +388 -0
  133. package/output/js/ff/compiler/Deriver.mjs +1166 -0
  134. package/output/js/ff/compiler/Dictionaries.mjs +1305 -0
  135. package/output/js/ff/compiler/Environment.mjs +1005 -0
  136. package/output/js/ff/compiler/Inference.mjs +4264 -0
  137. package/output/js/ff/compiler/JsEmitter.mjs +5353 -0
  138. package/output/js/ff/compiler/JsImporter.mjs +262 -0
  139. package/output/js/ff/compiler/LspHook.mjs +789 -0
  140. package/output/js/ff/compiler/Main.mjs +1695 -0
  141. package/output/js/ff/compiler/Parser.mjs +4004 -0
  142. package/output/js/ff/compiler/Patterns.mjs +923 -0
  143. package/output/js/ff/compiler/Resolver.mjs +2303 -0
  144. package/output/js/ff/compiler/Substitution.mjs +1146 -0
  145. package/output/js/ff/compiler/Syntax.mjs +12430 -0
  146. package/output/js/ff/compiler/Token.mjs +3092 -0
  147. package/output/js/ff/compiler/Tokenizer.mjs +589 -0
  148. package/output/js/ff/compiler/Unification.mjs +1748 -0
  149. package/output/js/ff/compiler/Wildcards.mjs +604 -0
  150. package/output/js/ff/compiler/Workspace.mjs +683 -0
  151. package/output/js/ff/core/Any.mjs +139 -0
  152. package/output/js/ff/core/Array.mjs +594 -0
  153. package/output/js/ff/core/AssetSystem.mjs +270 -0
  154. package/output/js/ff/core/Atomic.mjs +186 -0
  155. package/output/js/ff/core/Bool.mjs +141 -0
  156. package/output/js/ff/core/BrowserSystem.mjs +122 -0
  157. package/output/js/ff/core/Buffer.mjs +467 -0
  158. package/output/js/ff/core/BuildSystem.mjs +320 -0
  159. package/output/js/ff/core/Channel.mjs +268 -0
  160. package/output/js/ff/core/Char.mjs +145 -0
  161. package/output/js/ff/core/Core.mjs +300 -0
  162. package/output/js/ff/core/Duration.mjs +112 -0
  163. package/output/js/ff/core/Equal.mjs +175 -0
  164. package/output/js/ff/core/Error.mjs +138 -0
  165. package/output/js/ff/core/FileHandle.mjs +164 -0
  166. package/output/js/ff/core/Float.mjs +214 -0
  167. package/output/js/ff/core/HttpClient.mjs +210 -0
  168. package/output/js/ff/core/Instant.mjs +105 -0
  169. package/output/js/ff/core/Int.mjs +254 -0
  170. package/output/js/ff/core/IntMap.mjs +282 -0
  171. package/output/js/ff/core/JsSystem.mjs +234 -0
  172. package/output/js/ff/core/JsValue.mjs +678 -0
  173. package/output/js/ff/core/List.mjs +2335 -0
  174. package/output/js/ff/core/Lock.mjs +322 -0
  175. package/output/js/ff/core/Log.mjs +159 -0
  176. package/output/js/ff/core/Map.mjs +358 -0
  177. package/output/js/ff/core/NodeSystem.mjs +288 -0
  178. package/output/js/ff/core/Nothing.mjs +100 -0
  179. package/output/js/ff/core/Option.mjs +1002 -0
  180. package/output/js/ff/core/Ordering.mjs +734 -0
  181. package/output/js/ff/core/Pair.mjs +318 -0
  182. package/output/js/ff/core/Path.mjs +768 -0
  183. package/output/js/ff/core/RbMap.mjs +1936 -0
  184. package/output/js/ff/core/Serializable.mjs +434 -0
  185. package/output/js/ff/core/Set.mjs +250 -0
  186. package/output/js/ff/core/Show.mjs +201 -0
  187. package/output/js/ff/core/Stack.mjs +595 -0
  188. package/output/js/ff/core/Stream.mjs +1300 -0
  189. package/output/js/ff/core/String.mjs +433 -0
  190. package/output/js/ff/core/StringMap.mjs +282 -0
  191. package/output/js/ff/core/Task.mjs +345 -0
  192. package/output/js/ff/core/Try.mjs +503 -0
  193. package/output/js/ff/core/Unit.mjs +103 -0
  194. package/package.json +29 -0
  195. package/postgresql/.firefly/include/package-lock.json +250 -0
  196. package/postgresql/.firefly/include/package.json +5 -0
  197. package/postgresql/.firefly/include/prepare.sh +2 -0
  198. package/postgresql/.firefly/package.ff +3 -0
  199. package/postgresql/Pg.ff +530 -0
  200. package/unsafejs/.firefly/package.ff +1 -0
  201. package/unsafejs/UnsafeJs.ff +19 -0
  202. package/vscode/.vscode/launch.json +18 -0
  203. package/vscode/.vscode/tasks.json +33 -0
  204. package/vscode/LICENSE.txt +21 -0
  205. package/vscode/Prepublish.ff +15 -0
  206. package/vscode/README.md +17 -0
  207. package/vscode/client/package-lock.json +544 -0
  208. package/vscode/client/package.json +22 -0
  209. package/vscode/client/src/extension.ts +64 -0
  210. package/vscode/client/tsconfig.json +12 -0
  211. package/vscode/icons/firefly-icon.png +0 -0
  212. package/vscode/icons/firefly-icon.svg +10 -0
  213. package/vscode/icons/firefly-logo-notext.png +0 -0
  214. package/vscode/icons/firefly-logo.png +0 -0
  215. package/vscode/language-configuration.json +39 -0
  216. package/vscode/package-lock.json +3623 -0
  217. package/vscode/package.json +144 -0
  218. package/vscode/snippets-none.json +1 -0
  219. package/vscode/snippets.json +241 -0
  220. package/vscode/syntaxes/firefly.tmLanguage.json +294 -0
  221. package/vscode/tsconfig.json +20 -0
@@ -0,0 +1,358 @@
1
+
2
+
3
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
4
+
5
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
6
+
7
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
8
+
9
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
10
+
11
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
12
+
13
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
14
+
15
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
16
+
17
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
18
+
19
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
20
+
21
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
22
+
23
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
24
+
25
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
26
+
27
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
28
+
29
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
30
+
31
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
32
+
33
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
34
+
35
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
36
+
37
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
38
+
39
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
40
+
41
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
42
+
43
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
44
+
45
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
46
+
47
+ import * as ff_core_List from "../../ff/core/List.mjs"
48
+
49
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
50
+
51
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
52
+
53
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
54
+
55
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
56
+
57
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
58
+
59
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
60
+
61
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
62
+
63
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
64
+
65
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
66
+
67
+ import * as ff_core_RbMap from "../../ff/core/RbMap.mjs"
68
+
69
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
70
+
71
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
72
+
73
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
74
+
75
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
76
+
77
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
78
+
79
+ import * as ff_core_String from "../../ff/core/String.mjs"
80
+
81
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
82
+
83
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
84
+
85
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
86
+
87
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
88
+
89
+ // newtype Map
90
+
91
+
92
+
93
+ export function empty_() {
94
+ return ff_core_RbMap.E()
95
+ }
96
+
97
+ export async function empty_$($task) {
98
+ return ff_core_RbMap.E()
99
+ }
100
+
101
+ export function Map_add(self_, key_, value_, ff_core_Ordering_Order$K) {
102
+ return ff_core_RbMap.insert_(key_, value_, self_, ff_core_Ordering_Order$K)
103
+ }
104
+
105
+ export function Map_addAll(self_, that_, ff_core_Ordering_Order$K) {
106
+ let result_ = self_;
107
+ ff_core_RbMap.RB_each(that_, ((k_, v_) => {
108
+ result_ = ff_core_RbMap.insert_(k_, v_, result_, ff_core_Ordering_Order$K)
109
+ }), ff_core_Ordering_Order$K);
110
+ return result_
111
+ }
112
+
113
+ export function Map_get(self_, key_, ff_core_Ordering_Order$K) {
114
+ return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
115
+ }
116
+
117
+ export function Map_remove(self_, key_, ff_core_Ordering_Order$K) {
118
+ return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
119
+ }
120
+
121
+ export function Map_removeAll(self_, that_, ff_core_Ordering_Order$K) {
122
+ let result_ = self_;
123
+ ff_core_RbMap.RB_each(that_, ((k_, _) => {
124
+ result_ = ff_core_RbMap.delete_(k_, result_, ff_core_Ordering_Order$K)
125
+ }), ff_core_Ordering_Order$K);
126
+ return result_
127
+ }
128
+
129
+ export function Map_pairs(self_, ff_core_Ordering_Order$K) {
130
+ return ff_core_Map.Map_toList(self_, ff_core_Ordering_Order$K)
131
+ }
132
+
133
+ export function Map_toList(self_, ff_core_Ordering_Order$K) {
134
+ return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
135
+ }
136
+
137
+ export function Map_toArray(self_, ff_core_Ordering_Order$K) {
138
+ return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
139
+ }
140
+
141
+ export function Map_toStream(self_, cycle_ = false, ff_core_Ordering_Order$K) {
142
+ return ff_core_RbMap.RB_toStream(self_, cycle_, ff_core_Ordering_Order$K)
143
+ }
144
+
145
+ export function Map_keys(self_, ff_core_Ordering_Order$K) {
146
+ return ff_core_List.List_toSet(ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
147
+ return _w1.first_
148
+ })), ff_core_Ordering_Order$K)
149
+ }
150
+
151
+ export function Map_values(self_, ff_core_Ordering_Order$K) {
152
+ return ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
153
+ return _w1.second_
154
+ }))
155
+ }
156
+
157
+ export function Map_size(self_, ff_core_Ordering_Order$K) {
158
+ return ff_core_RbMap.RB_size(self_, ff_core_Ordering_Order$K)
159
+ }
160
+
161
+ export function Map_map(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1) {
162
+ return ff_core_RbMap.RB_map(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1)
163
+ }
164
+
165
+ export function Map_mapValues(self_, body_, ff_core_Ordering_Order$K) {
166
+ return ff_core_RbMap.RB_mapValues(self_, body_, ff_core_Ordering_Order$K)
167
+ }
168
+
169
+ export function Map_contains(self_, key_, ff_core_Ordering_Order$K) {
170
+ return (!ff_core_Option.Option_isEmpty(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K)))
171
+ }
172
+
173
+ export function Map_grab(self_, key_, ff_core_Ordering_Order$K) {
174
+ return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K))
175
+ }
176
+
177
+ export function Map_updateOrInsert(self_, key_, update_, default_, ff_core_Ordering_Order$K) {
178
+ {
179
+ const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
180
+ {
181
+ if(_1.None) {
182
+ return ff_core_Map.Map_add(self_, key_, default_(), ff_core_Ordering_Order$K)
183
+ return
184
+ }
185
+ }
186
+ {
187
+ if(_1.Some) {
188
+ const v_ = _1.value_;
189
+ return ff_core_Map.Map_add(self_, key_, update_(v_), ff_core_Ordering_Order$K)
190
+ return
191
+ }
192
+ }
193
+ }
194
+ }
195
+
196
+ export function Map_each(self_, body_, ff_core_Ordering_Order$K) {
197
+ ff_core_RbMap.RB_each(self_, body_, ff_core_Ordering_Order$K)
198
+ }
199
+
200
+ export function Map_eachWhile(self_, body_, ff_core_Ordering_Order$K) {
201
+ return ff_core_RbMap.RB_eachWhile(self_, body_, ff_core_Ordering_Order$K)
202
+ }
203
+
204
+ export function Map_find(self_, body_, ff_core_Ordering_Order$K) {
205
+ return ff_core_RbMap.RB_find(self_, body_, ff_core_Ordering_Order$K)
206
+ }
207
+
208
+ export async function Map_add$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
209
+ return ff_core_RbMap.insert_(key_, value_, self_, ff_core_Ordering_Order$K)
210
+ }
211
+
212
+ export async function Map_addAll$(self_, that_, ff_core_Ordering_Order$K, $task) {
213
+ let result_ = self_;
214
+ ff_core_RbMap.RB_each(that_, ((k_, v_) => {
215
+ result_ = ff_core_RbMap.insert_(k_, v_, result_, ff_core_Ordering_Order$K)
216
+ }), ff_core_Ordering_Order$K);
217
+ return result_
218
+ }
219
+
220
+ export async function Map_get$(self_, key_, ff_core_Ordering_Order$K, $task) {
221
+ return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
222
+ }
223
+
224
+ export async function Map_remove$(self_, key_, ff_core_Ordering_Order$K, $task) {
225
+ return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
226
+ }
227
+
228
+ export async function Map_removeAll$(self_, that_, ff_core_Ordering_Order$K, $task) {
229
+ let result_ = self_;
230
+ ff_core_RbMap.RB_each(that_, ((k_, _) => {
231
+ result_ = ff_core_RbMap.delete_(k_, result_, ff_core_Ordering_Order$K)
232
+ }), ff_core_Ordering_Order$K);
233
+ return result_
234
+ }
235
+
236
+ export async function Map_pairs$(self_, ff_core_Ordering_Order$K, $task) {
237
+ return ff_core_Map.Map_toList(self_, ff_core_Ordering_Order$K)
238
+ }
239
+
240
+ export async function Map_toList$(self_, ff_core_Ordering_Order$K, $task) {
241
+ return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
242
+ }
243
+
244
+ export async function Map_toArray$(self_, ff_core_Ordering_Order$K, $task) {
245
+ return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
246
+ }
247
+
248
+ export async function Map_toStream$(self_, cycle_ = false, ff_core_Ordering_Order$K, $task) {
249
+ return (await ff_core_RbMap.RB_toStream$(self_, cycle_, ff_core_Ordering_Order$K, $task))
250
+ }
251
+
252
+ export async function Map_keys$(self_, ff_core_Ordering_Order$K, $task) {
253
+ return ff_core_List.List_toSet(ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
254
+ return _w1.first_
255
+ })), ff_core_Ordering_Order$K)
256
+ }
257
+
258
+ export async function Map_values$(self_, ff_core_Ordering_Order$K, $task) {
259
+ return ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
260
+ return _w1.second_
261
+ }))
262
+ }
263
+
264
+ export async function Map_size$(self_, ff_core_Ordering_Order$K, $task) {
265
+ return ff_core_RbMap.RB_size(self_, ff_core_Ordering_Order$K)
266
+ }
267
+
268
+ export async function Map_map$(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1, $task) {
269
+ return (await ff_core_RbMap.RB_map$(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1, $task))
270
+ }
271
+
272
+ export async function Map_mapValues$(self_, body_, ff_core_Ordering_Order$K, $task) {
273
+ return (await ff_core_RbMap.RB_mapValues$(self_, body_, ff_core_Ordering_Order$K, $task))
274
+ }
275
+
276
+ export async function Map_contains$(self_, key_, ff_core_Ordering_Order$K, $task) {
277
+ return (!ff_core_Option.Option_isEmpty(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K)))
278
+ }
279
+
280
+ export async function Map_grab$(self_, key_, ff_core_Ordering_Order$K, $task) {
281
+ return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K))
282
+ }
283
+
284
+ export async function Map_updateOrInsert$(self_, key_, update_, default_, ff_core_Ordering_Order$K, $task) {
285
+ {
286
+ const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
287
+ {
288
+ if(_1.None) {
289
+ return ff_core_Map.Map_add(self_, key_, (await default_($task)), ff_core_Ordering_Order$K)
290
+ return
291
+ }
292
+ }
293
+ {
294
+ if(_1.Some) {
295
+ const v_ = _1.value_;
296
+ return ff_core_Map.Map_add(self_, key_, (await update_(v_, $task)), ff_core_Ordering_Order$K)
297
+ return
298
+ }
299
+ }
300
+ }
301
+ }
302
+
303
+ export async function Map_each$(self_, body_, ff_core_Ordering_Order$K, $task) {
304
+ (await ff_core_RbMap.RB_each$(self_, body_, ff_core_Ordering_Order$K, $task))
305
+ }
306
+
307
+ export async function Map_eachWhile$(self_, body_, ff_core_Ordering_Order$K, $task) {
308
+ return (await ff_core_RbMap.RB_eachWhile$(self_, body_, ff_core_Ordering_Order$K, $task))
309
+ }
310
+
311
+ export async function Map_find$(self_, body_, ff_core_Ordering_Order$K, $task) {
312
+ return (await ff_core_RbMap.RB_find$(self_, body_, ff_core_Ordering_Order$K, $task))
313
+ }
314
+
315
+ export function Map_addToList(self_, key_, value_, ff_core_Ordering_Order$K) {
316
+ return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
317
+ return ff_core_List.Link(value_, _w1)
318
+ }), (() => {
319
+ return ff_core_List.Link(value_, ff_core_List.Empty())
320
+ }), ff_core_Ordering_Order$K)
321
+ }
322
+
323
+ export async function Map_addToList$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
324
+ return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
325
+ return ff_core_List.Link(value_, _w1)
326
+ }), (() => {
327
+ return ff_core_List.Link(value_, ff_core_List.Empty())
328
+ }), ff_core_Ordering_Order$K)
329
+ }
330
+
331
+ export function ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal_Equal$K, ff_core_Ordering_Order$K, ff_core_Equal_Equal$V) { return {
332
+ equals_(x_, y_) {
333
+ 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_Equal$K, ff_core_Equal_Equal$V)).equals_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
334
+ },
335
+ async equals_$(x_, y_, $task) {
336
+ 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_Equal$K, ff_core_Equal_Equal$V)).equals_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
337
+ }
338
+ }}
339
+
340
+ export function ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering_Order$K, ff_core_Ordering_Order$V) { return {
341
+ compare_(x_, y_) {
342
+ return 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_Order$K, ff_core_Ordering_Order$V)).compare_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
343
+ },
344
+ async compare_$(x_, y_, $task) {
345
+ return 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_Order$K, ff_core_Ordering_Order$V)).compare_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
346
+ }
347
+ }}
348
+
349
+ export function ff_core_Show_Show$ff_core_Map_Map(ff_core_Show_Show$K, ff_core_Ordering_Order$K, ff_core_Show_Show$V) { return {
350
+ show_(value_) {
351
+ return (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_Show$K, ff_core_Show_Show$V)).show_(ff_core_Map.Map_pairs(value_, ff_core_Ordering_Order$K)) + ".toMap()")
352
+ },
353
+ async show_$(value_, $task) {
354
+ return (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_Show$K, ff_core_Show_Show$V)).show_(ff_core_Map.Map_pairs(value_, ff_core_Ordering_Order$K)) + ".toMap()")
355
+ }
356
+ }}
357
+
358
+
@@ -0,0 +1,288 @@
1
+ import * as import$0 from 'path';
2
+
3
+ import * as import$1 from 'url';
4
+
5
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
6
+
7
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
8
+
9
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
10
+
11
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
12
+
13
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
14
+
15
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
16
+
17
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
18
+
19
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
20
+
21
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
22
+
23
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
24
+
25
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
26
+
27
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
28
+
29
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
30
+
31
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
32
+
33
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
34
+
35
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
36
+
37
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
38
+
39
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
40
+
41
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
42
+
43
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
44
+
45
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
+
47
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
+
49
+ import * as ff_core_List from "../../ff/core/List.mjs"
50
+
51
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
52
+
53
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
54
+
55
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
56
+
57
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
58
+
59
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
60
+
61
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
62
+
63
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
64
+
65
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
66
+
67
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
68
+
69
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
70
+
71
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
72
+
73
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
74
+
75
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
76
+
77
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
78
+
79
+ import * as ff_core_String from "../../ff/core/String.mjs"
80
+
81
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
82
+
83
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
84
+
85
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
86
+
87
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
88
+
89
+ // type NodeSystem
90
+
91
+
92
+
93
+
94
+ export function internalAssets_(system_) {
95
+ throw new Error('Function internalAssets is missing on this target in sync context.');
96
+ }
97
+
98
+ export async function internalAssets_$(system_, $task) {
99
+ return system_.assets_
100
+ }
101
+
102
+ export function NodeSystem_arguments(self_) {
103
+ throw new Error('Function NodeSystem_arguments is missing on this target in sync context.');
104
+ }
105
+
106
+ export function NodeSystem_assets(self_) {
107
+ const assetPkgSnapshotPath_ = ff_core_NodeSystem.NodeSystem_path(self_, "/snapshot/output/assets");
108
+ if(ff_core_Path.Path_isDirectory(assetPkgSnapshotPath_)) {
109
+ function streams_(path_) {
110
+ return ff_core_Stream.Stream_flatMap(ff_core_Path.Path_entries(path_), ((file_) => {
111
+ if(ff_core_Path.PathEntry_isDirectory(file_)) {
112
+ return streams_(ff_core_Path.PathEntry_path(file_))
113
+ } else {
114
+ return ff_core_List.List_toStream(ff_core_List.Link(ff_core_Pair.Pair(ff_core_Path.Path_relativeTo(ff_core_Path.PathEntry_path(file_), assetPkgSnapshotPath_), (() => {
115
+ return ff_core_Path.Path_readStream(ff_core_Path.PathEntry_path(file_))
116
+ })), ff_core_List.Empty()), false)
117
+ }
118
+ }))
119
+ }
120
+ return ff_core_AssetSystem.AssetSystem(ff_core_Stream.Stream_toMap(streams_(assetPkgSnapshotPath_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
121
+ } else {
122
+ return ff_core_NodeSystem.internalAssets_(self_)
123
+ }
124
+ }
125
+
126
+ export function NodeSystem_path(self_, relativePath_) {
127
+ throw new Error('Function NodeSystem_path is missing on this target in sync context.');
128
+ }
129
+
130
+ export function NodeSystem_pathFromUrl(self_, url_) {
131
+ throw new Error('Function NodeSystem_pathFromUrl is missing on this target in sync context.');
132
+ }
133
+
134
+ export function NodeSystem_httpClient(self_) {
135
+ throw new Error('Function NodeSystem_httpClient is missing on this target in sync context.');
136
+ }
137
+
138
+ export function NodeSystem_mainTask(self_) {
139
+ throw new Error('Function NodeSystem_mainTask is missing on this target in sync context.');
140
+ }
141
+
142
+ export function NodeSystem_js(self_) {
143
+ throw new Error('Function NodeSystem_js is missing on this target in sync context.');
144
+ }
145
+
146
+ export function NodeSystem_exit(self_, exitCode_ = 0) {
147
+ throw new Error('Function NodeSystem_exit is missing on this target in sync context.');
148
+ }
149
+
150
+ export function NodeSystem_readStream(self_) {
151
+ throw new Error('Function NodeSystem_readStream is missing on this target in sync context.');
152
+ }
153
+
154
+ export function NodeSystem_writeBuffer(self_, buffer_) {
155
+ throw new Error('Function NodeSystem_writeBuffer is missing on this target in sync context.');
156
+ }
157
+
158
+ export function NodeSystem_writeStream(self_, stream_) {
159
+ ff_core_Stream.Stream_each(stream_, ((_w1) => {
160
+ ff_core_NodeSystem.NodeSystem_writeBuffer(self_, _w1)
161
+ }))
162
+ }
163
+
164
+ export function NodeSystem_writeText(self_, text_) {
165
+ ff_core_NodeSystem.NodeSystem_writeBuffer(self_, ff_core_String.String_toBuffer(text_))
166
+ }
167
+
168
+ export function NodeSystem_writeLine(self_, text_) {
169
+ ff_core_NodeSystem.NodeSystem_writeText(self_, (text_ + "\n"))
170
+ }
171
+
172
+ export function NodeSystem_writeErrorBuffer(self_, buffer_) {
173
+ throw new Error('Function NodeSystem_writeErrorBuffer is missing on this target in sync context.');
174
+ }
175
+
176
+ export function NodeSystem_writeErrorStream(self_, stream_) {
177
+ ff_core_Stream.Stream_each(stream_, ((_w1) => {
178
+ ff_core_NodeSystem.NodeSystem_writeErrorBuffer(self_, _w1)
179
+ }))
180
+ }
181
+
182
+ export function NodeSystem_writeErrorText(self_, text_) {
183
+ ff_core_NodeSystem.NodeSystem_writeErrorBuffer(self_, ff_core_String.String_toBuffer(text_))
184
+ }
185
+
186
+ export function NodeSystem_writeErrorLine(self_, text_) {
187
+ ff_core_NodeSystem.NodeSystem_writeErrorText(self_, (text_ + "\n"))
188
+ }
189
+
190
+ export async function NodeSystem_arguments$(self_, $task) {
191
+ return self_.array_
192
+ }
193
+
194
+ export async function NodeSystem_assets$(self_, $task) {
195
+ const assetPkgSnapshotPath_ = (await ff_core_NodeSystem.NodeSystem_path$(self_, "/snapshot/output/assets", $task));
196
+ if((await ff_core_Path.Path_isDirectory$(assetPkgSnapshotPath_, $task))) {
197
+ async function streams_$(path_, $task) {
198
+ return (await ff_core_Stream.Stream_flatMap$((await ff_core_Path.Path_entries$(path_, $task)), (async (file_, $task) => {
199
+ if((await ff_core_Path.PathEntry_isDirectory$(file_, $task))) {
200
+ return (await streams_$((await ff_core_Path.PathEntry_path$(file_, $task)), $task))
201
+ } else {
202
+ return (await ff_core_List.List_toStream$(ff_core_List.Link(ff_core_Pair.Pair((await ff_core_Path.Path_relativeTo$((await ff_core_Path.PathEntry_path$(file_, $task)), assetPkgSnapshotPath_, $task)), (async ($task) => {
203
+ return (await ff_core_Path.Path_readStream$((await ff_core_Path.PathEntry_path$(file_, $task)), $task))
204
+ })), ff_core_List.Empty()), false, $task))
205
+ }
206
+ }), $task))
207
+ }
208
+ return ff_core_AssetSystem.AssetSystem((await ff_core_Stream.Stream_toMap$((await streams_$(assetPkgSnapshotPath_, $task)), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String, $task)))
209
+ } else {
210
+ return (await ff_core_NodeSystem.internalAssets_$(self_, $task))
211
+ }
212
+ }
213
+
214
+ export async function NodeSystem_path$(self_, relativePath_, $task) {
215
+
216
+ const path = import$0
217
+ return path.resolve(relativePath_)
218
+
219
+ }
220
+
221
+ export async function NodeSystem_pathFromUrl$(self_, url_, $task) {
222
+
223
+ const url = import$1;
224
+ return url.fileURLToPath(new URL(url_));
225
+
226
+ }
227
+
228
+ export async function NodeSystem_httpClient$(self_, $task) {
229
+ return null
230
+ }
231
+
232
+ export async function NodeSystem_mainTask$(self_, $task) {
233
+ return self_.task_
234
+ }
235
+
236
+ export async function NodeSystem_js$(self_, $task) {
237
+ return typeof globalThis !== 'undefined' ? globalThis : window
238
+ }
239
+
240
+ export async function NodeSystem_exit$(self_, exitCode_ = 0, $task) {
241
+ process.exit(exitCode_)
242
+ }
243
+
244
+ export async function NodeSystem_readStream$(self_, $task) {
245
+
246
+ return ff_core_Path.internalReadStream_$(() => process.stdin)
247
+
248
+ }
249
+
250
+ export async function NodeSystem_writeBuffer$(self_, buffer_, $task) {
251
+ process.stdout.write(new Uint8Array(buffer_.buffer, buffer_.byteOffset, buffer_.byteLength))
252
+ }
253
+
254
+ export async function NodeSystem_writeStream$(self_, stream_, $task) {
255
+ (await ff_core_Stream.Stream_each$(stream_, (async (_w1, $task) => {
256
+ (await ff_core_NodeSystem.NodeSystem_writeBuffer$(self_, _w1, $task))
257
+ }), $task))
258
+ }
259
+
260
+ export async function NodeSystem_writeText$(self_, text_, $task) {
261
+ (await ff_core_NodeSystem.NodeSystem_writeBuffer$(self_, ff_core_String.String_toBuffer(text_), $task))
262
+ }
263
+
264
+ export async function NodeSystem_writeLine$(self_, text_, $task) {
265
+ (await ff_core_NodeSystem.NodeSystem_writeText$(self_, (text_ + "\n"), $task))
266
+ }
267
+
268
+ export async function NodeSystem_writeErrorBuffer$(self_, buffer_, $task) {
269
+ process.stderr.write(new Uint8Array(buffer_.buffer, buffer_.byteOffset, buffer_.byteLength))
270
+ }
271
+
272
+ export async function NodeSystem_writeErrorStream$(self_, stream_, $task) {
273
+ (await ff_core_Stream.Stream_each$(stream_, (async (_w1, $task) => {
274
+ (await ff_core_NodeSystem.NodeSystem_writeErrorBuffer$(self_, _w1, $task))
275
+ }), $task))
276
+ }
277
+
278
+ export async function NodeSystem_writeErrorText$(self_, text_, $task) {
279
+ (await ff_core_NodeSystem.NodeSystem_writeErrorBuffer$(self_, ff_core_String.String_toBuffer(text_), $task))
280
+ }
281
+
282
+ export async function NodeSystem_writeErrorLine$(self_, text_, $task) {
283
+ (await ff_core_NodeSystem.NodeSystem_writeErrorText$(self_, (text_ + "\n"), $task))
284
+ }
285
+
286
+
287
+
288
+