@fncts/io 0.0.42 → 0.0.44
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.
- package/IO/api.d.ts +11 -5
- package/IO.d.ts +1 -0
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs +2 -8
- package/_cjs/Channel/api/mapOutConcurrentIO.cjs.map +1 -1
- package/_cjs/Channel/api/mergeAllWith.cjs +14 -23
- package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
- package/_cjs/Channel/api/mergeWith.cjs +4 -16
- package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
- package/_cjs/Channel/api.cjs +18 -33
- package/_cjs/Channel/api.cjs.map +1 -1
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +2 -8
- package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
- package/_cjs/IO/api/asyncInterrupt.cjs +4 -7
- package/_cjs/IO/api/asyncInterrupt.cjs.map +1 -1
- package/_cjs/IO/api.cjs +31 -47
- package/_cjs/IO/api.cjs.map +1 -1
- package/_cjs/IO/runtime.cjs +3 -6
- package/_cjs/IO/runtime.cjs.map +1 -1
- package/_cjs/IO.cjs +11 -0
- package/_cjs/IO.cjs.map +1 -1
- package/_cjs/Layer/api.cjs +2 -5
- package/_cjs/Layer/api.cjs.map +1 -1
- package/_cjs/Push/api.cjs +1 -4
- package/_cjs/Push/api.cjs.map +1 -1
- package/_cjs/Ref/Derived.cjs +8 -35
- package/_cjs/Ref/Derived.cjs.map +1 -1
- package/_cjs/Ref/DerivedAll.cjs +8 -35
- package/_cjs/Ref/DerivedAll.cjs.map +1 -1
- package/_cjs/STM/api/core-api.cjs +1 -4
- package/_cjs/STM/api/core-api.cjs.map +1 -1
- package/_cjs/STM/api.cjs +4 -16
- package/_cjs/STM/api.cjs.map +1 -1
- package/_cjs/Schedule/api.cjs +1 -7
- package/_cjs/Schedule/api.cjs.map +1 -1
- package/_cjs/Sink/api.cjs +1 -7
- package/_cjs/Sink/api.cjs.map +1 -1
- package/_cjs/Stream/api/zipAllWith.cjs +1 -4
- package/_cjs/Stream/api/zipAllWith.cjs.map +1 -1
- package/_cjs/Stream/api/zipWithChunks.cjs +1 -4
- package/_cjs/Stream/api/zipWithChunks.cjs.map +1 -1
- package/_cjs/Stream/api.cjs +16 -37
- package/_cjs/Stream/api.cjs.map +1 -1
- package/_cjs/TRef/definition.cjs +20 -74
- package/_cjs/TRef/definition.cjs.map +1 -1
- package/_mjs/Channel/api/mapOutConcurrentIO.mjs +2 -8
- package/_mjs/Channel/api/mapOutConcurrentIO.mjs.map +1 -1
- package/_mjs/Channel/api/mergeAllWith.mjs +14 -23
- package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
- package/_mjs/Channel/api/mergeWith.mjs +4 -16
- package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
- package/_mjs/Channel/api.mjs +18 -33
- package/_mjs/Channel/api.mjs.map +1 -1
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +2 -8
- package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
- package/_mjs/IO/api/asyncInterrupt.mjs +4 -7
- package/_mjs/IO/api/asyncInterrupt.mjs.map +1 -1
- package/_mjs/IO/api.mjs +29 -45
- package/_mjs/IO/api.mjs.map +1 -1
- package/_mjs/IO/runtime.mjs +3 -6
- package/_mjs/IO/runtime.mjs.map +1 -1
- package/_mjs/IO.mjs +1 -0
- package/_mjs/IO.mjs.map +1 -1
- package/_mjs/Layer/api.mjs +2 -5
- package/_mjs/Layer/api.mjs.map +1 -1
- package/_mjs/Push/api.mjs +1 -4
- package/_mjs/Push/api.mjs.map +1 -1
- package/_mjs/Ref/Derived.mjs +8 -35
- package/_mjs/Ref/Derived.mjs.map +1 -1
- package/_mjs/Ref/DerivedAll.mjs +8 -35
- package/_mjs/Ref/DerivedAll.mjs.map +1 -1
- package/_mjs/STM/api/core-api.mjs +1 -4
- package/_mjs/STM/api/core-api.mjs.map +1 -1
- package/_mjs/STM/api.mjs +4 -16
- package/_mjs/STM/api.mjs.map +1 -1
- package/_mjs/Schedule/api.mjs +1 -7
- package/_mjs/Schedule/api.mjs.map +1 -1
- package/_mjs/Sink/api.mjs +1 -7
- package/_mjs/Sink/api.mjs.map +1 -1
- package/_mjs/Stream/api/zipAllWith.mjs +1 -4
- package/_mjs/Stream/api/zipAllWith.mjs.map +1 -1
- package/_mjs/Stream/api/zipWithChunks.mjs +1 -4
- package/_mjs/Stream/api/zipWithChunks.mjs.map +1 -1
- package/_mjs/Stream/api.mjs +16 -37
- package/_mjs/Stream/api.mjs.map +1 -1
- package/_mjs/TRef/definition.mjs +20 -74
- package/_mjs/TRef/definition.mjs.map +1 -1
- package/_src/Channel/api/mapOutConcurrentIO.ts +5 -5
- package/_src/Channel/api/mergeAllWith.ts +9 -9
- package/_src/Channel/api/mergeWith.ts +16 -16
- package/_src/Channel/api.ts +12 -32
- package/_src/Channel/internal/SingleProducerAsyncInput.ts +2 -2
- package/_src/IO/api/asyncInterrupt.ts +4 -4
- package/_src/IO/api.ts +46 -40
- package/_src/IO/runtime.ts +3 -6
- package/_src/IO.ts +1 -0
- package/_src/Layer/api.ts +1 -4
- package/_src/Push/api.ts +4 -4
- package/_src/Ref/Derived.ts +18 -20
- package/_src/Ref/DerivedAll.ts +18 -21
- package/_src/STM/api/core-api.ts +1 -1
- package/_src/STM/api.ts +4 -4
- package/_src/Schedule/api.ts +8 -8
- package/_src/Sink/api.ts +8 -8
- package/_src/Stream/api/zipAllWith.ts +4 -4
- package/_src/Stream/api/zipWithChunks.ts +4 -4
- package/_src/Stream/api.ts +20 -22
- package/_src/TRef/definition.ts +33 -36
- package/_src/index.ts +1 -0
- package/index.d.ts +1 -0
- package/package.json +4 -4
package/IO/api.d.ts
CHANGED
@@ -17,6 +17,7 @@ import { Trace } from "@fncts/base/data/Trace/definition";
|
|
17
17
|
import { List } from "@fncts/base/collection/immutable/List/definition";
|
18
18
|
import { ImmutableArray } from "@fncts/base/collection/immutable/ImmutableArray/definition";
|
19
19
|
import type { Running } from "../FiberStatus.js";
|
20
|
+
import type { ShowOptions } from "@fncts/base/data/Showable.js";
|
20
21
|
import type * as P from "@fncts/base/typeclass";
|
21
22
|
import type { _E, _R } from "@fncts/base/types";
|
22
23
|
import type { FiberRuntime } from "@fncts/io/Fiber/FiberRuntime";
|
@@ -188,8 +189,8 @@ export declare function collectIO<A, R1, E1, A1, E2>(f: Lazy<E2>, pf: (a: A) =>
|
|
188
189
|
export declare function condIO<R, R1, E, A>(b: boolean, onTrue: URIO<R, A>, onFalse: URIO<R1, E>, __tsplusTrace?: string): IO<R | R1, E, A>;
|
189
190
|
/**
|
190
191
|
* Returns a lazily constructed effect, whose construction may itself require
|
191
|
-
* effects. The effect must not throw any exceptions. When no environment is required (i.e., when R ==
|
192
|
-
* it is conceptually equivalent to `flatten(
|
192
|
+
* effects. The effect must not throw any exceptions. When no environment is required (i.e., when R == never)
|
193
|
+
* it is conceptually equivalent to `flatten(succeed(io))`. If you wonder if the effect throws exceptions,
|
193
194
|
* do not use this method, use `IO.deferTryCatch`.
|
194
195
|
* @tsplus static fncts.io.IOOps defer
|
195
196
|
* @tsplus location "@fncts/io/IO/api"
|
@@ -197,7 +198,7 @@ export declare function condIO<R, R1, E, A>(b: boolean, onTrue: URIO<R, A>, onFa
|
|
197
198
|
export declare function defer<R = never, E = never, A = never>(io: Lazy<IO<R, E, A>>, __tsplusTrace?: string): IO<R, E, A>;
|
198
199
|
/**
|
199
200
|
* Returns a lazily constructed effect, whose construction may itself require effects.
|
200
|
-
* When no environment is required (i.e., when R ==
|
201
|
+
* When no environment is required (i.e., when R == never) it is conceptually equivalent to `flatten(tryCatch(io))`.
|
201
202
|
* @tsplus static fncts.io.IOOps deferTry
|
202
203
|
* @tsplus location "@fncts/io/IO/api"
|
203
204
|
*/
|
@@ -206,7 +207,7 @@ export declare function deferTry<R = never, E = never, A = never>(io: () => IO<R
|
|
206
207
|
* Returns a lazily constructed effect, whose construction may itself require effects,
|
207
208
|
* translating any thrown exceptions into typed failed effects and mapping the error.
|
208
209
|
*
|
209
|
-
* When no environment is required (i.e., when R ==
|
210
|
+
* When no environment is required (i.e., when R == never) it is conceptually equivalent to `flatten(try(io))`.
|
210
211
|
* @tsplus static IOOps deferTryCatch
|
211
212
|
* @tsplus location "@fncts/io/IO/api"
|
212
213
|
*/
|
@@ -559,6 +560,11 @@ export declare function just<R, E, A>(self: IO<R, E, Maybe<A>>): IO<R, Maybe<E>,
|
|
559
560
|
* @tsplus location "@fncts/io/IO/api"
|
560
561
|
*/
|
561
562
|
export declare function log(message: Lazy<string>, __tsplusTrace?: string): UIO<void>;
|
563
|
+
/**
|
564
|
+
* @tsplus static fncts.io.IOOps show
|
565
|
+
* @tsplus location "@fncts/io/IO/api"
|
566
|
+
*/
|
567
|
+
export declare function show(message: Lazy<unknown>, options?: Partial<ShowOptions>, __tsplusTrace?: string): UIO<void>;
|
562
568
|
/**
|
563
569
|
* Loops with the specified effectual function, collecting the results into a
|
564
570
|
* list. The moral equivalent of:
|
@@ -879,7 +885,7 @@ export declare function succeedNow<A>(value: A, __tsplusTrace?: string): IO<neve
|
|
879
885
|
/**
|
880
886
|
* Imports a total synchronous effect into a pure `IO` value.
|
881
887
|
* The effect must not throw any exceptions. If you wonder if the effect
|
882
|
-
* throws exceptions, then do not use this method, use `IO.
|
888
|
+
* throws exceptions, then do not use this method, use `IO.tryCatch`
|
883
889
|
* @tsplus static fncts.io.IOOps succeed
|
884
890
|
* @tsplus static fncts.io.IOOps __call
|
885
891
|
* @tsplus location "@fncts/io/IO/api"
|
package/IO.d.ts
CHANGED
@@ -44,6 +44,7 @@ export * from "./IO/api/foreachConcurrent.js";
|
|
44
44
|
export * from "./IO/api/environment.js";
|
45
45
|
export * from "./IO/api/ensuringChildren.js";
|
46
46
|
export * from "./IO/api/disconnect.js";
|
47
|
+
export * from "./IO/api/diffFiberRefs.js";
|
47
48
|
export * from "./IO/api/descriptor.js";
|
48
49
|
export * from "./IO/api/delay.js";
|
49
50
|
export * from "./IO/api/daemonChildren.js";
|
@@ -32,15 +32,9 @@ const fileName_1 = "(@fncts/io) src/Channel/api/mapOutConcurrentIO.ts";
|
|
32
32
|
function mapOutConcurrentIO(n, f) {
|
33
33
|
return self => {
|
34
34
|
return tsplus_module_2.unwrapScoped(() => tsplus_module_5.map(queue => {
|
35
|
-
const consumer = tsplus_module_2.unwrap(() => tsplus_module_5.matchCause(tsplus_module_1.failCauseNow, r => tsplus_module_3.match(
|
36
|
-
Left: tsplus_module_1.endNow,
|
37
|
-
Right: outElem => tsplus_module_1.zipRight(consumer)(tsplus_module_2.writeNow(outElem))
|
38
|
-
})(r), fileName_1 + ":58:42")(tsplus_module_5.flatten(tsplus_module_4.take(queue, fileName_1 + ":58:18"), fileName_1 + ":58:23")));
|
35
|
+
const consumer = tsplus_module_2.unwrap(() => tsplus_module_5.matchCause(tsplus_module_1.failCauseNow, r => tsplus_module_3.match(tsplus_module_1.endNow, outElem => tsplus_module_1.zipRight(consumer)(tsplus_module_2.writeNow(outElem)))(r), fileName_1 + ":58:42")(tsplus_module_5.flatten(tsplus_module_4.take(queue, fileName_1 + ":58:18"), fileName_1 + ":58:23")));
|
39
36
|
return consumer;
|
40
|
-
}, fileName_1 + ":55:12")(tsplus_module_19.withChildren(getChildren => tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(queue => tsplus_module_5.flatMap(errorSignal => tsplus_module_5.flatMap(permits => tsplus_module_5.flatMap(pull => tsplus_module_5.map(() => queue, fileName_1 + ":24:12")(tsplus_module_12.fork(tsplus_module_7.uninterruptible(tsplus_module_5.forever(tsplus_module_5.matchCauseIO(cause => tsplus_module_4.offer(tsplus_module_5.failCauseNow(cause, fileName_1 + ":26:53"), fileName_1 + ":26:37")(queue), r => tsplus_module_3.match(
|
41
|
-
Left: outDone => tsplus_module_5.asUnit(tsplus_module_5.zipRight(tsplus_module_4.offer(tsplus_module_5.succeedNow(tsplus_module_6.left(outDone, fileName_1 + ":32:84"), fileName_1 + ":32:72"), fileName_1 + ":32:58")(queue), fileName_1 + ":32:46")(tsplus_module_7.interruptible(permits.withPermits(n)(tsplus_module_5.unit), fileName_1 + ":31:47")), fileName_1 + ":32:96"),
|
42
|
-
Right: outElem => tsplus_module_5.flatMap(p => tsplus_module_5.flatMap(latch => tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(() => tsplus_module_5.map(() => void 0, fileName_1 + ":48:24")(tsplus_module_8.wait(latch, fileName_1 + ":48:30")), fileName_1 + ":38:24")(permits.withPermit(tsplus_module_5.zipRight(tsplus_module_10.fulfill(p, fileName_1 + ":44:39")(tsplus_module_5.tapErrorCause(c => tsplus_module_8.failCause(c, fileName_1 + ":43:64")(p), fileName_1 + ":43:45")(tsplus_module_9.raceFirst(f(outElem), fileName_1 + ":42:41")(tsplus_module_8.wait(errorSignal, fileName_1 + ":41:40")))), fileName_1 + ":40:60")(tsplus_module_8.succeed_(undefined, fileName_1 + ":40:40")(latch)))), fileName_1 + ":37:24")(tsplus_module_4.offer(tsplus_module_5.map(tsplus_module_6.right, fileName_1 + ":37:48")(tsplus_module_8.wait(p, fileName_1 + ":37:38")), fileName_1 + ":37:36")(queue)), fileName_1 + ":36:38")(tsplus_module_11.make(fileName_1 + ":36:50")), fileName_1 + ":35:38")(tsplus_module_11.make(fileName_1 + ":35:50"))
|
43
|
-
})(r), fileName_1 + ":25:30")(pull), fileName_1 + ":51:14"), fileName_1 + ":51:22"), fileName_1 + ":51:38")), fileName_1 + ":23:32")(tsplus_module_13.toPull(self)), fileName_1 + ":22:32")(tsplus_module_14.makeSemaphore(n, fileName_1 + ":22:42")), fileName_1 + ":21:32")(tsplus_module_11.make(fileName_1 + ":21:44")), fileName_1 + ":15:26")(tsplus_module_16.acquireRelease(() => tsplus_module_15.makeBounded(n, fileName_1 + ":17:32"), queue => tsplus_module_4.shutdown(queue, fileName_1 + ":18:31"), fileName_1 + ":16:30")), fileName_1 + ":14:12")(tsplus_module_18.addFinalizer(() => tsplus_module_5.flatMap(tsplus_module_17.interruptAll, fileName_1 + ":14:48")(getChildren), fileName_1 + ":14:28")), fileName_1 + ":12:22")));
|
37
|
+
}, fileName_1 + ":55:12")(tsplus_module_19.withChildren(getChildren => tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(queue => tsplus_module_5.flatMap(errorSignal => tsplus_module_5.flatMap(permits => tsplus_module_5.flatMap(pull => tsplus_module_5.map(() => queue, fileName_1 + ":24:12")(tsplus_module_12.fork(tsplus_module_7.uninterruptible(tsplus_module_5.forever(tsplus_module_5.matchCauseIO(cause => tsplus_module_4.offer(tsplus_module_5.failCauseNow(cause, fileName_1 + ":26:53"), fileName_1 + ":26:37")(queue), r => tsplus_module_3.match(outDone => tsplus_module_5.asUnit(tsplus_module_5.zipRight(tsplus_module_4.offer(tsplus_module_5.succeedNow(tsplus_module_6.left(outDone, fileName_1 + ":32:84"), fileName_1 + ":32:72"), fileName_1 + ":32:58")(queue), fileName_1 + ":32:46")(tsplus_module_7.interruptible(permits.withPermits(n)(tsplus_module_5.unit), fileName_1 + ":31:47")), fileName_1 + ":32:96"), outElem => tsplus_module_5.flatMap(p => tsplus_module_5.flatMap(latch => tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(() => tsplus_module_5.map(() => void 0, fileName_1 + ":48:24")(tsplus_module_8.wait(latch, fileName_1 + ":48:30")), fileName_1 + ":38:24")(permits.withPermit(tsplus_module_5.zipRight(tsplus_module_10.fulfill(p, fileName_1 + ":44:39")(tsplus_module_5.tapErrorCause(c => tsplus_module_8.failCause(c, fileName_1 + ":43:64")(p), fileName_1 + ":43:45")(tsplus_module_9.raceFirst(f(outElem), fileName_1 + ":42:41")(tsplus_module_8.wait(errorSignal, fileName_1 + ":41:40")))), fileName_1 + ":40:60")(tsplus_module_8.succeed_(undefined, fileName_1 + ":40:40")(latch)))), fileName_1 + ":37:24")(tsplus_module_4.offer(tsplus_module_5.map(tsplus_module_6.right, fileName_1 + ":37:48")(tsplus_module_8.wait(p, fileName_1 + ":37:38")), fileName_1 + ":37:36")(queue)), fileName_1 + ":36:38")(tsplus_module_11.make(fileName_1 + ":36:50")), fileName_1 + ":35:38")(tsplus_module_11.make(fileName_1 + ":35:50")))(r), fileName_1 + ":25:30")(pull), fileName_1 + ":51:14"), fileName_1 + ":51:22"), fileName_1 + ":51:38")), fileName_1 + ":23:32")(tsplus_module_13.toPull(self)), fileName_1 + ":22:32")(tsplus_module_14.makeSemaphore(n, fileName_1 + ":22:42")), fileName_1 + ":21:32")(tsplus_module_11.make(fileName_1 + ":21:44")), fileName_1 + ":15:26")(tsplus_module_16.acquireRelease(() => tsplus_module_15.makeBounded(n, fileName_1 + ":17:32"), queue => tsplus_module_4.shutdown(queue, fileName_1 + ":18:31"), fileName_1 + ":16:30")), fileName_1 + ":14:12")(tsplus_module_18.addFinalizer(() => tsplus_module_5.flatMap(tsplus_module_17.interruptAll, fileName_1 + ":14:48")(getChildren), fileName_1 + ":14:28")), fileName_1 + ":12:22")));
|
44
38
|
};
|
45
39
|
}
|
46
40
|
//# sourceMappingURL=mapOutConcurrentIO.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mapOutConcurrentIO.cjs","names":["mapOutConcurrentIO","n","f","self","tsplus_module_2","unwrapScoped","tsplus_module_5","map","queue","consumer","unwrap","matchCause","tsplus_module_1","failCauseNow","r","tsplus_module_3","match","
|
1
|
+
{"version":3,"file":"mapOutConcurrentIO.cjs","names":["mapOutConcurrentIO","n","f","self","tsplus_module_2","unwrapScoped","tsplus_module_5","map","queue","consumer","unwrap","matchCause","tsplus_module_1","failCauseNow","r","tsplus_module_3","match","endNow","outElem","zipRight","writeNow","fileName_1","flatten","tsplus_module_4","take","tsplus_module_19","withChildren","getChildren","flatMap","errorSignal","permits","pull","tsplus_module_12","fork","tsplus_module_7","uninterruptible","forever","matchCauseIO","cause","offer","outDone","asUnit","succeedNow","tsplus_module_6","left","interruptible","withPermits","unit","p","latch","tsplus_module_8","wait","withPermit","tsplus_module_10","fulfill","tapErrorCause","c","failCause","tsplus_module_9","raceFirst","succeed_","undefined","right","tsplus_module_11","make","tsplus_module_13","toPull","tsplus_module_14","makeSemaphore","tsplus_module_16","acquireRelease","tsplus_module_15","makeBounded","shutdown","tsplus_module_18","addFinalizer","tsplus_module_17","interruptAll"],"sources":["../../../_src/Channel/api/mapOutConcurrentIO.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;AAGM,SAAUA,kBAAkBA,CAChCC,CAAS,EACTC,CAA8C;EAE9C,OACEC,IAAmE,IACgB;IACnF,OAAOC,eAAA,CAAAC,YAAA,OACLC,eAAA,CAAAC,GAAA,CA2COC,KAAK,IAAI;MACd,MAAMC,QAAQ,GACZL,eAAA,CAAAM,MAAA,OACEJ,eAAA,CAAAK,UAAA,CAAAC,eAAA,CAAAC,YAAA,EAAqDC,CAAC,IACpDC,eAAA,CAAAC,KAAA,CAAAJ,eAAA,CAAAK,MAAA,EAAyBC,OAAO,IAAKN,eAAA,CAAAO,QAAA,CAAmCV,QAAQ,EAA3CL,eAAA,CAAAgB,QAAA,CAAiBF,OAAO,CAAC,CAAmB,EAAjFJ,CAAC,CAAiF,EAAAO,UAAA,aAAAf,eAAA,CAAAgB,OAAA,CAAAC,eAAA,CAAAC,IAAA,CADpFhB,KAAK,EAAAa,UAAA,cAAAA,UAAA,aAEJ,CACF;MACH,OAAOZ,QAAQ;IACjB,CAAC,EAAAY,UAAA,aAnDDI,gBAAA,CAAAC,YAAA,CAAiBC,WAAW,IAAIrB,eAAA,CAAAsB,OAAA,OAAAtB,eAAA,CAAAsB,OAAA,CAGtBpB,KAAK,IAAAF,eAAA,CAAAsB,OAAA,CAMLC,WAAW,IAAAvB,eAAA,CAAAsB,OAAA,CACXE,OAAO,IAAAxB,eAAA,CAAAsB,OAAA,CACPG,IAAI,IAAAzB,eAAA,CAAAC,GAAA,OA8BHC,KAAK,EAAAa,UAAA,aAAAW,gBAAA,CAAAC,IAA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C;AACH"}
|
@@ -40,31 +40,22 @@ const fileName_1 = "(@fncts/io) src/Channel/api/mergeAllWith.ts";
|
|
40
40
|
function mergeAllWith(n, f, bufferSize = 16, mergeStrategy = "BackPressure") {
|
41
41
|
return channels => {
|
42
42
|
return tsplus_module_2.unwrapScoped(() => tsplus_module_5.map(queue => {
|
43
|
-
const consumer = tsplus_module_2.unwrap(() => tsplus_module_5.matchCause(tsplus_module_1.failCauseNow, out => tsplus_module_3.match(
|
44
|
-
Left: tsplus_module_1.endNow,
|
45
|
-
Right: outElem => tsplus_module_1.zipRight(consumer)(tsplus_module_2.writeNow(outElem))
|
46
|
-
})(out), fileName_1 + ":121:42")(tsplus_module_5.flatten(tsplus_module_4.take(queue, fileName_1 + ":121:18"), fileName_1 + ":121:23")));
|
43
|
+
const consumer = tsplus_module_2.unwrap(() => tsplus_module_5.matchCause(tsplus_module_1.failCauseNow, out => tsplus_module_3.match(tsplus_module_1.endNow, outElem => tsplus_module_1.zipRight(consumer)(tsplus_module_2.writeNow(outElem)))(out), fileName_1 + ":121:42")(tsplus_module_5.flatten(tsplus_module_4.take(queue, fileName_1 + ":121:18"), fileName_1 + ":121:23")));
|
47
44
|
return consumer;
|
48
45
|
}, fileName_1 + ":118:12")(tsplus_module_26.withChildren(getChildren => tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(queue => tsplus_module_5.flatMap(cancelers => tsplus_module_5.flatMap(lastDone => tsplus_module_5.flatMap(errorSignal => tsplus_module_5.flatMap(permits => tsplus_module_5.flatMap(pull => {
|
49
|
-
const evaluatePull = pull => tsplus_module_5.flatMap(md1 => tsplus_module_9.match(() => tsplus_module_5.unit, outDone => tsplus_module_19.update(md2 => tsplus_module_9.match(() => tsplus_module_18.just(outDone, fileName_1 + ":55:35"), lastDone => tsplus_module_18.just(f(lastDone, outDone), fileName_1 + ":56:43"))(md2), fileName_1 + ":53:36")(lastDone))(md1), fileName_1 + ":49:23")(tsplus_module_5.repeatUntil(m => tsplus_module_20.isJust(m), fileName_1 + ":48:27")(tsplus_module_5.flatMap(ea => tsplus_module_3.match(
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
case "BufferSliding":
|
63
|
-
return tsplus_module_5.flatMap(canceler => tsplus_module_5.flatMap(latch => tsplus_module_5.flatMap(size => tsplus_module_5.flatMap(() => {
|
64
|
-
const raceIOs = tsplus_module_16.scoped(tsplus_module_5.flatMap(io => tsplus_module_14.race(tsplus_module_11.wait(canceler, fileName_1 + ":104:85"))(tsplus_module_14.race(tsplus_module_11.wait(errorSignal, fileName_1 + ":104:64"))(evaluatePull(io))), fileName_1 + ":103:67")(tsplus_module_15.toPull(channel)), fileName_1 + ":105:30");
|
65
|
-
return tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(() => tsplus_module_5.map(b => !b, fileName_1 + ":108:60")(tsplus_module_11.isDone(errorSignal, fileName_1 + ":108:49")), fileName_1 + ":107:30")(tsplus_module_11.wait(latch, fileName_1 + ":107:36")), fileName_1 + ":106:30")(tsplus_module_13.fork(permits.withPermit(tsplus_module_5.zipRight(raceIOs, fileName_1 + ":106:83")(tsplus_module_11.succeed_(undefined, fileName_1 + ":106:63")(latch))), fileName_1 + ":106:93"));
|
66
|
-
}, fileName_1 + ":102:30")(tsplus_module_5.when(() => size >= 0, fileName_1 + ":102:87")(tsplus_module_5.flatMap(f => tsplus_module_11.succeed_(undefined, fileName_1 + ":102:70")(f), fileName_1 + ":102:53")(tsplus_module_4.take(cancelers, fileName_1 + ":102:40")))), fileName_1 + ":101:47")(tsplus_module_4.size(cancelers, fileName_1 + ":101:57")), fileName_1 + ":100:47")(tsplus_module_17.make(fileName_1 + ":100:59")), fileName_1 + ":99:47")(tsplus_module_17.make(fileName_1 + ":99:59"));
|
67
|
-
}
|
46
|
+
const evaluatePull = pull => tsplus_module_5.flatMap(md1 => tsplus_module_9.match(() => tsplus_module_5.unit, outDone => tsplus_module_19.update(md2 => tsplus_module_9.match(() => tsplus_module_18.just(outDone, fileName_1 + ":55:35"), lastDone => tsplus_module_18.just(f(lastDone, outDone), fileName_1 + ":56:43"))(md2), fileName_1 + ":53:36")(lastDone))(md1), fileName_1 + ":49:23")(tsplus_module_5.repeatUntil(m => tsplus_module_20.isJust(m), fileName_1 + ":48:27")(tsplus_module_5.flatMap(ea => tsplus_module_3.match(outDone => tsplus_module_5.succeedNow(tsplus_module_18.just(outDone, fileName_1 + ":44:50"), fileName_1 + ":44:45"), outElem => tsplus_module_5.as(() => tsplus_module_18.nothing(fileName_1 + ":45:92"), fileName_1 + ":45:84")(tsplus_module_4.offer(tsplus_module_5.succeedNow(tsplus_module_8.right(outElem, fileName_1 + ":45:70"), fileName_1 + ":45:57"), fileName_1 + ":45:43")(queue)))(ea), fileName_1 + ":42:23")(pull)));
|
47
|
+
return tsplus_module_5.map(() => queue, fileName_1 + ":61:12")(tsplus_module_13.fork(tsplus_module_5.repeatWhile(_function.identity, fileName_1 + ":114:27")(tsplus_module_5.matchCauseIO(cause => tsplus_module_5.zipRight(tsplus_module_5.as(() => false, fileName_1 + ":65:106")(tsplus_module_4.offer(tsplus_module_5.failCauseNow(cause, fileName_1 + ":65:95"), fileName_1 + ":65:79")(queue)), fileName_1 + ":65:67")(tsplus_module_5.flatMap(tsplus_module_6.interruptAll, fileName_1 + ":65:38")(getChildren)), doneOrChannel => tsplus_module_3.match(outDone => tsplus_module_12.raceWith(() => permits.withPermits(n)(tsplus_module_5.unit), (_, permitAcquisition) => tsplus_module_5.zipRight(tsplus_module_5.as(() => false, fileName_1 + ":72:106")(tsplus_module_7.interrupt(permitAcquisition)), fileName_1 + ":72:75")(tsplus_module_5.flatMap(tsplus_module_6.interruptAll, fileName_1 + ":72:46")(getChildren)), (_, failureAwait) => tsplus_module_5.zipRight(tsplus_module_5.as(() => false, fileName_1 + ":82:34")(tsplus_module_5.flatMap(maybeDone => tsplus_module_9.match(() => tsplus_module_4.offer(tsplus_module_5.succeedNow(tsplus_module_8.left(outDone, fileName_1 + ":78:78"), fileName_1 + ":78:66"), fileName_1 + ":78:52")(queue), lastDone => tsplus_module_4.offer(tsplus_module_5.succeedNow(tsplus_module_8.left(f(lastDone, outDone), fileName_1 + ":79:86"), fileName_1 + ":79:74"), fileName_1 + ":79:60")(queue))(maybeDone), fileName_1 + ":76:39")(tsplus_module_10.get(lastDone, fileName_1 + ":75:37"))), fileName_1 + ":74:58")(tsplus_module_7.interrupt(failureAwait)), fileName_1 + ":69:49")(tsplus_module_11.wait(errorSignal, fileName_1 + ":69:34")), channel => {
|
48
|
+
switch (mergeStrategy) {
|
49
|
+
case "BackPressure":
|
50
|
+
return tsplus_module_5.flatMap(latch => {
|
51
|
+
const raceIOs = tsplus_module_16.scoped(tsplus_module_5.flatMap(io => tsplus_module_14.race(tsplus_module_11.wait(errorSignal, fileName_1 + ":91:64"))(evaluatePull(io)), fileName_1 + ":90:67")(tsplus_module_15.toPull(channel)), fileName_1 + ":92:30");
|
52
|
+
return tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(() => tsplus_module_5.map(b => !b, fileName_1 + ":95:60")(tsplus_module_11.isDone(errorSignal, fileName_1 + ":95:49")), fileName_1 + ":94:30")(tsplus_module_11.wait(latch, fileName_1 + ":94:36")), fileName_1 + ":93:30")(tsplus_module_13.fork(permits.withPermit(tsplus_module_5.zipRight(raceIOs, fileName_1 + ":93:83")(tsplus_module_11.succeed_(undefined, fileName_1 + ":93:63")(latch))), fileName_1 + ":93:93"));
|
53
|
+
}, fileName_1 + ":89:46")(tsplus_module_17.make(fileName_1 + ":89:58"));
|
54
|
+
case "BufferSliding":
|
55
|
+
return tsplus_module_5.flatMap(canceler => tsplus_module_5.flatMap(latch => tsplus_module_5.flatMap(size => tsplus_module_5.flatMap(() => {
|
56
|
+
const raceIOs = tsplus_module_16.scoped(tsplus_module_5.flatMap(io => tsplus_module_14.race(tsplus_module_11.wait(canceler, fileName_1 + ":104:85"))(tsplus_module_14.race(tsplus_module_11.wait(errorSignal, fileName_1 + ":104:64"))(evaluatePull(io))), fileName_1 + ":103:67")(tsplus_module_15.toPull(channel)), fileName_1 + ":105:30");
|
57
|
+
return tsplus_module_5.flatMap(() => tsplus_module_5.flatMap(() => tsplus_module_5.map(b => !b, fileName_1 + ":108:60")(tsplus_module_11.isDone(errorSignal, fileName_1 + ":108:49")), fileName_1 + ":107:30")(tsplus_module_11.wait(latch, fileName_1 + ":107:36")), fileName_1 + ":106:30")(tsplus_module_13.fork(permits.withPermit(tsplus_module_5.zipRight(raceIOs, fileName_1 + ":106:83")(tsplus_module_11.succeed_(undefined, fileName_1 + ":106:63")(latch))), fileName_1 + ":106:93"));
|
58
|
+
}, fileName_1 + ":102:30")(tsplus_module_5.when(() => size >= 0, fileName_1 + ":102:87")(tsplus_module_5.flatMap(f => tsplus_module_11.succeed_(undefined, fileName_1 + ":102:70")(f), fileName_1 + ":102:53")(tsplus_module_4.take(cancelers, fileName_1 + ":102:40")))), fileName_1 + ":101:47")(tsplus_module_4.size(cancelers, fileName_1 + ":101:57")), fileName_1 + ":100:47")(tsplus_module_17.make(fileName_1 + ":100:59")), fileName_1 + ":99:47")(tsplus_module_17.make(fileName_1 + ":99:59"));
|
68
59
|
}
|
69
60
|
})(doneOrChannel), fileName_1 + ":63:28")(pull)), fileName_1 + ":114:37"));
|
70
61
|
}, fileName_1 + ":39:33")(tsplus_module_15.toPull(channels)), fileName_1 + ":38:33")(tsplus_module_21.makeSemaphore(n, fileName_1 + ":38:43")), fileName_1 + ":37:33")(tsplus_module_17.make(fileName_1 + ":37:45")), fileName_1 + ":36:33")(tsplus_module_22.make(() => tsplus_module_18.nothing(fileName_1 + ":36:66"), fileName_1 + ":36:42")), fileName_1 + ":35:33")(tsplus_module_24.acquireRelease(() => tsplus_module_23.makeUnbounded(fileName_1 + ":35:71"), queue => tsplus_module_4.shutdown(queue, fileName_1 + ":35:112"), fileName_1 + ":35:51")), fileName_1 + ":29:26")(tsplus_module_24.acquireRelease(() => tsplus_module_23.makeBounded(bufferSize, fileName_1 + ":31:32"), queue => tsplus_module_4.shutdown(queue, fileName_1 + ":32:31"), fileName_1 + ":30:30")), fileName_1 + ":28:12")(tsplus_module_25.addFinalizer(() => tsplus_module_5.flatMap(tsplus_module_6.interruptAll, fileName_1 + ":28:48")(getChildren), fileName_1 + ":28:28")), fileName_1 + ":26:22")));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mergeAllWith.cjs","names":["_function","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","mergeAllWith","f","bufferSize","mergeStrategy","channels","tsplus_module_2","unwrapScoped","tsplus_module_5","map","queue","consumer","unwrap","matchCause","tsplus_module_1","failCauseNow","out","tsplus_module_3","match","
|
1
|
+
{"version":3,"file":"mergeAllWith.cjs","names":["_function","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","mergeAllWith","f","bufferSize","mergeStrategy","channels","tsplus_module_2","unwrapScoped","tsplus_module_5","map","queue","consumer","unwrap","matchCause","tsplus_module_1","failCauseNow","out","tsplus_module_3","match","endNow","outElem","zipRight","writeNow","fileName_1","flatten","tsplus_module_4","take","tsplus_module_26","withChildren","getChildren","flatMap","cancelers","lastDone","errorSignal","permits","pull","evaluatePull","md1","tsplus_module_9","unit","outDone","tsplus_module_19","update","md2","tsplus_module_18","just","repeatUntil","m","tsplus_module_20","isJust","ea","succeedNow","as","nothing","offer","tsplus_module_8","right","tsplus_module_13","fork","repeatWhile","identity","matchCauseIO","cause","tsplus_module_6","interruptAll","doneOrChannel","tsplus_module_12","raceWith","withPermits","_","permitAcquisition","tsplus_module_7","interrupt","failureAwait","maybeDone","left","tsplus_module_10","tsplus_module_11","wait","channel","latch","raceIOs","tsplus_module_16","scoped","io","tsplus_module_14","race","tsplus_module_15","toPull","b","isDone","withPermit","succeed_","undefined","tsplus_module_17","make","canceler","size","when","tsplus_module_21","makeSemaphore","tsplus_module_22","tsplus_module_24","acquireRelease","tsplus_module_23","makeUnbounded","shutdown","makeBounded","tsplus_module_25","addFinalizer"],"sources":["../../../_src/Channel/api/mergeAllWith.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,gBAAAC,OAAA;AAAqD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CA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,EAAAN,UAAA,YAAC,CAyF1D,EAAAA,UAAA,YACH,CAQC,CACH;EACH,CAAC;AACH"}
|
@@ -41,16 +41,10 @@ function mergeWith(that, leftDone, rightDone) {
|
|
41
41
|
case "Done" /* MergeDecisionTag.Done */:
|
42
42
|
return tsplus_module_3.succeedNow(tsplus_module_4.fromIO(() => tsplus_module_3.zipRight(decision.io, fileName_1 + ":98:79")(tsplus_module_11.interrupt(fiber))), fileName_1 + ":98:39");
|
43
43
|
case "Await" /* MergeDecisionTag.Await */:
|
44
|
-
return tsplus_module_3.map(ex => tsplus_module_10.match(cause => tsplus_module_4.fromIO(() => decision.f(tsplus_module_8.failCause(cause, fileName_1 + ":102:74"))), r => tsplus_module_9.match(
|
45
|
-
Left: done => tsplus_module_4.fromIO(() => decision.f(tsplus_module_8.succeed(done, fileName_1 + ":105:81"))),
|
46
|
-
Right: elem => tsplus_module_5.zipRight(go(single(decision.f)))(tsplus_module_4.writeNow(elem))
|
47
|
-
})(r))(ex), fileName_1 + ":100:41")(tsplus_module_12.wait(fiber, fileName_1 + ":100:31"));
|
44
|
+
return tsplus_module_3.map(ex => tsplus_module_10.match(cause => tsplus_module_4.fromIO(() => decision.f(tsplus_module_8.failCause(cause, fileName_1 + ":102:74"))), r => tsplus_module_9.match(done => tsplus_module_4.fromIO(() => decision.f(tsplus_module_8.succeed(done, fileName_1 + ":105:75"))), elem => tsplus_module_5.zipRight(go(single(decision.f)))(tsplus_module_4.writeNow(elem)))(r))(ex), fileName_1 + ":100:41")(tsplus_module_12.wait(fiber, fileName_1 + ":100:31"));
|
48
45
|
}
|
49
46
|
};
|
50
|
-
return tsplus_module_10.match(cause => onDecision(done(tsplus_module_8.failCause(cause, fileName_1 + ":113:56"))), r => tsplus_module_9.match(
|
51
|
-
Left: d => onDecision(done(tsplus_module_8.succeed(d, fileName_1 + ":116:60"))),
|
52
|
-
Right: elem => tsplus_module_3.map(leftFiber => tsplus_module_5.zipRight(go(both(leftFiber, fiber)))(tsplus_module_4.writeNow(elem)), fileName_1 + ":118:40")(tsplus_module_1.forkDaemon(pull, fileName_1 + ":118:25"))
|
53
|
-
})(r))(exit);
|
47
|
+
return tsplus_module_10.match(cause => onDecision(done(tsplus_module_8.failCause(cause, fileName_1 + ":113:56"))), r => tsplus_module_9.match(d => onDecision(done(tsplus_module_8.succeed(d, fileName_1 + ":116:54"))), elem => tsplus_module_3.map(leftFiber => tsplus_module_5.zipRight(go(both(leftFiber, fiber)))(tsplus_module_4.writeNow(elem)), fileName_1 + ":118:40")(tsplus_module_1.forkDaemon(pull, fileName_1 + ":118:25")))(r))(exit);
|
54
48
|
};
|
55
49
|
const go = state => {
|
56
50
|
switch (state._tag) {
|
@@ -61,15 +55,9 @@ function mergeWith(that, leftDone, rightDone) {
|
|
61
55
|
return tsplus_module_4.unwrap(() => tsplus_module_7.raceWith(() => rj, (leftEx, _) => handleSide(leftEx, state.right, pullL)(leftDone, (l, r) => tsplus_module_2.bothRunning(l, r), f => tsplus_module_2.leftDone(f)), (rightEx, _) => handleSide(rightEx, state.left, pullR)(rightDone, (l, r) => tsplus_module_2.bothRunning(r, l), f => tsplus_module_2.rightDone(f)), fileName_1 + ":138:28")(lj));
|
62
56
|
}
|
63
57
|
case "LeftDone" /* MergeStateTag.LeftDone */:
|
64
|
-
return tsplus_module_4.unwrap(() => tsplus_module_3.map(exit => tsplus_module_10.match(cause => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.failCause(cause, fileName_1 + ":159:69"))), r => tsplus_module_9.match(
|
65
|
-
Left: d => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.succeed(d, fileName_1 + ":162:73"))),
|
66
|
-
Right: elem => tsplus_module_5.zipRight(go(tsplus_module_2.leftDone(state.f)))(tsplus_module_4.writeNow(elem))
|
67
|
-
})(r))(exit), fileName_1 + ":157:33")(tsplus_module_3.result(pullR, fileName_1 + ":157:22")));
|
58
|
+
return tsplus_module_4.unwrap(() => tsplus_module_3.map(exit => tsplus_module_10.match(cause => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.failCause(cause, fileName_1 + ":159:69"))), r => tsplus_module_9.match(d => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.succeed(d, fileName_1 + ":162:67"))), elem => tsplus_module_5.zipRight(go(tsplus_module_2.leftDone(state.f)))(tsplus_module_4.writeNow(elem)))(r))(exit), fileName_1 + ":157:33")(tsplus_module_3.result(pullR, fileName_1 + ":157:22")));
|
68
59
|
case "RightDone" /* MergeStateTag.RightDone */:
|
69
|
-
return tsplus_module_4.unwrap(() => tsplus_module_3.map(exit => tsplus_module_10.match(cause => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.failCause(cause, fileName_1 + ":172:69"))), r => tsplus_module_9.match(
|
70
|
-
Left: d => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.succeed(d, fileName_1 + ":175:73"))),
|
71
|
-
Right: elem => tsplus_module_5.zipRight(go(tsplus_module_2.rightDone(state.f)))(tsplus_module_4.writeNow(elem))
|
72
|
-
})(r))(exit), fileName_1 + ":170:33")(tsplus_module_3.result(pullL, fileName_1 + ":170:22")));
|
60
|
+
return tsplus_module_4.unwrap(() => tsplus_module_3.map(exit => tsplus_module_10.match(cause => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.failCause(cause, fileName_1 + ":172:69"))), r => tsplus_module_9.match(d => tsplus_module_4.fromIO(() => state.f(tsplus_module_8.succeed(d, fileName_1 + ":175:67"))), elem => tsplus_module_5.zipRight(go(tsplus_module_2.rightDone(state.f)))(tsplus_module_4.writeNow(elem)))(r))(exit), fileName_1 + ":170:33")(tsplus_module_3.result(pullL, fileName_1 + ":170:22")));
|
73
61
|
}
|
74
62
|
};
|
75
63
|
return tsplus_module_4.embedInput(input)(tsplus_module_5.flatMap(go)(tsplus_module_4.fromIO(() => tsplus_module_3.zipWith(tsplus_module_1.forkDaemon(pullR, fileName_1 + ":184:41"), (a, b) => tsplus_module_2.bothRunning(a, b), fileName_1 + ":184:35")(tsplus_module_1.forkDaemon(pullL, fileName_1 + ":184:16")))));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mergeWith.cjs","names":["mergeWith","that","leftDone","rightDone","self","tsplus_module_4","unwrapScoped","tsplus_module_3","flatMap","input","queueReader","fromInput","pullL","map","pullR","handleSide","exit","fiber","pull","done","both","single","onDecision","decision","_tag","succeedNow","fromIO","zipRight","io","fileName_1","tsplus_module_11","interrupt","ex","tsplus_module_10","match","cause","f","tsplus_module_8","failCause","r","tsplus_module_9","
|
1
|
+
{"version":3,"file":"mergeWith.cjs","names":["mergeWith","that","leftDone","rightDone","self","tsplus_module_4","unwrapScoped","tsplus_module_3","flatMap","input","queueReader","fromInput","pullL","map","pullR","handleSide","exit","fiber","pull","done","both","single","onDecision","decision","_tag","succeedNow","fromIO","zipRight","io","fileName_1","tsplus_module_11","interrupt","ex","tsplus_module_10","match","cause","f","tsplus_module_8","failCause","r","tsplus_module_9","succeed","elem","tsplus_module_5","go","writeNow","tsplus_module_12","wait","d","leftFiber","tsplus_module_1","forkDaemon","state","lj","tsplus_module_6","join","left","rj","right","unwrap","tsplus_module_7","raceWith","leftEx","_","l","tsplus_module_2","bothRunning","rightEx","result","embedInput","zipWith","a","b","pipeTo","tsplus_module_13","toPull","tsplus_module_14","makeSingleProducerAsyncInput"],"sources":["../../../_src/Channel/api/mergeWith.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;AAOM,SAAUA,SAASA,CAiBvBC,IAA0E,EAC1EC,QAAkG,EAClGC,SAAmG;EAEnG,OACEC,IAAmE,IASjE;IACF,OAAOC,eAAA,CAAAC,YAAA,OAAAC,eAAA,CAAAC,OAAA,CAEGC,KAAK;MACX,MAAMC,WAAW,GAAGL,eAAA,CAAAM,SAAA,CAAkBF,KAAK,CAAC;qCACtCG,KAAK,IAAAL,eAAA,CAAAM,GAAA,CACLC,KAAK;QAWX,MAAMC,UAAU,GACdA,CACEC,IAAiD,EACjDC,KAAqD,EACrDC,IAAy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AK,CAAChB,CAAC,CAACC,eAAA,CAAAI,OAAA,CAAaO,CAAC,EAAAnB,UAAA,aAAC,CAAC,CAAC,EAC9Ca,IAAI,IAAKC,eAAA,CAAAhB,QAAA,CAAgCiB,EAAE,CAACqB,eAAA,CAAA9D,SAAA,CAAqBiD,KAAK,CAAChB,CAAC,CAAC,CAAC,EAAjE/B,eAAA,CAAAwC,QAAA,CAAiBH,IAAI,CAAC,CAA4C,EAF9EH,CAAC,CAGA,EANLvB,IAAI,CAOH,EAAAa,UAAA,cAAAtB,eAAA,CAAA6D,MAAA,CARHxD,KAAK,EAAAiB,UAAA,cASJ,CACF;UACL;QACF,CAAC;QACD,OAAOxB,eAAA,CAAAgE,UAAA,CASO5D,KAAK,EATZkC,eAAA,CAAAnC,OAAA,CAQIoC,EAAE,EARNvC,eAAA,CAAAqB,MAAA,OACLnB,eAAA,CAAA+D,OAAA,CAAApB,eAAA,CAAAC,UAAA,CAAyBrC,KAAK,EAAAe,UAAA,eAAa,CAAC0C,CAAC,EAAEC,CAAC,KAC9CP,eAAA,CAAAC,WAAA,CACEK,CAAC,EACDC,CAAC,CACF,EAAA3C,UAAA,cAAAqB,eAAA,CAAAC,UAAA,CAJHvC,KAAK,EAAAiB,UAAA,cAKJ,CACF,CACa,CACM;wDA7IExB,eAAA,CAAAoE,MAAA,CAAmBxE,IAAI,EAAvBS,WAAW,CAAa,IAAAmB,UAAA,aAAA6C,gBAAA,CAAAC,MAAA,CADxBtE,eAAA,CAAAoE,MAAA,CAAmBrE,IAAI,EAAvBM,WAAW,CAAa;8BAFxBkE,gBAAA,CAAAC,4BAAA,EAA8E,EAkJvG;EACH,CAAC;AACH"}
|
package/_cjs/Channel/api.cjs
CHANGED
@@ -141,7 +141,7 @@ function as_1(z2) {
|
|
141
141
|
* @tsplus static fncts.io.ChannelOps ask
|
142
142
|
*/
|
143
143
|
function ask_1() {
|
144
|
-
return fromIO_1(() => tsplus_module_2.environment(fileName_1 + ":
|
144
|
+
return fromIO_1(() => tsplus_module_2.environment(fileName_1 + ":30:39"));
|
145
145
|
}
|
146
146
|
/**
|
147
147
|
* @tsplus getter fncts.io.Channel asUnit
|
@@ -159,7 +159,7 @@ function acquireReleaseWith(acquire, use, release) {
|
|
159
159
|
* @tsplus static fncts.io.ChannelOps acquireReleaseExitWith
|
160
160
|
*/
|
161
161
|
function acquireReleaseExitWith_1(acquire, use, release) {
|
162
|
-
return tsplus_module_1.flatMap(ref => ensuringWith_1(exit => tsplus_module_4.flatMap(fin => fin(exit), fileName_1 + ":
|
162
|
+
return tsplus_module_1.flatMap(ref => ensuringWith_1(exit => tsplus_module_4.flatMap(fin => fin(exit), fileName_1 + ":64:46")(tsplus_module_3.get(ref, fileName_1 + ":64:34")))(tsplus_module_1.flatMap(use)(fromIO_1(() => tsplus_module_6.uninterruptible(tsplus_module_4.tap(a => tsplus_module_5.set(exit => release(a, exit), fileName_1 + ":62:46")(ref), fileName_1 + ":62:31")(acquire), fileName_1 + ":62:75")))))(fromIO_1(() => tsplus_module_7.make(() => _ => tsplus_module_4.unit, fileName_1 + ":61:33")));
|
163
163
|
}
|
164
164
|
/**
|
165
165
|
* Construct a resource Channel with Acquire / Release
|
@@ -194,7 +194,7 @@ function buffer_1(empty, isEmpty, ref) {
|
|
194
194
|
} else {
|
195
195
|
return (0, _function.tuple)(tsplus_module_1.zipRight(buffer_1(empty, isEmpty, ref))(writeNow_1(v)), empty);
|
196
196
|
}
|
197
|
-
}, fileName_1 + ":
|
197
|
+
}, fileName_1 + ":108:15")(ref));
|
198
198
|
}
|
199
199
|
/**
|
200
200
|
* @tsplus static fncts.io.ChannelOps bufferChunk
|
@@ -211,10 +211,7 @@ function bufferChunk(ref) {
|
|
211
211
|
*/
|
212
212
|
function catchAll_1(f) {
|
213
213
|
return self => {
|
214
|
-
return catchAllCause_1(cause => tsplus_module_12.match(
|
215
|
-
Left: l => f(l),
|
216
|
-
Right: r => tsplus_module_1.failCauseNow(r)
|
217
|
-
})(tsplus_module_11.failureOrCause(cause)))(self);
|
214
|
+
return catchAllCause_1(cause => tsplus_module_12.match(l => f(l), r => tsplus_module_1.failCauseNow(r))(tsplus_module_11.failureOrCause(cause)))(self);
|
218
215
|
};
|
219
216
|
}
|
220
217
|
/**
|
@@ -265,7 +262,7 @@ function concatMapWith_1(f, g, h) {
|
|
265
262
|
const op = new _definition3.ChannelPrimitive(12 /* ChannelTag.ConcatAll */);
|
266
263
|
op.i0 = g;
|
267
264
|
op.i1 = h;
|
268
|
-
op.i2 = () => tsplus_module_15.PullAfterNext(tsplus_module_14.nothing(fileName_1 + ":
|
265
|
+
op.i2 = () => tsplus_module_15.PullAfterNext(tsplus_module_14.nothing(fileName_1 + ":247:64"));
|
269
266
|
op.i3 = () => tsplus_module_16.Continue;
|
270
267
|
op.i4 = channel;
|
271
268
|
op.i5 = f;
|
@@ -303,7 +300,7 @@ function concatAllWith_1(f, g) {
|
|
303
300
|
const op = new _definition3.ChannelPrimitive(12 /* ChannelTag.ConcatAll */);
|
304
301
|
op.i0 = f;
|
305
302
|
op.i1 = g;
|
306
|
-
op.i2 = () => tsplus_module_15.PullAfterNext(tsplus_module_14.nothing(fileName_1 + ":
|
303
|
+
op.i2 = () => tsplus_module_15.PullAfterNext(tsplus_module_14.nothing(fileName_1 + ":319:64"));
|
307
304
|
op.i3 = () => tsplus_module_16.Continue;
|
308
305
|
op.i4 = channels;
|
309
306
|
op.i5 = _function.identity;
|
@@ -377,7 +374,7 @@ function defer_1(effect) {
|
|
377
374
|
function doneCollectReader(builder) {
|
378
375
|
return readWith_1(out => tsplus_module_1.zipRight(doneCollectReader(builder))(fromIO_1(() => tsplus_module_4.succeed(() => {
|
379
376
|
builder.append(out);
|
380
|
-
}, fileName_1 + ":
|
377
|
+
}, fileName_1 + ":448:19"))), failNow_1, tsplus_module_1.endNow);
|
381
378
|
}
|
382
379
|
/**
|
383
380
|
* Returns a new channel, which is the same as this one, except that all the outputs are
|
@@ -392,8 +389,8 @@ function doneCollectReader(builder) {
|
|
392
389
|
function doneCollect_1(self) {
|
393
390
|
return unwrap_1(() => tsplus_module_4.succeed(() => {
|
394
391
|
const builder = tsplus_module_10.builder();
|
395
|
-
return mapIO_1(z => tsplus_module_4.succeedNow((0, _function.tuple)(builder.result(), z), fileName_1 + ":
|
396
|
-
}, fileName_1 + ":
|
392
|
+
return mapIO_1(z => tsplus_module_4.succeedNow((0, _function.tuple)(builder.result(), z), fileName_1 + ":473:80"))(pipeTo_1(doneCollectReader(builder))(self));
|
393
|
+
}, fileName_1 + ":471:15"));
|
397
394
|
}
|
398
395
|
/**
|
399
396
|
* Returns a new channel which reads all the elements from upstream's output channel
|
@@ -482,10 +479,7 @@ function flatten_1(self) {
|
|
482
479
|
* @tsplus static fncts.io.ChannelOps fromEither
|
483
480
|
*/
|
484
481
|
function fromEither(either) {
|
485
|
-
return defer_1(() => tsplus_module_12.match(
|
486
|
-
Left: failNow_1,
|
487
|
-
Right: tsplus_module_1.succeedNow
|
488
|
-
})(either()));
|
482
|
+
return defer_1(() => tsplus_module_12.match(failNow_1, tsplus_module_1.succeedNow)(either()));
|
489
483
|
}
|
490
484
|
/**
|
491
485
|
* @tsplus static fncts.io.ChannelOps fromInput
|
@@ -509,16 +503,13 @@ function fromIO_1(io) {
|
|
509
503
|
* @tsplus static fncts.io.ChannelOps fromOption
|
510
504
|
*/
|
511
505
|
function fromOption(option) {
|
512
|
-
return defer_1(() => tsplus_module_17.match(() => failNow_1(tsplus_module_14.nothing(fileName_1 + ":
|
506
|
+
return defer_1(() => tsplus_module_17.match(() => failNow_1(tsplus_module_14.nothing(fileName_1 + ":650:68")), tsplus_module_1.succeedNow)(option()));
|
513
507
|
}
|
514
508
|
/**
|
515
509
|
* @tsplus static fncts.io.ChannelOps fromQueue
|
516
510
|
*/
|
517
511
|
function fromQueue_1(queue) {
|
518
|
-
return tsplus_module_1.flatMap(_ => tsplus_module_12.match(
|
519
|
-
Left: _ => tsplus_module_18.match(tsplus_module_1.failCauseNow, tsplus_module_1.endNow)(_),
|
520
|
-
Right: elem => tsplus_module_1.zipRight(fromQueue_1(queue))(writeNow_1(elem))
|
521
|
-
})(_))(fromIO_1(() => tsplus_module_19.take(queue, fileName_1 + ":676:30")));
|
512
|
+
return tsplus_module_1.flatMap(_ => tsplus_module_12.match(_ => tsplus_module_18.match(tsplus_module_1.failCauseNow, tsplus_module_1.endNow)(_), elem => tsplus_module_1.zipRight(fromQueue_1(queue))(writeNow_1(elem)))(_))(fromIO_1(() => tsplus_module_19.take(queue, fileName_1 + ":659:30")));
|
522
513
|
}
|
523
514
|
/**
|
524
515
|
* Provides the channel with its required environment, which eliminates
|
@@ -582,7 +573,7 @@ function interrupt(fiberId) {
|
|
582
573
|
* @tsplus static fncts.io.ChannelOps scoped
|
583
574
|
*/
|
584
575
|
function scoped_1(io) {
|
585
|
-
return unwrap_1(() => tsplus_module_6.uninterruptibleMask(restore => tsplus_module_4.map(scope => acquireReleaseOutExitWith_1(tsplus_module_4.tapErrorCause(cause => scope.close(() => tsplus_module_20.failCause(cause, fileName_1 + ":
|
576
|
+
return unwrap_1(() => tsplus_module_6.uninterruptibleMask(restore => tsplus_module_4.map(scope => acquireReleaseOutExitWith_1(tsplus_module_4.tapErrorCause(cause => scope.close(() => tsplus_module_20.failCause(cause, fileName_1 + ":745:88")), fileName_1 + ":745:50")(restore(tsplus_module_21.extend(io, fileName_1 + ":745:31")(scope), fileName_1 + ":745:18")), (_, exit) => scope.close(() => exit)), fileName_1 + ":743:21")(tsplus_module_21.make), fileName_1 + ":742:27"));
|
586
577
|
}
|
587
578
|
/**
|
588
579
|
* Returns a new channel, which is the same as this one, except the failure value of the returned
|
@@ -660,10 +651,7 @@ function matchCauseChannel_1(onError, onSuccess) {
|
|
660
651
|
*/
|
661
652
|
function matchChannel(onError, onSuccess) {
|
662
653
|
return channel => {
|
663
|
-
return matchCauseChannel_1(cause => tsplus_module_12.match(
|
664
|
-
Left: onError,
|
665
|
-
Right: tsplus_module_1.failCauseNow
|
666
|
-
})(tsplus_module_11.failureOrCause(cause)), onSuccess)(channel);
|
654
|
+
return matchCauseChannel_1(cause => tsplus_module_12.match(onError, tsplus_module_1.failCauseNow)(tsplus_module_11.failureOrCause(cause)), onSuccess)(channel);
|
667
655
|
};
|
668
656
|
}
|
669
657
|
const never = exports.never = /*#__PURE__*/fromIO_1(() => tsplus_module_22.never);
|
@@ -732,7 +720,7 @@ function pipeToOrFail(right) {
|
|
732
720
|
* @tsplus static fncts.io.ChannelOps read
|
733
721
|
*/
|
734
722
|
function read() {
|
735
|
-
return readOrFail_1(tsplus_module_14.nothing(fileName_1 + ":
|
723
|
+
return readOrFail_1(tsplus_module_14.nothing(fileName_1 + ":1026:36"));
|
736
724
|
}
|
737
725
|
/**
|
738
726
|
* @tsplus static fncts.io.ChannelOps readOrFail
|
@@ -766,10 +754,7 @@ function readWithCause_1(inp, halt, done) {
|
|
766
754
|
* @tsplus static fncts.io.ChannelOps readWith
|
767
755
|
*/
|
768
756
|
function readWith_1(inp, error, done) {
|
769
|
-
return readWithCause_1(inp, c => tsplus_module_12.match(
|
770
|
-
Left: error,
|
771
|
-
Right: tsplus_module_1.failCauseNow
|
772
|
-
})(tsplus_module_11.failureOrCause(c)), done);
|
757
|
+
return readWithCause_1(inp, c => tsplus_module_12.match(error, tsplus_module_1.failCauseNow)(tsplus_module_11.failureOrCause(c)), done);
|
773
758
|
}
|
774
759
|
/**
|
775
760
|
* Repeats this channel forever
|
@@ -785,7 +770,7 @@ function repeated_1(self) {
|
|
785
770
|
function toQueue_1(queue) {
|
786
771
|
return defer_1(() => {
|
787
772
|
function toQueue(queue) {
|
788
|
-
return readWithCause_1(inp => tsplus_module_1.zipRight(toQueue(queue))(fromIO_1(() => tsplus_module_19.offer(tsplus_module_24.right(inp, fileName_1 + ":
|
773
|
+
return readWithCause_1(inp => tsplus_module_1.zipRight(toQueue(queue))(fromIO_1(() => tsplus_module_19.offer(tsplus_module_24.right(inp, fileName_1 + ":1150:57"), fileName_1 + ":1150:44")(queue))), cause => fromIO_1(() => tsplus_module_19.offer(tsplus_module_24.left(tsplus_module_20.failCause(cause, fileName_1 + ":1151:73"), fileName_1 + ":1151:58"), fileName_1 + ":1151:46")(queue)), done => fromIO_1(() => tsplus_module_19.offer(tsplus_module_24.left(tsplus_module_20.succeed(done, fileName_1 + ":1152:70"), fileName_1 + ":1152:57"), fileName_1 + ":1152:45")(queue)));
|
789
774
|
}
|
790
775
|
return toQueue(queue());
|
791
776
|
});
|
@@ -851,7 +836,7 @@ function unwrapScoped(self) {
|
|
851
836
|
* @tsplus static fncts.io.ChannelOps fromHubScoped
|
852
837
|
*/
|
853
838
|
function fromHubScoped(hub) {
|
854
|
-
return tsplus_module_4.defer(() => tsplus_module_4.map(fromQueue_1, fileName_1 + ":
|
839
|
+
return tsplus_module_4.defer(() => tsplus_module_4.map(fromQueue_1, fileName_1 + ":1240:38")(tsplus_module_26.subscribe(hub(), fileName_1 + ":1240:24")), fileName_1 + ":1240:18");
|
855
840
|
}
|
856
841
|
/**
|
857
842
|
* @tsplus static fncts.io.ChannelOps toHub
|