@fncts/io 0.0.9 → 0.0.10

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 (81) hide show
  1. package/Channel/api.d.ts +27 -4
  2. package/Channel/internal/MergeDecision.d.ts +14 -0
  3. package/STM/api.d.ts +7 -0
  4. package/Sink/api.d.ts +455 -7
  5. package/TReentrantLock/api.d.ts +97 -0
  6. package/TReentrantLock/definition.d.ts +65 -0
  7. package/TReentrantLock.d.ts +2 -0
  8. package/_cjs/Cached/api.cjs +1 -1
  9. package/_cjs/Cached/api.cjs.map +1 -1
  10. package/_cjs/Channel/api/mapOutIOC.cjs +1 -1
  11. package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
  12. package/_cjs/Channel/api/mergeAllWith.cjs +2 -2
  13. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  14. package/_cjs/Channel/api/mergeWith.cjs +1 -1
  15. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  16. package/_cjs/Channel/api.cjs +87 -32
  17. package/_cjs/Channel/api.cjs.map +1 -1
  18. package/_cjs/Channel/internal/MergeDecision.cjs +11 -2
  19. package/_cjs/Channel/internal/MergeDecision.cjs.map +1 -1
  20. package/_cjs/IO/api/foreachC.cjs +2 -2
  21. package/_cjs/IO/api/foreachC.cjs.map +1 -1
  22. package/_cjs/STM/api.cjs +15 -6
  23. package/_cjs/STM/api.cjs.map +1 -1
  24. package/_cjs/Sink/api.cjs +1180 -40
  25. package/_cjs/Sink/api.cjs.map +1 -1
  26. package/_cjs/Stream/api.cjs +28 -28
  27. package/_cjs/Stream/api.cjs.map +1 -1
  28. package/_cjs/TReentrantLock/api.cjs +297 -0
  29. package/_cjs/TReentrantLock/api.cjs.map +1 -0
  30. package/_cjs/TReentrantLock/definition.cjs +125 -0
  31. package/_cjs/TReentrantLock/definition.cjs.map +1 -0
  32. package/_cjs/TReentrantLock.cjs +32 -0
  33. package/_cjs/TReentrantLock.cjs.map +1 -0
  34. package/_cjs/collection/immutable/Conc/filterIO.cjs +35 -0
  35. package/_cjs/collection/immutable/Conc/filterIO.cjs.map +1 -0
  36. package/_cjs/collection/immutable/Conc.cjs +13 -0
  37. package/_cjs/collection/immutable/Conc.cjs.map +1 -1
  38. package/_mjs/Cached/api.mjs +1 -1
  39. package/_mjs/Cached/api.mjs.map +1 -1
  40. package/_mjs/Channel/api/mapOutIOC.mjs +1 -1
  41. package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
  42. package/_mjs/Channel/api/mergeAllWith.mjs +2 -2
  43. package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
  44. package/_mjs/Channel/api/mergeWith.mjs +1 -1
  45. package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
  46. package/_mjs/Channel/api.mjs +75 -30
  47. package/_mjs/Channel/api.mjs.map +1 -1
  48. package/_mjs/Channel/internal/MergeDecision.mjs +7 -0
  49. package/_mjs/Channel/internal/MergeDecision.mjs.map +1 -1
  50. package/_mjs/IO/api/foreachC.mjs +2 -2
  51. package/_mjs/IO/api/foreachC.mjs.map +1 -1
  52. package/_mjs/STM/api.mjs +13 -6
  53. package/_mjs/STM/api.mjs.map +1 -1
  54. package/_mjs/Sink/api.mjs +996 -31
  55. package/_mjs/Sink/api.mjs.map +1 -1
  56. package/_mjs/Stream/api.mjs +28 -28
  57. package/_mjs/Stream/api.mjs.map +1 -1
  58. package/_mjs/TReentrantLock/api.mjs +243 -0
  59. package/_mjs/TReentrantLock/api.mjs.map +1 -0
  60. package/_mjs/TReentrantLock/definition.mjs +102 -0
  61. package/_mjs/TReentrantLock/definition.mjs.map +1 -0
  62. package/_mjs/TReentrantLock.mjs +4 -0
  63. package/_mjs/TReentrantLock.mjs.map +1 -0
  64. package/_mjs/collection/immutable/Conc/filterIO.mjs +22 -0
  65. package/_mjs/collection/immutable/Conc/filterIO.mjs.map +1 -0
  66. package/_mjs/collection/immutable/Conc.mjs +1 -0
  67. package/_mjs/collection/immutable/Conc.mjs.map +1 -1
  68. package/_src/Channel/api.ts +98 -11
  69. package/_src/Channel/internal/MergeDecision.ts +15 -0
  70. package/_src/IO/api.ts +1 -1
  71. package/_src/STM/api.ts +9 -0
  72. package/_src/Sink/api.ts +1350 -19
  73. package/_src/TFuture/definition.ts +1 -1
  74. package/_src/TReentrantLock/api.ts +193 -0
  75. package/_src/TReentrantLock/definition.ts +86 -0
  76. package/_src/TReentrantLock.ts +4 -0
  77. package/_src/collection/immutable/Conc/filterIO.ts +16 -0
  78. package/_src/collection/immutable/Conc.ts +1 -0
  79. package/collection/immutable/Conc/filterIO.d.ts +7 -0
  80. package/collection/immutable/Conc.d.ts +1 -0
  81. package/package.json +3 -3
package/Channel/api.d.ts CHANGED
@@ -12,6 +12,7 @@ import { Queue } from "@fncts/io/Queue/definition";
12
12
  import { FiberId } from "@fncts/base/data/FiberId";
13
13
  import { Has } from "@fncts/base/typeclass/Has";
14
14
  import { Scope } from "@fncts/io/Scope/definition";
15
+ import { Hub } from "@fncts/io/Hub/definition";
15
16
  import type { AsyncInputConsumer } from "@fncts/io/Channel/internal/AsyncInputConsumer";
16
17
  import type { AsyncInputProducer } from "@fncts/io/Channel/internal/AsyncInputProducer";
17
18
  import type { UpstreamPullRequest } from "@fncts/io/Channel/UpstreamPullRequest";
@@ -88,6 +89,11 @@ export declare function catchAll_<Env, Env1, InErr, InErr1, InElem, InElem1, InD
88
89
  * @tsplus location "@fncts/io/Channel/api"
