firefly-compiler 0.5.47 → 0.5.48

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.
@@ -137,6 +137,14 @@ export function Map_get(self_, key_, ff_core_Ordering_Order$K) {
137
137
  return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
138
138
  }
139
139
 
140
+ export function Map_lastBefore(self_, key_, ff_core_Ordering_Order$K) {
141
+ return ff_core_RbMap.RB_lastBefore(self_, key_, ff_core_Ordering_Order$K)
142
+ }
143
+
144
+ export function Map_firstAfter(self_, key_, ff_core_Ordering_Order$K) {
145
+ return ff_core_RbMap.RB_firstAfter(self_, key_, ff_core_Ordering_Order$K)
146
+ }
147
+
140
148
  export function Map_remove(self_, key_, ff_core_Ordering_Order$K) {
141
149
  return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
142
150
  }
@@ -256,6 +264,14 @@ export async function Map_get$(self_, key_, ff_core_Ordering_Order$K, $task) {
256
264
  return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
257
265
  }
258
266
 
267
+ export async function Map_lastBefore$(self_, key_, ff_core_Ordering_Order$K, $task) {
268
+ return ff_core_RbMap.RB_lastBefore(self_, key_, ff_core_Ordering_Order$K)
269
+ }
270
+
271
+ export async function Map_firstAfter$(self_, key_, ff_core_Ordering_Order$K, $task) {
272
+ return ff_core_RbMap.RB_firstAfter(self_, key_, ff_core_Ordering_Order$K)
273
+ }
274
+
259
275
  export async function Map_remove$(self_, key_, ff_core_Ordering_Order$K, $task) {
260
276
  return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
261
277
  }
@@ -428,10 +428,7 @@ dir_ = fsPromises_.opendir(self_.absolutePath_, {bufferSize: 128})
428
428
  };
429
429
  const entry_ = dir_.read();
430
430
  if((!ff_core_JsValue.JsValue_isNull(entry_))) {
431
- return ff_core_Option.Some((function() {
432
- entry_.ffPath = self_.absolutePath_;
433
- return entry_
434
- })())
431
+ return ff_core_Option.Some((entry_.ffPath = self_.absolutePath_, entry_))
435
432
  } else return ff_core_Option.None()