89
90
  */
90
91
  export declare function catchAllCause_<Env, Env1, InErr, InErr1, InElem, InElem1, InDone, InDone1, OutErr, OutErr1, OutElem, OutElem1, OutDone, OutDone1>(self: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>, f: (cause: Cause<OutErr>) => Channel<Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone1>): Channel<Env & Env1, InErr & InErr1, InElem & InElem1, InDone & InDone1, OutErr1, OutElem | OutElem1, OutDone | OutDone1>;
92
+ /**
93
+ * @tsplus getter fncts.io.Channel collectElements
94
+ * @tsplus location "@fncts/io/Channel/api"
95
+ */
96
+ export declare function collectElements<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>): Channel<Env, InErr, InElem, InDone, OutErr, never, readonly [Conc<OutElem>, OutDone]>;
91
97
  /**
92
98
  * @tsplus getter fncts.io.Channel concatAll
93
99
  * @tsplus location "@fncts/io/Channel/api"
@@ -246,7 +252,7 @@ export declare function fromQueue<Err, Elem, Done>(queue: Queue.Dequeue<Either<E
246
252
  * @tsplus fluent fncts.io.Channel provideEnvironment
247
253
  * @tsplus location "@fncts/io/Channel/api"
248
254
  */
249
- export declare function provideEnvironment_<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>, env: Environment<Env>): Channel<unknown, InErr, InElem, InDone, OutErr, OutElem, OutDone>;
255
+ export declare function provideEnvironment_<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>, env: Lazy<Environment<Env>>): Channel<unknown, InErr, InElem, InDone, OutErr, OutElem, OutDone>;
250
256
  /**
251
257
  * @tsplus fluent fncts.io.Channel contramapEnvironment
252
258
  * @tsplus location "@fncts/io/Channel/api"
@@ -318,6 +324,12 @@ export declare function mapOutIO_<Env, Env1, InErr, InElem, InDone, OutErr, OutE
318
324
  * @tsplus location "@fncts/io/Channel/api"
319
325
  */
320
326
  export declare function matchCauseChannel_<Env, Env1, Env2, InErr, InErr1, InErr2, InElem, InElem1, InElem2, InDone, InDone1, InDone2, OutErr, OutErr2, OutErr3, OutElem, OutElem1, OutElem2, OutDone, OutDone2, OutDone3>(channel: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>, onError: (c: Cause<OutErr>) => Channel<Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone2>, onSuccess: (o: OutDone) => Channel<Env2, InErr2, InElem2, InDone2, OutErr3, OutElem2, OutDone3>): Channel<Env & Env1 & Env2, InErr & InErr1 & InErr2, InElem & InElem1 & InElem2, InDone & InDone1 & InDone2, OutErr2 | OutErr3, OutElem | OutElem1 | OutElem2, OutDone2 | OutDone3>;
327
+ /**
328
+ * Fold the channel exposing success and full error cause
329
+ * @tsplus fluent fncts.io.Channel matchChannel
330
+ * @tsplus location "@fncts/io/Channel/api"
331
+ */
332
+ export declare function matchChannel_<Env, Env1, Env2, InErr, InErr1, InErr2, InElem, InElem1, InElem2, InDone, InDone1, InDone2, OutErr, OutErr2, OutErr3, OutElem, OutElem1, OutElem2, OutDone, OutDone2, OutDone3>(channel: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>, onError: (e: OutErr) => Channel<Env1, InErr1, InElem1, InDone1, OutErr2, OutElem1, OutDone2>, onSuccess: (o: OutDone) => Channel<Env2, InErr2, InElem2, InDone2, OutErr3, OutElem2, OutDone3>): Channel<Env & Env1 & Env2, InErr & InErr1 & InErr2, InElem & InElem1 & InElem2, InDone & InDone1 & InDone2, OutErr2 | OutErr3, OutElem | OutElem1 | OutElem2, OutDone2 | OutDone3>;
321
333
  export declare const never: Channel<unknown, unknown, unknown, unknown, never, never, never>;
322
334
  /**
323
335
  * Returns a new channel that will perform the operations of this one, until failure, and then
@@ -339,6 +351,7 @@ export declare function orHaltWith_<Env, InErr, InElem, InDone, OutErr, OutElem,
339
351
  /**
340
352
  * Pipe the output of a channel into the input of another
341
353
  * @tsplus fluent fncts.io.Channel pipeTo
354
+ * @tsplus operator fncts.io.Channel >>>
342
355
  * @tsplus location "@fncts/io/Channel/api"
343
356
  */
344
357
  export declare function pipeTo_<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone, Env1, OutErr1, OutElem1, OutDone1>(left: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>, right: Channel<Env1, OutErr, OutElem, OutDone, OutErr1, OutElem1, OutDone1>): Channel<Env & Env1, InErr, InElem, InDone, OutErr1, OutElem1, OutDone1>;
@@ -376,10 +389,10 @@ export declare function readWith<Env, Env1, Env2, InErr, InElem, InDone, OutErr,
376
389
  */
377
390
  export declare function repeated<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>): Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>;
378
391
  /**
379
- * @tsplus static fncts.io.Channel toQueue
392
+ * @tsplus static fncts.io.ChannelOps toQueue
380
393
  * @tsplus location "@fncts/io/Channel/api"
381
394
  */
382
- export declare function toQueue<Err, Done, Elem>(queue: Queue.Enqueue<Either<Exit<Err, Done>, Elem>>): Channel<unknown, Err, Elem, Done, never, never, any>;
395
+ export declare function toQueue<Err, Done, Elem>(queue: Lazy<Queue.Enqueue<Either<Exit<Err, Done>, Elem>>>): Channel<unknown, Err, Elem, Done, never, never, unknown>;
383
396
  /**
384
397
  * Writes an output to the channel
385
398
  * @tsplus static fncts.io.ChannelOps write
@@ -418,4 +431,14 @@ export declare function unwrap<R, E, Env, InErr, InElem, InDone, OutErr, OutElem
418
431
  * @tsplus static fncts.io.ChannelOps unwrapScoped
419
432
  * @tsplus location "@fncts/io/Channel/api"
420
433
  */
421
- export declare function unwrapScoped<R, E, Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: IO<R & Has<Scope>, E, Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>>): Channel<R & Env, InErr, InElem, InDone, E | OutErr, OutElem, OutDone>;
434
+ export declare function unwrapScoped<R, E, Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(self: Lazy<IO<R & Has<Scope>, E, Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>>>): Channel<R & Env, InErr, InElem, InDone, E | OutErr, OutElem, OutDone>;
435
+ /**
436
+ * @tsplus static fncts.io.ChannelOps fromHubScoped
437
+ * @tsplus location "@fncts/io/Channel/api"
438
+ */
439
+ export declare function fromHubScoped<Err, Done, Elem>(hub: Lazy<Hub<Either<Exit<Err, Done>, Elem>>>): IO<Has<Scope>, never, Channel<unknown, unknown, unknown, unknown, Err, Elem, Done>>;
440
+ /**
441
+ * @tsplus static fncts.io.ChannelOps toHub
442
+ * @tsplus location "@fncts/io/Channel/api"
443
+ */
444
+ export declare function toHub<Err, Done, Elem>(hub: Lazy<Hub<Either<Exit<Err, Done>, Elem>>>): Channel<unknown, Err, Elem, Done, never, never, unknown>;
@@ -18,6 +18,20 @@ export declare abstract class MergeDecision<R, E0, Z0, E, Z> {
18
18
  readonly _E: () => E;
19
19
  readonly _Z: () => Z;
20
20
  }
21
+ /**
22
+ * @tsplus unify fncts.io.Channel.MergeDecision
23
+ */
24
+ export declare function unifyMergeDecision<X extends MergeDecision<any, any, any, any, any>>(_: X): MergeDecision<[
25
+ X
26
+ ] extends [MergeDecision<infer R, any, any, any, any>] ? R : never, [
27
+ X
28
+ ] extends [MergeDecision<any, infer E0, any, any, any>] ? E0 : never, [
29
+ X
30
+ ] extends [MergeDecision<any, any, infer Z0, any, any>] ? Z0 : never, [
31
+ X
32
+ ] extends [MergeDecision<any, any, any, infer E, any>] ? E : never, [
33
+ X
34
+ ] extends [MergeDecision<any, any, any, any, infer Z>] ? Z : never>;
21
35
  /**
22
36
  * @tsplus fluent fncts.io.Channel.MergeDecision concrete
23
37
  * @tsplus macro remove
package/STM/api.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import { Lazy } from "@fncts/base/data/function";
2
2
  import { Maybe } from "@fncts/base/data/Maybe";
3
3
  import { Either } from "@fncts/base/data/Either";
4
+ import { FiberId } from "@fncts/base/data/FiberId";
4
5
  import { IO } from "@fncts/io/IO/definition";
5
6
  import { Environment } from "@fncts/base/data/Environment";
6
7
  import { Refinement } from "@fncts/base/data/Refinement";
7
8
  import { Predicate } from "@fncts/base/data/Predicate";
9
+ import type { Journal } from "./internal/Journal.js";
8
10
  import { STM } from "./definition.js";
9
11
  /**
10
12
  * Maps the success value of this effect to the specified constant value.
@@ -31,6 +33,11 @@ export declare function asJustError<R, E, A>(stm: STM<R, E, A>): STM<R, Maybe<E>
31
33
  * @tsplus location "@fncts/io/STM/api"
32
34
  */
33
35
  export declare function absolve<R, E, E1, A>(z: STM<R, E, Either<E1, A>>): STM<R, E | E1, A>;