436
433
  }), (() => {
437
434
  if((!ff_core_JsValue.JsValue_isNull(dir_))) {
@@ -729,10 +726,7 @@ dir_ = (await fsPromises_.opendir(self_.absolutePath_, {bufferSize: 128}))
729
726
  };
730
727
  const entry_ = (await dir_.read());
731
728
  if((!ff_core_JsValue.JsValue_isNull(entry_))) {
732
- return ff_core_Option.Some((await (async function() {
733
- entry_.ffPath = self_.absolutePath_;
734
- return entry_
735
- })()))
729
+ return ff_core_Option.Some((entry_.ffPath = self_.absolutePath_, entry_))
736
730
  } else return ff_core_Option.None()
737
731
  }), (async ($task) => {
738
732
  if((!ff_core_JsValue.JsValue_isNull(dir_))) {
@@ -995,6 +995,62 @@ return
995
995
  }
996
996
  }
997
997
 
998
+ export function RB_lastBefore(self_, key_, ff_core_Ordering_Order$K) {
999
+ {
1000
+ const _1 = self_;
1001
+ if(_1.E) {
1002
+ return ff_core_Option.None()
1003
+ }
1004
+ if(_1.T) {
1005
+ const l_ = _1.left_;
1006
+ const k_ = _1.key_;
1007
+ const v_ = _1.value_;
1008
+ const r_ = _1.right_;
1009
+ if(ff_core_Ordering.notBefore_(k_, key_, ff_core_Ordering_Order$K)) {
1010
+ return ff_core_RbMap.RB_lastBefore(l_, key_, ff_core_Ordering_Order$K)
1011
+ }
1012
+ }
1013
+ {
1014
+ const l_ = _1.left_;
1015
+ const k_ = _1.key_;
1016
+ const v_ = _1.value_;
1017
+ const r_ = _1.right_;
1018
+ return ff_core_Option.Option_orElse(ff_core_RbMap.RB_lastBefore(r_, key_, ff_core_Ordering_Order$K), (() => {
1019
+ return ff_core_Option.Some(ff_core_Pair.Pair(k_, v_))
1020
+ }))
1021
+ return
1022
+ }
1023
+ }
1024
+ }
1025
+
1026
+ export function RB_firstAfter(self_, key_, ff_core_Ordering_Order$K) {
1027
+ {
1028
+ const _1 = self_;
1029
+ if(_1.E) {
1030
+ return ff_core_Option.None()
1031
+ }
1032
+ if(_1.T) {
1033
+ const l_ = _1.left_;
1034
+ const k_ = _1.key_;
1035
+ const v_ = _1.value_;
1036
+ const r_ = _1.right_;
1037
+ if(ff_core_Ordering.notAfter_(k_, key_, ff_core_Ordering_Order$K)) {
1038
+ return ff_core_RbMap.RB_firstAfter(r_, key_, ff_core_Ordering_Order$K)
1039
+ }
1040
+ }
1041
+ {
1042
+ const l_ = _1.left_;
1043
+ const k_ = _1.key_;
1044
+ const v_ = _1.value_;
1045
+ const r_ = _1.right_;
1046
+ return ff_core_Option.Option_orElse(ff_core_RbMap.RB_firstAfter(l_, key_, ff_core_Ordering_Order$K), (() => {
1047
+ return ff_core_Option.Some(ff_core_Pair.Pair(k_, v_))
1048
+ }))
1049
+ return
1050
+ }
1051
+ }
1052
+ }
1053
+
998
1054
  export function RB_size(self_, ff_core_Ordering_Order$K) {
999
1055
  {
1000
1056
  const _1 = self_;
@@ -1188,6 +1244,62 @@ return
1188
1244
  }
1189
1245
  }
1190
1246
 
1247
+ export async function RB_lastBefore$(self_, key_, ff_core_Ordering_Order$K, $task) {
1248
+ {
1249
+ const _1 = self_;
1250
+ if(_1.E) {
1251
+ return ff_core_Option.None()
1252
+ }
1253
+ if(_1.T) {
1254
+ const l_ = _1.left_;
1255
+ const k_ = _1.key_;
1256
+ const v_ = _1.value_;
1257
+ const r_ = _1.right_;
1258
+ if(ff_core_Ordering.notBefore_(k_, key_, ff_core_Ordering_Order$K)) {
1259
+ return ff_core_RbMap.RB_lastBefore(l_, key_, ff_core_Ordering_Order$K)
1260
+ }
1261
+ }
1262
+ {
1263
+ const l_ = _1.left_;
1264
+ const k_ = _1.key_;
1265
+ const v_ = _1.value_;
1266
+ const r_ = _1.right_;
1267
+ return ff_core_Option.Option_orElse(ff_core_RbMap.RB_lastBefore(r_, key_, ff_core_Ordering_Order$K), (() => {
1268
+ return ff_core_Option.Some(ff_core_Pair.Pair(k_, v_))
1269
+ }))
1270
+ return
1271
+ }
1272
+ }
1273
+ }
1274
+
1275
+ export async function RB_firstAfter$(self_, key_, ff_core_Ordering_Order$K, $task) {
1276
+ {
1277
+ const _1 = self_;
1278
+ if(_1.E) {
1279
+ return ff_core_Option.None()
1280
+ }
1281
+ if(_1.T) {
1282
+ const l_ = _1.left_;
1283
+ const k_ = _1.key_;
1284
+ const v_ = _1.value_;
1285
+ const r_ = _1.right_;
1286
+ if(ff_core_Ordering.notAfter_(k_, key_, ff_core_Ordering_Order$K)) {
1287
+ return ff_core_RbMap.RB_firstAfter(r_, key_, ff_core_Ordering_Order$K)
1288
+ }
1289
+ }
1290
+ {
1291
+ const l_ = _1.left_;
1292
+ const k_ = _1.key_;
1293
+ const v_ = _1.value_;
1294
+ const r_ = _1.right_;
1295
+ return ff_core_Option.Option_orElse(ff_core_RbMap.RB_firstAfter(l_, key_, ff_core_Ordering_Order$K), (() => {
1296
+ return ff_core_Option.Some(ff_core_Pair.Pair(k_, v_))
1297
+ }))
1298
+ return
1299
+ }
1300
+ }
1301
+ }
1302
+
1191
1303
  export async function RB_size$(self_, ff_core_Ordering_Order$K, $task) {
1192
1304
  {
1193
1305
  const _1 = self_;
@@ -135,6 +135,18 @@ export function Set_contains(self_, value_, ff_core_Ordering_Order$T) {
135
135
  return ff_core_Map.Map_contains(self_, value_, ff_core_Ordering_Order$T)
136
136
  }
137
137
 
138
+ export function Set_lastBefore(self_, key_, ff_core_Ordering_Order$T) {
139
+ return ff_core_Option.Option_map(ff_core_Map.Map_lastBefore(self_, key_, ff_core_Ordering_Order$T), ((_w1) => {
140
+ return _w1.first_
141
+ }))
142
+ }
143
+
144
+ export function Set_firstAfter(self_, key_, ff_core_Ordering_Order$T) {
145
+ return ff_core_Option.Option_map(ff_core_Map.Map_firstAfter(self_, key_, ff_core_Ordering_Order$T), ((_w1) => {
146
+ return _w1.first_
147
+ }))
148
+ }
149
+
138
150
  export function Set_size(self_, ff_core_Ordering_Order$T) {
139
151
  return ff_core_Map.Map_size(self_, ff_core_Ordering_Order$T)
140
152
  }
@@ -200,6 +212,18 @@ export async function Set_contains$(self_, value_, ff_core_Ordering_Order$T, $ta
200
212
  return ff_core_Map.Map_contains(self_, value_, ff_core_Ordering_Order$T)
201
213
  }
202
214
 
215
+ export async function Set_lastBefore$(self_, key_, ff_core_Ordering_Order$T, $task) {
216
+ return ff_core_Option.Option_map(ff_core_Map.Map_lastBefore(self_, key_, ff_core_Ordering_Order$T), ((_w1) => {
217
+ return _w1.first_
218
+ }))
219
+ }
220
+
221
+ export async function Set_firstAfter$(self_, key_, ff_core_Ordering_Order$T, $task) {
222
+ return ff_core_Option.Option_map(ff_core_Map.Map_firstAfter(self_, key_, ff_core_Ordering_Order$T), ((_w1) => {
223
+ return _w1.first_
224
+ }))
225
+ }
226
+
203
227
  export async function Set_size$(self_, ff_core_Ordering_Order$T, $task) {
204
228
  return ff_core_Map.Map_size(self_, ff_core_Ordering_Order$T)
205
229
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly compiler",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.47",
7
+ "version": "0.5.48",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"
@@ -4,7 +4,7 @@
4
4
  "description": "Firefly language support",
5
5
  "author": "Firefly team",
6
6
  "license": "MIT",
7
- "version": "0.5.47",
7
+ "version": "0.5.48",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Ahnfelt/firefly-boot"