36
+ /**
37
+ * @tsplus static fncts.io.STMOps Effect
38
+ * @tsplus location "@fncts/io/STM/api"
39
+ */
40
+ export declare function makeEffect<R, E, A>(f: (journal: Journal, fiberId: FiberId, r: R) => A): STM<R, E, A>;
34
41
  /**
35
42
  * Retrieves the environment inside an stm.
36
43
  * @tsplus static fncts.io.STMOps environment
package/Sink/api.d.ts CHANGED
@@ -1,14 +1,107 @@
1
- import { Conc } from "@fncts/base/collection/immutable/Conc";
2
- import { Channel } from "@fncts/io/Channel";
3
1
  import { Sink } from "@fncts/io/Sink/definition";
2
+ import { Lazy } from "@fncts/base/data/function";
3
+ import { Conc, ConcBuilder } from "@fncts/base/collection/immutable/Conc";
4
4
  import { Predicate } from "@fncts/base/data/Predicate";
5
+ import { Channel } from "@fncts/io/Channel";
5
6
  import { IO } from "@fncts/io/IO/definition";
7
+ import { Environment } from "@fncts/base/data/Environment";
8
+ import { Cause } from "@fncts/base/data/Cause";
9
+ import { Maybe } from "@fncts/base/data/Maybe";
10
+ import { Has } from "@fncts/base/typeclass/Has";
11
+ import { Scope } from "@fncts/io/Scope/definition";
12
+ import { Either } from "@fncts/base/data/Either";
13
+ import { Queue } from "@fncts/io/Queue/definition";
14
+ import { Hub } from "@fncts/io/Hub/definition";
15
+ import { Exit } from "@fncts/base/data/Exit";
16
+ import { Tag } from "@fncts/base/data/Tag";
17
+ import { Ref } from "@fncts/io/Ref";
18
+ import { Duration } from "@fncts/base/data/Duration";
19
+ import { MergeDecision } from "../Channel/internal/MergeDecision.js";
6
20
  /**
7
- * A sink that collects all of its inputs into a chunk.
8
- * @tsplus static fncts.io.SinkOps collectAll
21
+ * @tsplus fluent fncts.io.Sink apFirst
22
+ * @tsplus location "@fncts/io/Sink/api"
23
+ */
24
+ export declare function apFirst<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z>;
25
+ /**
26
+ * @tsplus fluent fncts.io.Sink apFirstC
27
+ * @tsplus location "@fncts/io/Sink/api"
28
+ */
29
+ export declare function apFirstC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z>;
30
+ /**
31
+ * @tsplus fluent fncts.io.Sink apSecond
32
+ * @tsplus location "@fncts/io/Sink/api"
33
+ */
34
+ export declare function apSecond<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z1>;
35
+ /**
36
+ * @tsplus fluent fncts.io.Sink apSecondC
37
+ * @tsplus location "@fncts/io/Sink/api"
38
+ */
39
+ export declare function apSecondC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z1>;
40
+ /**
41
+ * @tsplus fluent fncts.io.Sink as
42
+ * @tsplus location "@fncts/io/Sink/api"
43
+ */
44
+ export declare function as<R, E, In, L, Z, Z1>(self: Sink<R, E, In, L, Z>, z: Lazy<Z1>): Sink<R, E, In, L, Z1>;
45
+ /**
46
+ * @tsplus fluent fncts.io.Sink collectAll
47
+ * @tsplus location "@fncts/io/Sink/api"
48
+ */
49
+ export declare function collectAll<R, E, In extends L, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, L, Conc<Z>>;
50
+ /**
51
+ * @tsplus fluent fncts.io.Sink collectAllWhileWith
52
+ * @tsplus location "@fncts/io/Sink/api"
53
+ */
54
+ export declare function collectAllWhileWith<R, E, In extends L, L, Z, S>(self: Sink<R, E, In, L, Z>, z: Lazy<S>, p: Predicate<Z>, f: (s: S, z: Z) => S, __tsplusTrace?: string): Sink<R, E, In, L, S>;
55
+ /**
56
+ * @tsplus getter fncts.io.Sink collectLeftover
57
+ * @tsplus location "@fncts/io/Sink/api"
58
+ */
59
+ export declare function collectLeftover<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, never, readonly [Z, Conc<L>]>;
60
+ /**
61
+ * @tsplus fluent fncts.io.Sink contramap
62
+ * @tsplus location "@fncts/io/Sink/api"
63
+ */
64
+ export declare function contramap<R, E, In, L, Z, In1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => In): Sink<R, E, In1, L, Z>;
65
+ /**
66
+ * @tsplus fluent fncts.io.Sink contramapChunks
67
+ * @tsplus location "@fncts/io/Sink/api"
68
+ */
69
+ export declare function contramapChunks<R, E, In, L, Z, In1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => Conc<In>): Sink<R, E, In1, L, Z>;
70
+ /**
71
+ * @tsplus fluent fncts.io.Sink contramapChunksIO
72
+ * @tsplus location "@fncts/io/Sink/api"
73
+ */
74
+ export declare function contramapChunksIO<R, E, In, L, Z, R1, E1, In1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => IO<R1, E1, Conc<In>>): Sink<R & R1, E | E1, In1, L, Z>;
75
+ /**
76
+ * @tsplus fluent fncts.io.Sink contramapIO
77
+ * @tsplus location "@fncts/io/Sink/api"
78
+ */
79
+ export declare function contramapIO<R, E, In, L, Z, R1, E1, In1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => IO<R1, E1, In>): Sink<R & R1, E | E1, In1, L, Z>;
80
+ /**
81
+ * @tsplus fluent fncts.io.Sink dimap
82
+ * @tsplus location "@fncts/io/Sink/api"
83
+ */
84
+ export declare function dimap<R, E, In, L, Z, In1, Z1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => In, g: (z: Z) => Z1): Sink<R, E, In1, L, Z1>;
85
+ /**
86
+ * @tsplus fluent fncts.io.Sink dimapChunks
87
+ * @tsplus location "@fncts/io/Sink/api"
88
+ */
89
+ export declare function dimapChunks<R, E, In, L, Z, In1, Z1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => Conc<In>, g: (z: Z) => Z1): Sink<R, E, In1, L, Z1>;
90
+ /**
91
+ * @tsplus fluent fncts.io.Sink dimapChunksIO
92
+ * @tsplus location "@fncts/io/Sink/api"
93
+ */
94
+ export declare function dimapChunksIO<R, E, In, L, Z, R1, E1, In1, R2, E2, Z1>(self: Sink<R, E, In, L, Z>, f: (chunk: Conc<In1>) => IO<R1, E1, Conc<In>>, g: (z: Z) => IO<R2, E2, Z1>): Sink<R & R1 & R2, E | E1 | E2, In1, L, Z1>;
95
+ /**
96
+ * @tsplus fluent fncts.io.Sink dimapIO
97
+ * @tsplus location "@fncts/io/Sink/api"
98
+ */
99
+ export declare function dimapIO<R, E, In, L, Z, R1, E1, In1, R2, E2, Z1>(self: Sink<R, E, In, L, Z>, f: (inp: In1) => IO<R1, E1, In>, g: (z: Z) => IO<R2, E2, Z1>): Sink<R & R1 & R2, E | E1 | E2, In1, L, Z1>;
100
+ /**
101
+ * @tsplus static fncts.io.SinkOps defer
9
102
  * @tsplus location "@fncts/io/Sink/api"
10
103
  */
11
- export declare function collectAll<Err, A>(): Sink<unknown, Err, A, never, Conc<A>>;
104
+ export declare function defer<R, E, In, L, Z>(sink: Lazy<Sink<R, E, In, L, Z>>): Sink<R, E, In, L, Z>;
12
105
  /**
13
106
  * A sink that ignores all of its inputs.
14
107
  * @tsplus static fncts.io.SinkOps drain
@@ -20,16 +113,371 @@ export declare const drain: Sink<unknown, never, unknown, never, void>;
20
113
  * @tsplus location "@fncts/io/Sink/api"
21
114
  */
22
115
  export declare function dropWhile<Err, In>(predicate: Predicate<In>): Sink<unknown, never, In, In, any>;
116
+ /**
117
+ * @tsplus static fncts.io.SinkOps environment
118
+ * @tsplus location "@fncts/io/Sink/api"
119
+ */
120
+ export declare function environment<R>(__tsplusTrace?: string): Sink<R, never, unknown, never, Environment<R>>;
121
+ /**
122
+ * @tsplus static fncts.io.SinkOps environmentWith
123
+ * @tsplus location "@fncts/io/Sink/api"
124
+ */
125
+ export declare function environmentWith<R, Z>(f: (r: Environment<R>) => Z, __tsplusTrace?: string): Sink<R, never, unknown, never, Z>;
126
+ /**
127
+ * @tsplus static fncts.io.SinkOps environmentWithIO
128
+ * @tsplus location "@fncts/io/Sink/api"
129
+ */
130
+ export declare function environmentWithIO<R, R1, E, Z>(f: (r: Environment<R>) => IO<R1, E, Z>, __tsplusTrace?: string): Sink<R & R1, E, unknown, never, Z>;
131
+ /**
132
+ * @tsplus static fncts.io.SinkOps environmentWithSink
133
+ * @tsplus location "@fncts/io/Sink/api"
134
+ */
135
+ export declare function environmentWithSink<R, R1, E, In, L, Z>(f: (r: Environment<R>) => Sink<R1, E, In, L, Z>, __tsplusTrace?: string): Sink<R & R1, E, In, L, Z>;
136
+ /**
137
+ * @tsplus static fncts.io.SinkOps fail
138
+ * @tsplus location "@fncts/io/Sink/api"
139
+ */
140
+ export declare function fail<E>(e: Lazy<E>): Sink<unknown, E, unknown, never, never>;
141
+ /**
142
+ * @tsplus static fncts.io.SinkOps failCause
143
+ * @tsplus location "@fncts/io/Sink/api"
144
+ */
145
+ export declare function failCause<E>(cause: Lazy<Cause<E>>, __tsplusTrace?: string): Sink<unknown, E, unknown, never, never>;
146
+ /**
147
+ * @tsplus static fncts.io.SinkOps failCauseNow
148
+ * @tsplus location "@fncts/io/Sink/api"
149
+ */
150
+ export declare function failCauseNow<E>(cause: Cause<E>, __tsplusTrace?: string): Sink<unknown, E, unknown, never, never>;
151
+ /**
152
+ * @tsplus static fncts.io.SinkOps failNow
153
+ * @tsplus location "@fncts/io/Sink/api"
154
+ */
155
+ export declare function failNow<E>(e: E, __tsplusTrace?: string): Sink<unknown, E, unknown, never, never>;
156
+ /**
157
+ * @tsplus static fncts.io.SinkOps filterInput
158
+ * @tsplus location "@fncts/io/Sink/api"
159
+ */
160
+ export declare function filterInput<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, p: Predicate<In>, __tsplusTrace?: string): Sink<R, E, In, L, Z>;
161
+ /**
162
+ * @tsplus static fncts.io.SinkOps filterInputIO
163
+ * @tsplus location "@fncts/io/Sink/api"
164
+ */
165
+ export declare function filterInputIO<R, E, In, L, Z, R1, E1>(self: Sink<R, E, In, L, Z>, p: (inp: In) => IO<R1, E1, boolean>, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, Z>;
166
+ /**
167
+ * @tsplus fluent fncts.io.Sink findIO
168
+ * @tsplus location "@fncts/io/Sink/api"
169
+ */
170
+ export declare function findIO<R, E, In extends L, L, Z, R1, E1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => IO<R1, E1, boolean>, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, Maybe<Z>>;
171
+ /**
172
+ * @tsplus fluent fncts.io.Sink flatMap
173
+ * @tsplus location "@fncts/io/Sink/api"
174
+ */
175
+ export declare function flatMap<R, E, In, L, Z, R1, E1, In1 extends In, L1, Z1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => Sink<R1, E1, In1, L1, Z1>, __tsplusTrace?: string): Sink<R & R1, E | E1, In1, L | L1, Z1>;
176
+ /**
177
+ * @tsplus static fncts.io.SinkOps fromChannel
178
+ * @tsplus static fncts.io.SinkOps __call
179
+ * @tsplus location "@fncts/io/Sink/api"
180
+ */
181
+ export declare function fromChannel<R, E, In, L, Z>(channel: Channel<R, never, Conc<In>, unknown, E, Conc<L>, Z>): Sink<R, E, In, L, Z>;
182
+ /**
183
+ * @tsplus static fncts.io.SinkOps fromPush
184
+ * @tsplus location "@fncts/io/Sink/api"
185
+ */
186
+ export declare function fromPush<R, E, In, L, Z, R1>(push: IO<Has<Scope> & R, never, (_: Maybe<Conc<In>>) => IO<R1, readonly [Either<E, Z>, Conc<L>], void>>, __tsplusTrace?: string): Sink<R & R1, E, In, L, Z>;
187
+ /**
188
+ * @tsplus static fncts.io.SinkOps fromQueue
189
+ * @tsplus location "@fncts/io/Sink/api"
190
+ */
191
+ export declare function fromQueue<In>(queue: Lazy<Queue.Enqueue<In>>): Sink<unknown, never, In, never, void>;
192
+ /**
193
+ * @tsplus static fncts.io.SinkOps fromQueueWithShutdown
194
+ * @tsplus location "@fncts/io/Sink/api"
195
+ */
196
+ export declare function fromQueueWithShutdown<In>(queue: Lazy<Queue.Enqueue<In>>): Sink<unknown, never, In, never, void>;
197
+ /**
198
+ * @tsplus static fncts.io.SinkOps fromHub
199
+ * @tsplus location "@fncts/io/Sink/api"
200
+ */
201
+ export declare function fromHub<In>(hub: Lazy<Hub<In>>): Sink<unknown, never, In, never, void>;
202
+ /**
203
+ * @tsplus static fncts.io.SinkOps fromHubWithShutdown
204
+ * @tsplus location "@fncts/io/Sink/api"
205
+ */
206
+ export declare function fromHubWithShutdown<In>(hub: Lazy<Hub<In>>): Sink<unknown, never, In, never, void>;
207
+ /**
208
+ * @tsplus static fncts.io.SinkOps fromIO
209
+ * @tsplus location "@fncts/io/Sink/api"
210
+ */
211
+ export declare function fromIO<R, E, Z>(b: Lazy<IO<R, E, Z>>): Sink<R, E, unknown, never, Z>;
212
+ /**
213
+ * @tsplus static fncts.io.SinkOps halt
214
+ * @tsplus location "@fncts/io/Sink/api"
215
+ */
216
+ export declare function halt(defect: Lazy<unknown>, __tsplusTrace?: string): Sink<unknown, never, unknown, never, never>;
217
+ /**
218
+ * @tsplus static fncts.io.SinkOps haltNow
219
+ * @tsplus location "@fncts/io/Sink/api"
220
+ */
221
+ export declare function haltNow(defect: unknown, __tsplusTrace?: string): Sink<unknown, never, unknown, never, never>;
222
+ /**
223
+ * @tsplus static fncts.io.SinkOps head
224
+ * @tsplus location "@fncts/io/Sink/api"
225
+ */
226
+ export declare function head<In>(__tsplusTrace?: string): Sink<unknown, never, In, In, Maybe<In>>;
227
+ /**
228
+ * @tsplus getter fncts.io.Sink ignoreLeftover
229
+ * @tsplus location "@fncts/io/Sink/api"
230
+ */
231
+ export declare function ignoreLeftover<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, never, Z>;
232
+ /**
233
+ * @tsplus static fncts.io.SinkOps last
234
+ * @tsplus location "@fncts/io/Sink/api"
235
+ */
236
+ export declare function last<In>(__tsplusTrace?: string): Sink<unknown, never, In, In, Maybe<In>>;
237
+ /**
238
+ * @tsplus static fncts.io.SinkOps leftover
239
+ * @tsplus location "@fncts/io/Sink/api"
240
+ */
241
+ export declare function leftover<L>(c: Lazy<Conc<L>>, __tsplusTrace?: string): Sink<unknown, never, unknown, L, void>;
242
+ /**
243
+ * @tsplus static fncts.io.SinkOps log
244
+ * @tsplus location "@fncts/io/Sink/api"
245
+ */
246
+ export declare function log(message: Lazy<string>, __tsplusTrace?: string): Sink<unknown, never, unknown, never, void>;
247
+ /**
248
+ * A sink that collects all of its inputs into a chunk.
249
+ * @tsplus static fncts.io.SinkOps collectAll
250
+ * @tsplus location "@fncts/io/Sink/api"
251
+ */
252
+ export declare function makeCollectAll<In>(): Sink<unknown, never, In, never, Conc<In>>;
253
+ export declare function makeCollectAllN<In>(n: Lazy<number>): Sink<unknown, never, In, In, Conc<In>>;
23
254
  /**
24
255
  * A sink that executes the provided effectful function for every element fed to it.
25
256
  * @tsplus static fncts.io.SinkOps foreach
26
257
  * @tsplus location "@fncts/io/Sink/api"
27
258
  */
28
- export declare function foreach<R, Err, In>(f: (inp: In) => IO<R, Err, any>): Sink<R, Err, In, In, void>;
259
+ export declare function makeForeach<R, Err, In>(f: (inp: In) => IO<R, Err, any>, __tsplusTrace?: string): Sink<R, Err, In, In, void>;
260
+ /**
261
+ * @tsplus static fncts.io.SinkOps foreachChunk
262
+ * @tsplus location "@fncts/io/Sink/api"
263
+ */
264
+ export declare function makeForeachChunk<R, E, In>(f: (inp: Conc<In>) => IO<R, E, void>, __tsplusTrace?: string): Sink<R, E, In, never, void>;
29
265
  /**
30
266
  * A sink that executes the provided effectful function for every element fed to it
31
267
  * until `f` evaluates to `false`.
32
268
  * @tsplus static fncts.io.SinkOps foreachWhile
33
269
  * @tsplus location "@fncts/io/Sink/api"
34
270
  */
35
- export declare function foreachWhile<R, Err, In>(f: (_: In) => IO<R, Err, boolean>): Sink<R, Err, In, In, void>;
271
+ export declare function makeForeachWhile<R, Err, In>(f: (_: In) => IO<R, Err, boolean>, __tsplusTrace?: string): Sink<R, Err, In, In, void>;
272
+ /**
273
+ * @tsplus static fncts.io.SinkOps foreachChunkWhile
274
+ * @tsplus location "@fncts/io/Sink/api"
275
+ */
276
+ export declare function makeForeachChunkWhile<R, E, In>(f: (chunk: Conc<In>) => IO<R, E, boolean>, __tsplusTrace?: string): Sink<R, E, In, In, void>;
277
+ /**
278
+ * @tsplus static fncts.io.SinkOps fold
279
+ * @tsplus location "@fncts/io/Sink/api"
280
+ */
281
+ export declare function makeFold<In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<unknown, never, In, In, S>;
282
+ /**
283
+ * @tsplus static fncts.io.SinkOps foldUntil
284
+ * @tsplus location "@fncts/io/Sink/api"
285
+ */
286
+ export declare function makeFoldUntil<In, S>(z: Lazy<S>, max: Lazy<number>, f: (s: S, inp: In) => S, __tsplusTrace?: string): Sink<unknown, never, In, In, S>;
287
+ /**
288
+ * @tsplus static fncts.io.SinkOps foldChunks
289
+ * @tsplus location "@fncts/io/Sink/api"
290
+ */
291
+ export declare function makeFoldChunks<In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: Conc<In>) => S): Sink<unknown, never, In, never, S>;
292
+ /**
293
+ * @tsplus static fncts.io.SinkOps foldChunksIO
294
+ * @tsplus location "@fncts/io/Sink/api"
295
+ */
296
+ export declare function makeFoldChunksIO<Env, Err, In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: Conc<In>) => IO<Env, Err, S>): Sink<Env, Err, In, In, S>;
297
+ /**
298
+ * @tsplus static fncts.io.SinkOps foldLeft
299
+ * @tsplus location "@fncts/io/Sink/api"
300
+ */
301
+ export declare function makeFoldLeft<In, S>(z: Lazy<S>, f: (s: S, inp: In) => S): Sink<unknown, never, In, never, S>;
302
+ /**
303
+ * @tsplus static fncts.io.SinkOps foldLeftChunks
304
+ * @tsplus location "@fncts/io/Sink/api"
305
+ */
306
+ export declare function makeFoldLeftChunks<In, S>(z: Lazy<S>, f: (s: S, inp: Conc<In>) => S): Sink<unknown, never, In, never, S>;
307
+ /**
308
+ * @tsplus static fncts.io.SinkOps foldLeftChunksIO
309
+ * @tsplus location "@fncts/io/Sink/api"
310
+ */
311
+ export declare function makeFoldLeftChunksIO<R, E, In, S>(z: Lazy<S>, f: (s: S, inp: Conc<In>) => IO<R, E, S>): Sink<R, E, In, In, S>;
312
+ /**
313
+ * @tsplus static fncts.io.SinkOps foldLeftIO
314
+ * @tsplus location "@fncts/io/Sink/api"
315
+ */
316
+ export declare function makeFoldLeftIO<R, E, In, S>(z: Lazy<S>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R, E, In, In, S>;
317
+ /**
318
+ * @tsplus static fncts.io.SinkOps foldIO
319
+ * @tsplus location "@fncts/io/Sink/api"
320
+ */
321
+ export declare function makeFoldIO<R, E, In, S>(z: Lazy<S>, contFn: Predicate<S>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R, E, In, In, S>;
322
+ /**
323
+ * @tsplus static fncts.io.SinkOps foldUntilIO
324
+ * @tsplus location "@fncts/io/Sink/api"
325
+ */
326
+ export declare function makeFoldUntilIO<R, E, In, S>(z: Lazy<S>, max: Lazy<number>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R, E, In, In, S>;
327
+ /**
328
+ * @tsplus static fncts.io.SinkOps foldWeightedDecompose
329
+ * @tsplus location "@fncts/io/Sink/api"
330
+ */
331
+ export declare function makeFoldWeightedDecompose<In, S>(z: Lazy<S>, costFn: (s: S, inp: In) => number, max: Lazy<number>, decompose: (inp: In) => Conc<In>, f: (s: S, inp: In) => S): Sink<unknown, never, In, In, S>;
332
+ /**
333
+ * @tsplus static fncts.io.SinkOps foldWeightedDecomposeIO
334
+ * @tsplus location "@fncts/io/Sink/api"
335
+ */
336
+ export declare function makeFoldWeightedDecomposeIO<R, E, In, S, R1, E1, R2, E2>(z: Lazy<S>, costFn: (s: S, inp: In) => IO<R1, E1, number>, max: Lazy<number>, decompose: (inp: In) => IO<R2, E2, Conc<In>>, f: (s: S, inp: In) => IO<R, E, S>): Sink<R & R1 & R2, E | E1 | E2, In, In, S>;
337
+ /**
338
+ * @tsplus static fncts.io.SinkOps foldWeighted
339
+ * @tsplus location "@fncts/io/Sink/api"
340
+ */
341
+ export declare function makeFoldWeighted<In, S>(z: Lazy<S>, costFn: (s: S, inp: In) => number, max: Lazy<number>, f: (s: S, inp: In) => S): Sink<unknown, never, In, In, S>;
342
+ /**
343
+ * @tsplus static fncts.io.SinkOps foldWeightedIO
344
+ * @tsplus location "@fncts/io/Sink/api"
345
+ */
346
+ export declare function makeFoldWeightedIO<R, E, In, S, R1, E1>(z: Lazy<S>, costFn: (s: S, inp: In) => IO<R, E, number>, max: Lazy<number>, f: (s: S, inp: In) => IO<R1, E1, S>): Sink<R & R1, E | E1, In, In, S>;
347
+ /**
348
+ * Transforms this sink's result.
349
+ * @tsplus fluent fncts.io.Sink map
350
+ * @tsplus location "@fncts/io/Sink/api"
351
+ */
352
+ export declare function map_<R, E, In, L, Z, Z1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => Z1, __tsplusTrace?: string): Sink<R, E, In, L, Z1>;
353
+ /**
354
+ * Transforms the errors emitted by this sink using `f`.
355
+ * @tsplus fluent fncts.io.Sink mapError
356
+ * @tsplus location "@fncts/io/Sink/api"
357
+ */
358
+ export declare function mapError_<R, E, In, L, Z, E1>(self: Sink<R, E, In, L, Z>, f: (e: E) => E1, __tsplusTrace?: string): Sink<R, E1, In, L, Z>;
359
+ /**
360
+ * Effectfully transforms this sink's result.
361
+ * @tsplus fluent fncts.io.Sink mapIO
362
+ * @tsplus location "@fncts/io/Sink/api"
363
+ */
364
+ export declare function mapIO_<R, E, In, L, Z, R1, E1, Z1>(self: Sink<R, E, In, L, Z>, f: (z: Z) => IO<R1, E1, Z1>, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, Z1>;
365
+ /**
366
+ * Runs this sink until it yields a result, then uses that result to create
367
+ * another sink from the provided function which will continue to run until it
368
+ * yields a result.
369
+ *
370
+ * This function essentially runs sinks in sequence.
371
+ * @tsplus fluent fncts.io.Sink matchSink
372
+ * @tsplus location "@fncts/io/Sink/api"
373
+ */
374
+ export declare function matchSink_<R, E, In, L, Z, R1, E1, In1 extends In, L1, Z1, R2, E2, In2 extends In, L2, Z2>(self: Sink<R, E, In, L, Z>, onFailure: (e: E) => Sink<R1, E1, In1, L1, Z1>, onSuccess: (z: Z) => Sink<R2, E2, In2, L2, Z2>, __tsplusTrace?: string): Sink<R & R1 & R2, E1 | E2, In1 & In2, L | L1 | L2, Z1 | Z2>;
375
+ /**
376
+ * @tsplus fluent fncts.io.Sink orElse
377
+ * @tsplus location "@fncts/io/Sink/api"
378
+ */
379
+ export declare function orElse<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, __tsplusTrace?: string): Sink<R & R1, E | E1, In & In1, L | L1, Z | Z1>;
380
+ /**
381
+ * @tsplus fluent fncts.io.Sink provideEnvironment
382
+ * @tsplus location "@fncts/io/Sink/api"
383
+ */
384
+ export declare function provideEnvironment<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, r: Lazy<Environment<R>>, __tsplusTrace?: string): Sink<unknown, E, In, L, Z>;
385
+ /**
386
+ * @tsplus fluent fncts.io.Sink race
387
+ * @tsplus location "@fncts/io/Sink/api"
388
+ */
389
+ export declare function race<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, Z | Z1>;
390
+ /**
391
+ * @tsplus fluent fncts.io.Sink raceBoth
392
+ * @tsplus location "@fncts/io/Sink/api"
393
+ */
394
+ export declare function raceBoth<R, E, In, L, Z, R1, E1, In1, L1, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, capacity?: Lazy<number>): Sink<R & R1, E | E1, In & In1, L | L1, Either<Z, Z1>>;
395
+ /**
396
+ * @tsplus fluent fncts.io.Sink raceWith
397
+ * @tsplus location "@fncts/io/Sink/api"
398
+ */
399
+ export declare function raceWith<R, E, In, L, Z, R1, E1, In1, L1, Z1, R2, E2, Z2, R3, E3, Z3>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, leftDone: (exit: Exit<E, Z>) => MergeDecision<R1, E1, Z1, E2, Z2>, rightDone: (exit: Exit<E1, Z1>) => MergeDecision<R, E, Z, E3, Z3>, capacity?: Lazy<number>, __tsplusTrace?: string): Sink<R & R1 & R2 & R3, E2 | E3, In & In1, L | L1, Z2 | Z3>;
400
+ /**
401
+ * @tsplus static fncts.io.SinkOps service
402
+ * @tsplus location "@fncts/io/Sink/api"
403
+ */
404
+ export declare function service<S>(/** @tsplus auto */ tag: Tag<S>): Sink<Has<S>, never, unknown, never, S>;
405
+ /**
406
+ * @tsplus static fncts.io.SinkOps serviceWith
407
+ * @tsplus location "@fncts/io/Sink/api"
408
+ */
409
+ export declare function serviceWith<S, Z>(f: (service: S) => Z,
410
+ /** @tsplus auto */ tag: Tag<S>): Sink<Has<S>, never, unknown, never, Z>;
411
+ /**
412
+ * @tsplus static fncts.io.SinkOps serviceWithIO
413
+ * @tsplus location "@fncts/io/Sink/api"
414
+ */
415
+ export declare function serviceWithIO<S, R, E, Z>(f: (service: S) => IO<R, E, Z>,
416
+ /** @tsplus auto */ tag: Tag<S>): Sink<Has<S> & R, E, unknown, never, Z>;
417
+ /**
418
+ * @tsplus static fncts.io.SinkOps serviceWithSink
419
+ * @tsplus location "@fncts/io/Sink/api"
420
+ */
421
+ export declare function serviceWithSink<S, R, E, In, L, Z>(f: (service: S) => Sink<R, E, In, L, Z>,
422
+ /** @tsplus auto */ tag: Tag<S>): Sink<Has<S> & R, E, In, L, Z>;
423
+ /**
424
+ * @tsplus fluent fncts.io.Sink splitWhere
425
+ * @tsplus location "@fncts/io/Sink/api"
426
+ */
427
+ export declare function splitWhere<R, E, In, L extends In, Z>(self: Sink<R, E, In, L, Z>, p: Predicate<In>): Sink<R, E, In, In, Z>;
428
+ /**
429
+ * @tsplus static fncts.io.SinkOps succeed
430
+ * @tsplus location "@fncts/io/Sink/api"
431
+ */
432
+ export declare function succeed<Z>(z: Lazy<Z>, __tsplusTrace?: string): Sink<unknown, never, unknown, never, Z>;
433
+ /**
434
+ * @tsplus static fncts.io.SinkOps succeedNow
435
+ * @tsplus location "@fncts/io/Sink/api"
436
+ */
437
+ export declare function succeedNow<Z>(z: Z, __tsplusTrace?: string): Sink<unknown, never, unknown, never, Z>;
438
+ /**
439
+ * @tsplus fluent fncts.io.Sink summarized
440
+ * @tsplus location "@fncts/io/Sink/api"
441
+ */
442
+ export declare function summarized<R, E, In, L, Z, R1, E1, B, C>(self: Sink<R, E, In, L, Z>, summary: Lazy<IO<R1, E1, B>>, f: (b1: B, b2: B) => C, __tsplusTrace?: string): Sink<R & R1, E | E1, In, L, readonly [Z, C]>;
443
+ /**
444
+ * @tsplus getter fncts.io.Sink timed
445
+ * @tsplus location "@fncts/io/Sink/api"
446
+ */
447
+ export declare function timed<R, E, In, L, Z>(self: Sink<R, E, In, L, Z>, __tsplusTrace?: string): Sink<R, E, In, L, readonly [Z, Duration]>;
448
+ /**
449
+ * @tsplus static fncts.io.SinkOps unwrap
450
+ * @tsplus location "@fncts/io/Sink/api"
451
+ */
452
+ export declare function unwrap<R, E, R1, E1, In, L, Z>(io: Lazy<IO<R, E, Sink<R1, E1, In, L, Z>>>): Sink<R & R1, E | E1, In, L, Z>;
453
+ /**
454
+ * Creates a sink produced from a scoped effect.
455
+ * @tsplus static fncts.io.SinkOps unwrapScoped
456
+ * @tsplus location "@fncts/io/Sink/api"
457
+ */
458
+ export declare function unwrapScoped<R, E, R1, E1, In, L, Z>(scoped: Lazy<IO<Has<Scope> & R, E, Sink<R1, E1, In, L, Z>>>): Sink<R & R1, E | E1, In, L, Z>;
459
+ /**
460
+ * @tsplus fluent fncts.io.Sink zip
461
+ * @tsplus location "@fncts/io/Sink/api"
462
+ */
463
+ export declare function zip<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, readonly [Z, Z1]>;
464
+ /**
465
+ * @tsplus fluent fncts.io.Sink zipC
466
+ * @tsplus location "@fncts/io/Sink/api"
467
+ */
468
+ export declare function zipC<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1>(self: Sink<R, E, In, L, Z>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>): Sink<R & R1, E | E1, In & In1, L | L1, readonly [Z, Z1]>;
469
+ /**
470
+ * Feeds inputs to this sink until it yields a result, then switches over to
471
+ * the provided sink until it yields a result, finally combining the two
472
+ * results with `f`.
473
+ * @tsplus fluent fncts.io.Sink zipWith
474
+ * @tsplus location "@fncts/io/Sink/api"
475
+ */
476
+ export declare function zipWith<R, E, In, L, Z, R1, E1, In1 extends In, L1 extends L, Z1, Z2>(self: Lazy<Sink<R, E, In, L, Z>>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, f: (z: Z, z1: Z1) => Z2): Sink<R & R1, E | E1, In & In1, L | L1, Z2>;
477
+ /**
478
+ * Runs both sinks in parallel on the input and combines the results using the
479
+ * provided function.
480
+ * @tsplus fluent fncts.io.Sink zipWithC
481
+ * @tsplus location "@fncts/io/Sink/api"
482
+ */
483
+ export declare function zipWithC<R, E, In, L, Z, R1, E1, In1, L1, Z1, Z2>(self: Lazy<Sink<R, E, In, L, Z>>, that: Lazy<Sink<R1, E1, In1, L1, Z1>>, f: (z: Z, z1: Z1) => Z2): Sink<R & R1, E | E1, In & In1, L | L1, Z2>;