@clayroach/effect 3.19.14-source-capture.6 → 3.19.14-source-capture.8
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/dist/cjs/Utils.js +1 -1
- package/dist/cjs/Utils.js.map +1 -1
- package/dist/cjs/internal/clock.js +1 -1
- package/dist/cjs/internal/clock.js.map +1 -1
- package/dist/esm/Utils.js +1 -1
- package/dist/esm/Utils.js.map +1 -1
- package/dist/esm/internal/clock.js +1 -1
- package/dist/esm/internal/clock.js.map +1 -1
- package/package.json +1 -1
- package/src/Arbitrary.ts +0 -1101
- package/src/Array.ts +0 -3589
- package/src/BigDecimal.ts +0 -1349
- package/src/BigInt.ts +0 -643
- package/src/Boolean.ts +0 -287
- package/src/Brand.ts +0 -360
- package/src/Cache.ts +0 -281
- package/src/Cause.ts +0 -1555
- package/src/Channel.ts +0 -2355
- package/src/ChildExecutorDecision.ts +0 -146
- package/src/Chunk.ts +0 -1495
- package/src/Clock.ts +0 -111
- package/src/Config.ts +0 -542
- package/src/ConfigError.ts +0 -270
- package/src/ConfigProvider.ts +0 -333
- package/src/ConfigProviderPathPatch.ts +0 -100
- package/src/Console.ts +0 -226
- package/src/Context.ts +0 -585
- package/src/Cron.ts +0 -706
- package/src/Data.ts +0 -596
- package/src/DateTime.ts +0 -1686
- package/src/DefaultServices.ts +0 -34
- package/src/Deferred.ts +0 -301
- package/src/Differ.ts +0 -450
- package/src/Duration.ts +0 -1000
- package/src/Effect.ts +0 -14839
- package/src/Effectable.ts +0 -107
- package/src/Either.ts +0 -1040
- package/src/Encoding.ts +0 -195
- package/src/Equal.ts +0 -98
- package/src/Equivalence.ts +0 -235
- package/src/ExecutionPlan.ts +0 -308
- package/src/ExecutionStrategy.ts +0 -119
- package/src/Exit.ts +0 -467
- package/src/FastCheck.ts +0 -9
- package/src/Fiber.ts +0 -744
- package/src/FiberHandle.ts +0 -540
- package/src/FiberId.ts +0 -195
- package/src/FiberMap.ts +0 -656
- package/src/FiberRef.ts +0 -431
- package/src/FiberRefs.ts +0 -204
- package/src/FiberRefsPatch.ts +0 -105
- package/src/FiberSet.ts +0 -491
- package/src/FiberStatus.ts +0 -108
- package/src/Function.ts +0 -1222
- package/src/GlobalValue.ts +0 -53
- package/src/Graph.ts +0 -3732
- package/src/GroupBy.ts +0 -103
- package/src/HKT.ts +0 -45
- package/src/Hash.ts +0 -195
- package/src/HashMap.ts +0 -519
- package/src/HashRing.ts +0 -317
- package/src/HashSet.ts +0 -2346
- package/src/Inspectable.ts +0 -287
- package/src/Iterable.ts +0 -1119
- package/src/JSONSchema.ts +0 -1044
- package/src/KeyedPool.ts +0 -167
- package/src/Layer.ts +0 -1251
- package/src/LayerMap.ts +0 -436
- package/src/List.ts +0 -977
- package/src/LogLevel.ts +0 -285
- package/src/LogSpan.ts +0 -25
- package/src/Logger.ts +0 -702
- package/src/Mailbox.ts +0 -268
- package/src/ManagedRuntime.ts +0 -180
- package/src/Match.ts +0 -1477
- package/src/MergeDecision.ts +0 -95
- package/src/MergeState.ts +0 -172
- package/src/MergeStrategy.ts +0 -107
- package/src/Metric.ts +0 -780
- package/src/MetricBoundaries.ts +0 -69
- package/src/MetricHook.ts +0 -151
- package/src/MetricKey.ts +0 -224
- package/src/MetricKeyType.ts +0 -262
- package/src/MetricLabel.ts +0 -47
- package/src/MetricPair.ts +0 -71
- package/src/MetricPolling.ts +0 -148
- package/src/MetricRegistry.ts +0 -48
- package/src/MetricState.ts +0 -257
- package/src/Micro.ts +0 -4405
- package/src/ModuleVersion.ts +0 -18
- package/src/MutableHashMap.ts +0 -411
- package/src/MutableHashSet.ts +0 -706
- package/src/MutableList.ts +0 -297
- package/src/MutableQueue.ts +0 -227
- package/src/MutableRef.ts +0 -202
- package/src/NonEmptyIterable.ts +0 -32
- package/src/Number.ts +0 -1071
- package/src/Option.ts +0 -2170
- package/src/Order.ts +0 -373
- package/src/Ordering.ts +0 -111
- package/src/ParseResult.ts +0 -2031
- package/src/PartitionedSemaphore.ts +0 -200
- package/src/Pipeable.ts +0 -566
- package/src/Pool.ts +0 -204
- package/src/Predicate.ts +0 -1405
- package/src/Pretty.ts +0 -205
- package/src/PrimaryKey.ts +0 -23
- package/src/PubSub.ts +0 -182
- package/src/Queue.ts +0 -644
- package/src/Random.ts +0 -204
- package/src/RateLimiter.ts +0 -138
- package/src/RcMap.ts +0 -141
- package/src/RcRef.ts +0 -122
- package/src/Readable.ts +0 -93
- package/src/Record.ts +0 -1274
- package/src/RedBlackTree.ts +0 -421
- package/src/Redacted.ts +0 -144
- package/src/Ref.ts +0 -180
- package/src/RegExp.ts +0 -38
- package/src/Reloadable.ts +0 -127
- package/src/Request.ts +0 -347
- package/src/RequestBlock.ts +0 -118
- package/src/RequestResolver.ts +0 -366
- package/src/Resource.ts +0 -119
- package/src/Runtime.ts +0 -383
- package/src/RuntimeFlags.ts +0 -368
- package/src/RuntimeFlagsPatch.ts +0 -183
- package/src/STM.ts +0 -2045
- package/src/Schedule.ts +0 -2219
- package/src/ScheduleDecision.ts +0 -62
- package/src/ScheduleInterval.ts +0 -151
- package/src/ScheduleIntervals.ts +0 -122
- package/src/Scheduler.ts +0 -353
- package/src/Schema.ts +0 -10914
- package/src/SchemaAST.ts +0 -3043
- package/src/Scope.ts +0 -204
- package/src/ScopedCache.ts +0 -151
- package/src/ScopedRef.ts +0 -117
- package/src/Secret.ts +0 -88
- package/src/SingleProducerAsyncInput.ts +0 -67
- package/src/Sink.ts +0 -1461
- package/src/SortedMap.ts +0 -287
- package/src/SortedSet.ts +0 -390
- package/src/Stream.ts +0 -6468
- package/src/StreamEmit.ts +0 -136
- package/src/StreamHaltStrategy.ts +0 -123
- package/src/Streamable.ts +0 -45
- package/src/String.ts +0 -778
- package/src/Struct.ts +0 -243
- package/src/Subscribable.ts +0 -100
- package/src/SubscriptionRef.ts +0 -298
- package/src/Supervisor.ts +0 -240
- package/src/Symbol.ts +0 -29
- package/src/SynchronizedRef.ts +0 -270
- package/src/TArray.ts +0 -495
- package/src/TDeferred.ts +0 -100
- package/src/TMap.ts +0 -515
- package/src/TPriorityQueue.ts +0 -223
- package/src/TPubSub.ts +0 -200
- package/src/TQueue.ts +0 -432
- package/src/TRandom.ts +0 -129
- package/src/TReentrantLock.ts +0 -224
- package/src/TRef.ts +0 -178
- package/src/TSemaphore.ts +0 -129
- package/src/TSet.ts +0 -365
- package/src/TSubscriptionRef.ts +0 -192
- package/src/Take.ts +0 -258
- package/src/TestAnnotation.ts +0 -158
- package/src/TestAnnotationMap.ts +0 -119
- package/src/TestAnnotations.ts +0 -117
- package/src/TestClock.ts +0 -556
- package/src/TestConfig.ts +0 -47
- package/src/TestContext.ts +0 -36
- package/src/TestLive.ts +0 -53
- package/src/TestServices.ts +0 -390
- package/src/TestSized.ts +0 -55
- package/src/Tracer.ts +0 -198
- package/src/Trie.ts +0 -840
- package/src/Tuple.ts +0 -305
- package/src/Types.ts +0 -353
- package/src/Unify.ts +0 -113
- package/src/UpstreamPullRequest.ts +0 -117
- package/src/UpstreamPullStrategy.ts +0 -121
- package/src/Utils.ts +0 -809
- package/src/index.ts +0 -1561
- package/src/internal/array.ts +0 -8
- package/src/internal/blockedRequests.ts +0 -520
- package/src/internal/cache.ts +0 -733
- package/src/internal/cause.ts +0 -1050
- package/src/internal/channel/channelExecutor.ts +0 -1200
- package/src/internal/channel/channelState.ts +0 -134
- package/src/internal/channel/childExecutorDecision.ts +0 -96
- package/src/internal/channel/continuation.ts +0 -200
- package/src/internal/channel/mergeDecision.ts +0 -113
- package/src/internal/channel/mergeState.ts +0 -120
- package/src/internal/channel/mergeStrategy.ts +0 -72
- package/src/internal/channel/singleProducerAsyncInput.ts +0 -259
- package/src/internal/channel/subexecutor.ts +0 -229
- package/src/internal/channel/upstreamPullRequest.ts +0 -84
- package/src/internal/channel/upstreamPullStrategy.ts +0 -87
- package/src/internal/channel.ts +0 -2603
- package/src/internal/clock.ts +0 -95
- package/src/internal/completedRequestMap.ts +0 -9
- package/src/internal/concurrency.ts +0 -54
- package/src/internal/config.ts +0 -716
- package/src/internal/configError.ts +0 -304
- package/src/internal/configProvider/pathPatch.ts +0 -97
- package/src/internal/configProvider.ts +0 -799
- package/src/internal/console.ts +0 -153
- package/src/internal/context.ts +0 -337
- package/src/internal/core-effect.ts +0 -2293
- package/src/internal/core-stream.ts +0 -998
- package/src/internal/core.ts +0 -3273
- package/src/internal/data.ts +0 -36
- package/src/internal/dataSource.ts +0 -327
- package/src/internal/dateTime.ts +0 -1277
- package/src/internal/defaultServices/console.ts +0 -100
- package/src/internal/defaultServices.ts +0 -163
- package/src/internal/deferred.ts +0 -46
- package/src/internal/differ/chunkPatch.ts +0 -211
- package/src/internal/differ/contextPatch.ts +0 -232
- package/src/internal/differ/hashMapPatch.ts +0 -220
- package/src/internal/differ/hashSetPatch.ts +0 -176
- package/src/internal/differ/orPatch.ts +0 -311
- package/src/internal/differ/readonlyArrayPatch.ts +0 -210
- package/src/internal/differ.ts +0 -200
- package/src/internal/doNotation.ts +0 -80
- package/src/internal/effect/circular.ts +0 -905
- package/src/internal/effectable.ts +0 -131
- package/src/internal/either.ts +0 -110
- package/src/internal/encoding/base64.ts +0 -286
- package/src/internal/encoding/base64Url.ts +0 -29
- package/src/internal/encoding/common.ts +0 -51
- package/src/internal/encoding/hex.ts +0 -315
- package/src/internal/errors.ts +0 -7
- package/src/internal/executionPlan.ts +0 -114
- package/src/internal/executionStrategy.ts +0 -74
- package/src/internal/fiber.ts +0 -388
- package/src/internal/fiberId.ts +0 -267
- package/src/internal/fiberMessage.ts +0 -82
- package/src/internal/fiberRefs/patch.ts +0 -144
- package/src/internal/fiberRefs.ts +0 -297
- package/src/internal/fiberRuntime.ts +0 -3915
- package/src/internal/fiberScope.ts +0 -71
- package/src/internal/fiberStatus.ts +0 -119
- package/src/internal/groupBy.ts +0 -530
- package/src/internal/hashMap/array.ts +0 -49
- package/src/internal/hashMap/bitwise.ts +0 -32
- package/src/internal/hashMap/config.ts +0 -14
- package/src/internal/hashMap/keySet.ts +0 -8
- package/src/internal/hashMap/node.ts +0 -391
- package/src/internal/hashMap.ts +0 -586
- package/src/internal/hashSet.ts +0 -323
- package/src/internal/keyedPool.ts +0 -244
- package/src/internal/layer/circular.ts +0 -228
- package/src/internal/layer.ts +0 -1487
- package/src/internal/logSpan.ts +0 -20
- package/src/internal/logger-circular.ts +0 -24
- package/src/internal/logger.ts +0 -485
- package/src/internal/mailbox.ts +0 -561
- package/src/internal/managedRuntime/circular.ts +0 -6
- package/src/internal/managedRuntime.ts +0 -134
- package/src/internal/matcher.ts +0 -652
- package/src/internal/metric/boundaries.ts +0 -75
- package/src/internal/metric/hook.ts +0 -483
- package/src/internal/metric/key.ts +0 -167
- package/src/internal/metric/keyType.ts +0 -238
- package/src/internal/metric/label.ts +0 -41
- package/src/internal/metric/pair.ts +0 -48
- package/src/internal/metric/polling.ts +0 -149
- package/src/internal/metric/registry.ts +0 -187
- package/src/internal/metric/state.ts +0 -290
- package/src/internal/metric.ts +0 -577
- package/src/internal/opCodes/cause.ts +0 -35
- package/src/internal/opCodes/channel.ts +0 -83
- package/src/internal/opCodes/channelChildExecutorDecision.ts +0 -17
- package/src/internal/opCodes/channelMergeDecision.ts +0 -11
- package/src/internal/opCodes/channelMergeState.ts +0 -17
- package/src/internal/opCodes/channelMergeStrategy.ts +0 -11
- package/src/internal/opCodes/channelState.ts +0 -23
- package/src/internal/opCodes/channelUpstreamPullRequest.ts +0 -11
- package/src/internal/opCodes/channelUpstreamPullStrategy.ts +0 -11
- package/src/internal/opCodes/config.ts +0 -65
- package/src/internal/opCodes/configError.ts +0 -35
- package/src/internal/opCodes/continuation.ts +0 -11
- package/src/internal/opCodes/deferred.ts +0 -11
- package/src/internal/opCodes/effect.ts +0 -89
- package/src/internal/opCodes/layer.ts +0 -59
- package/src/internal/opCodes/streamHaltStrategy.ts +0 -23
- package/src/internal/option.ts +0 -80
- package/src/internal/pool.ts +0 -432
- package/src/internal/pubsub.ts +0 -1762
- package/src/internal/query.ts +0 -204
- package/src/internal/queue.ts +0 -766
- package/src/internal/random.ts +0 -161
- package/src/internal/rateLimiter.ts +0 -93
- package/src/internal/rcMap.ts +0 -285
- package/src/internal/rcRef.ts +0 -192
- package/src/internal/redBlackTree/iterator.ts +0 -200
- package/src/internal/redBlackTree/node.ts +0 -68
- package/src/internal/redBlackTree.ts +0 -1245
- package/src/internal/redacted.ts +0 -73
- package/src/internal/ref.ts +0 -171
- package/src/internal/reloadable.ts +0 -140
- package/src/internal/request.ts +0 -177
- package/src/internal/resource.ts +0 -76
- package/src/internal/ringBuffer.ts +0 -68
- package/src/internal/runtime.ts +0 -558
- package/src/internal/runtimeFlags.ts +0 -188
- package/src/internal/runtimeFlagsPatch.ts +0 -103
- package/src/internal/schedule/decision.ts +0 -47
- package/src/internal/schedule/interval.ts +0 -101
- package/src/internal/schedule/intervals.ts +0 -180
- package/src/internal/schedule.ts +0 -2199
- package/src/internal/schema/errors.ts +0 -191
- package/src/internal/schema/schemaId.ts +0 -106
- package/src/internal/schema/util.ts +0 -50
- package/src/internal/scopedCache.ts +0 -644
- package/src/internal/scopedRef.ts +0 -118
- package/src/internal/secret.ts +0 -89
- package/src/internal/singleShotGen.ts +0 -35
- package/src/internal/sink.ts +0 -2120
- package/src/internal/stack.ts +0 -10
- package/src/internal/stm/core.ts +0 -817
- package/src/internal/stm/entry.ts +0 -59
- package/src/internal/stm/journal.ts +0 -123
- package/src/internal/stm/opCodes/stm.ts +0 -71
- package/src/internal/stm/opCodes/stmState.ts +0 -17
- package/src/internal/stm/opCodes/strategy.ts +0 -17
- package/src/internal/stm/opCodes/tExit.ts +0 -29
- package/src/internal/stm/opCodes/tryCommit.ts +0 -11
- package/src/internal/stm/stm.ts +0 -1453
- package/src/internal/stm/stmState.ts +0 -136
- package/src/internal/stm/tArray.ts +0 -550
- package/src/internal/stm/tDeferred.ts +0 -81
- package/src/internal/stm/tExit.ts +0 -190
- package/src/internal/stm/tMap.ts +0 -824
- package/src/internal/stm/tPriorityQueue.ts +0 -267
- package/src/internal/stm/tPubSub.ts +0 -551
- package/src/internal/stm/tQueue.ts +0 -393
- package/src/internal/stm/tRandom.ts +0 -140
- package/src/internal/stm/tReentrantLock.ts +0 -352
- package/src/internal/stm/tRef.ts +0 -195
- package/src/internal/stm/tSemaphore.ts +0 -113
- package/src/internal/stm/tSet.ts +0 -259
- package/src/internal/stm/tSubscriptionRef.ts +0 -286
- package/src/internal/stm/tryCommit.ts +0 -34
- package/src/internal/stm/txnId.ts +0 -14
- package/src/internal/stm/versioned.ts +0 -4
- package/src/internal/stream/debounceState.ts +0 -57
- package/src/internal/stream/emit.ts +0 -123
- package/src/internal/stream/haltStrategy.ts +0 -94
- package/src/internal/stream/handoff.ts +0 -187
- package/src/internal/stream/handoffSignal.ts +0 -59
- package/src/internal/stream/pull.ts +0 -34
- package/src/internal/stream/sinkEndReason.ts +0 -30
- package/src/internal/stream/zipAllState.ts +0 -88
- package/src/internal/stream/zipChunksState.ts +0 -56
- package/src/internal/stream.ts +0 -8801
- package/src/internal/string-utils.ts +0 -107
- package/src/internal/subscriptionRef.ts +0 -138
- package/src/internal/supervisor/patch.ts +0 -190
- package/src/internal/supervisor.ts +0 -303
- package/src/internal/synchronizedRef.ts +0 -114
- package/src/internal/take.ts +0 -199
- package/src/internal/testing/sleep.ts +0 -27
- package/src/internal/testing/suspendedWarningData.ts +0 -85
- package/src/internal/testing/warningData.ts +0 -94
- package/src/internal/tracer.ts +0 -293
- package/src/internal/trie.ts +0 -722
- package/src/internal/version.ts +0 -7
|
@@ -1,998 +0,0 @@
|
|
|
1
|
-
import * as Cause from "../Cause.js"
|
|
2
|
-
import type * as Channel from "../Channel.js"
|
|
3
|
-
import type * as ChildExecutorDecision from "../ChildExecutorDecision.js"
|
|
4
|
-
import * as Chunk from "../Chunk.js"
|
|
5
|
-
import type * as Context from "../Context.js"
|
|
6
|
-
import * as Effect from "../Effect.js"
|
|
7
|
-
import * as Either from "../Either.js"
|
|
8
|
-
import type * as Exit from "../Exit.js"
|
|
9
|
-
import { constVoid, dual, identity } from "../Function.js"
|
|
10
|
-
import type { LazyArg } from "../Function.js"
|
|
11
|
-
import * as Option from "../Option.js"
|
|
12
|
-
import { pipeArguments } from "../Pipeable.js"
|
|
13
|
-
import { hasProperty } from "../Predicate.js"
|
|
14
|
-
import type * as SingleProducerAsyncInput from "../SingleProducerAsyncInput.js"
|
|
15
|
-
import type * as UpstreamPullRequest from "../UpstreamPullRequest.js"
|
|
16
|
-
import type * as UpstreamPullStrategy from "../UpstreamPullStrategy.js"
|
|
17
|
-
import * as childExecutorDecision from "./channel/childExecutorDecision.js"
|
|
18
|
-
import type { ErasedContinuationK } from "./channel/continuation.js"
|
|
19
|
-
import { ContinuationKImpl } from "./channel/continuation.js"
|
|
20
|
-
import * as upstreamPullStrategy from "./channel/upstreamPullStrategy.js"
|
|
21
|
-
import * as OpCodes from "./opCodes/channel.js"
|
|
22
|
-
|
|
23
|
-
/** @internal */
|
|
24
|
-
const ChannelSymbolKey = "effect/Channel"
|
|
25
|
-
|
|
26
|
-
/** @internal */
|
|
27
|
-
export const ChannelTypeId: Channel.ChannelTypeId = Symbol.for(
|
|
28
|
-
ChannelSymbolKey
|
|
29
|
-
) as Channel.ChannelTypeId
|
|
30
|
-
|
|
31
|
-
const channelVariance = {
|
|
32
|
-
/* c8 ignore next */
|
|
33
|
-
_Env: (_: never) => _,
|
|
34
|
-
/* c8 ignore next */
|
|
35
|
-
_InErr: (_: unknown) => _,
|
|
36
|
-
/* c8 ignore next */
|
|
37
|
-
_InElem: (_: unknown) => _,
|
|
38
|
-
/* c8 ignore next */
|
|
39
|
-
_InDone: (_: unknown) => _,
|
|
40
|
-
/* c8 ignore next */
|
|
41
|
-
_OutErr: (_: never) => _,
|
|
42
|
-
/* c8 ignore next */
|
|
43
|
-
_OutElem: (_: never) => _,
|
|
44
|
-
/* c8 ignore next */
|
|
45
|
-
_OutDone: (_: never) => _
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** @internal */
|
|
49
|
-
const proto = {
|
|
50
|
-
[ChannelTypeId]: channelVariance,
|
|
51
|
-
pipe() {
|
|
52
|
-
return pipeArguments(this, arguments)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** @internal */
|
|
57
|
-
type ErasedChannel = Channel.Channel<never, unknown, never, unknown, never, unknown>
|
|
58
|
-
|
|
59
|
-
/** @internal */
|
|
60
|
-
export type Op<Tag extends string, Body = {}> =
|
|
61
|
-
& ErasedChannel
|
|
62
|
-
& Body
|
|
63
|
-
& { readonly _tag: Tag }
|
|
64
|
-
|
|
65
|
-
export type Primitive =
|
|
66
|
-
| BracketOut
|
|
67
|
-
| Bridge
|
|
68
|
-
| ConcatAll
|
|
69
|
-
| Emit
|
|
70
|
-
| Ensuring
|
|
71
|
-
| Fail
|
|
72
|
-
| Fold
|
|
73
|
-
| FromEffect
|
|
74
|
-
| PipeTo
|
|
75
|
-
| Provide
|
|
76
|
-
| Read
|
|
77
|
-
| Succeed
|
|
78
|
-
| SucceedNow
|
|
79
|
-
| Suspend
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
export interface BracketOut extends
|
|
83
|
-
Op<OpCodes.OP_BRACKET_OUT, {
|
|
84
|
-
acquire(): Effect.Effect<unknown, unknown, unknown>
|
|
85
|
-
finalizer(resource: unknown, exit: Exit.Exit<unknown, unknown>): Effect.Effect<unknown, unknown, unknown>
|
|
86
|
-
}>
|
|
87
|
-
{}
|
|
88
|
-
|
|
89
|
-
/** @internal */
|
|
90
|
-
export interface Bridge extends
|
|
91
|
-
Op<OpCodes.OP_BRIDGE, {
|
|
92
|
-
readonly input: SingleProducerAsyncInput.AsyncInputProducer<unknown, unknown, unknown>
|
|
93
|
-
readonly channel: ErasedChannel
|
|
94
|
-
}>
|
|
95
|
-
{}
|
|
96
|
-
|
|
97
|
-
/** @internal */
|
|
98
|
-
export interface ConcatAll extends
|
|
99
|
-
Op<OpCodes.OP_CONCAT_ALL, {
|
|
100
|
-
combineInners(outDone: unknown, outDone2: unknown): unknown
|
|
101
|
-
combineAll(outDone: unknown, outDone2: unknown): unknown
|
|
102
|
-
onPull(
|
|
103
|
-
request: UpstreamPullRequest.UpstreamPullRequest<unknown>
|
|
104
|
-
): UpstreamPullStrategy.UpstreamPullStrategy<unknown>
|
|
105
|
-
onEmit(outElem: unknown): ChildExecutorDecision.ChildExecutorDecision
|
|
106
|
-
value(): ErasedChannel
|
|
107
|
-
k(outElem: unknown): ErasedChannel
|
|
108
|
-
}>
|
|
109
|
-
{}
|
|
110
|
-
|
|
111
|
-
/** @internal */
|
|
112
|
-
export interface Emit extends
|
|
113
|
-
Op<OpCodes.OP_EMIT, {
|
|
114
|
-
readonly out: unknown
|
|
115
|
-
}>
|
|
116
|
-
{}
|
|
117
|
-
|
|
118
|
-
/** @internal */
|
|
119
|
-
export interface Ensuring extends
|
|
120
|
-
Op<OpCodes.OP_ENSURING, {
|
|
121
|
-
readonly channel: ErasedChannel
|
|
122
|
-
finalizer(exit: Exit.Exit<unknown, unknown>): Effect.Effect<unknown, unknown, unknown>
|
|
123
|
-
}>
|
|
124
|
-
{}
|
|
125
|
-
|
|
126
|
-
/** @internal */
|
|
127
|
-
export interface Fail extends
|
|
128
|
-
Op<OpCodes.OP_FAIL, {
|
|
129
|
-
error(): Cause.Cause<unknown>
|
|
130
|
-
}>
|
|
131
|
-
{}
|
|
132
|
-
|
|
133
|
-
/** @internal */
|
|
134
|
-
export interface Fold extends
|
|
135
|
-
Op<OpCodes.OP_FOLD, {
|
|
136
|
-
readonly channel: ErasedChannel
|
|
137
|
-
readonly k: ErasedContinuationK
|
|
138
|
-
}>
|
|
139
|
-
{}
|
|
140
|
-
|
|
141
|
-
/** @internal */
|
|
142
|
-
export interface FromEffect extends
|
|
143
|
-
Op<OpCodes.OP_FROM_EFFECT, {
|
|
144
|
-
effect(): Effect.Effect<unknown, unknown, unknown>
|
|
145
|
-
}>
|
|
146
|
-
{}
|
|
147
|
-
|
|
148
|
-
/** @internal */
|
|
149
|
-
export interface PipeTo extends
|
|
150
|
-
Op<OpCodes.OP_PIPE_TO, {
|
|
151
|
-
left(): ErasedChannel
|
|
152
|
-
right(): ErasedChannel
|
|
153
|
-
}>
|
|
154
|
-
{}
|
|
155
|
-
|
|
156
|
-
/** @internal */
|
|
157
|
-
export interface Provide extends
|
|
158
|
-
Op<OpCodes.OP_PROVIDE, {
|
|
159
|
-
context(): Context.Context<unknown>
|
|
160
|
-
readonly inner: ErasedChannel
|
|
161
|
-
}>
|
|
162
|
-
{}
|
|
163
|
-
|
|
164
|
-
/** @internal */
|
|
165
|
-
export interface Read extends
|
|
166
|
-
Op<OpCodes.OP_READ, {
|
|
167
|
-
more(input: unknown): ErasedChannel
|
|
168
|
-
readonly done: ErasedContinuationK
|
|
169
|
-
}>
|
|
170
|
-
{}
|
|
171
|
-
|
|
172
|
-
/** @internal */
|
|
173
|
-
export interface Succeed extends
|
|
174
|
-
Op<OpCodes.OP_SUCCEED, {
|
|
175
|
-
evaluate(): unknown
|
|
176
|
-
}>
|
|
177
|
-
{}
|
|
178
|
-
|
|
179
|
-
/** @internal */
|
|
180
|
-
export interface SucceedNow extends
|
|
181
|
-
Op<OpCodes.OP_SUCCEED_NOW, {
|
|
182
|
-
readonly terminal: unknown
|
|
183
|
-
}>
|
|
184
|
-
{}
|
|
185
|
-
|
|
186
|
-
/** @internal */
|
|
187
|
-
export interface Suspend extends
|
|
188
|
-
Op<OpCodes.OP_SUSPEND, {
|
|
189
|
-
channel(): ErasedChannel
|
|
190
|
-
}>
|
|
191
|
-
{}
|
|
192
|
-
|
|
193
|
-
/** @internal */
|
|
194
|
-
export const isChannel = (u: unknown): u is Channel.Channel<
|
|
195
|
-
unknown,
|
|
196
|
-
unknown,
|
|
197
|
-
unknown,
|
|
198
|
-
unknown,
|
|
199
|
-
unknown,
|
|
200
|
-
unknown,
|
|
201
|
-
unknown
|
|
202
|
-
> => hasProperty(u, ChannelTypeId) || Effect.isEffect(u)
|
|
203
|
-
|
|
204
|
-
/** @internal */
|
|
205
|
-
export const acquireReleaseOut = dual<
|
|
206
|
-
<Z, R2>(
|
|
207
|
-
release: (z: Z, e: Exit.Exit<unknown, unknown>) => Effect.Effect<unknown, never, R2>
|
|
208
|
-
) => <E, R>(self: Effect.Effect<Z, E, R>) => Channel.Channel<Z, unknown, E, unknown, void, unknown, R | R2>,
|
|
209
|
-
<Z, E, R, R2>(
|
|
210
|
-
self: Effect.Effect<Z, E, R>,
|
|
211
|
-
release: (z: Z, e: Exit.Exit<unknown, unknown>) => Effect.Effect<unknown, never, R2>
|
|
212
|
-
) => Channel.Channel<Z, unknown, E, unknown, void, unknown, R | R2>
|
|
213
|
-
>(2, (self, release) => {
|
|
214
|
-
const op = Object.create(proto)
|
|
215
|
-
op._tag = OpCodes.OP_BRACKET_OUT
|
|
216
|
-
op.acquire = () => self
|
|
217
|
-
op.finalizer = release
|
|
218
|
-
return op
|
|
219
|
-
})
|
|
220
|
-
|
|
221
|
-
/** @internal */
|
|
222
|
-
export const catchAllCause = dual<
|
|
223
|
-
<OutErr, OutElem1, InElem1, OutErr1, InErr1, OutDone1, InDone1, Env1>(
|
|
224
|
-
f: (cause: Cause.Cause<OutErr>) => Channel.Channel<OutElem1, InElem1, OutErr1, InErr1, OutDone1, InDone1, Env1>
|
|
225
|
-
) => <OutElem, InElem, InErr, OutDone, InDone, Env>(
|
|
226
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
227
|
-
) => Channel.Channel<
|
|
228
|
-
OutElem1 | OutElem,
|
|
229
|
-
InElem & InElem1,
|
|
230
|
-
OutErr1,
|
|
231
|
-
InErr & InErr1,
|
|
232
|
-
OutDone1 | OutDone,
|
|
233
|
-
InDone & InDone1,
|
|
234
|
-
Env1 | Env
|
|
235
|
-
>,
|
|
236
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, OutElem1, InElem1, OutErr1, InErr1, OutDone1, InDone1, Env1>(
|
|
237
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
238
|
-
f: (cause: Cause.Cause<OutErr>) => Channel.Channel<OutElem1, InElem1, OutErr1, InErr1, OutDone1, InDone1, Env1>
|
|
239
|
-
) => Channel.Channel<
|
|
240
|
-
OutElem1 | OutElem,
|
|
241
|
-
InElem & InElem1,
|
|
242
|
-
OutErr1,
|
|
243
|
-
InErr & InErr1,
|
|
244
|
-
OutDone1 | OutDone,
|
|
245
|
-
InDone & InDone1,
|
|
246
|
-
Env1 | Env
|
|
247
|
-
>
|
|
248
|
-
>(
|
|
249
|
-
2,
|
|
250
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, OutElem1, InElem1, OutErr1, InErr1, OutDone1, InDone1, Env1>(
|
|
251
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
252
|
-
f: (cause: Cause.Cause<OutErr>) => Channel.Channel<OutElem1, InElem1, OutErr1, InErr1, OutDone1, InDone1, Env1>
|
|
253
|
-
): Channel.Channel<
|
|
254
|
-
OutElem | OutElem1,
|
|
255
|
-
InElem & InElem1,
|
|
256
|
-
OutErr1,
|
|
257
|
-
InErr & InErr1,
|
|
258
|
-
OutDone | OutDone1,
|
|
259
|
-
InDone & InDone1,
|
|
260
|
-
Env | Env1
|
|
261
|
-
> => {
|
|
262
|
-
const op = Object.create(proto)
|
|
263
|
-
op._tag = OpCodes.OP_FOLD
|
|
264
|
-
op.channel = self
|
|
265
|
-
op.k = new ContinuationKImpl(succeed, f)
|
|
266
|
-
return op
|
|
267
|
-
}
|
|
268
|
-
)
|
|
269
|
-
|
|
270
|
-
/** @internal */
|
|
271
|
-
export const collectElements = <Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(
|
|
272
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
273
|
-
): Channel.Channel<never, InElem, OutErr, InErr, [Chunk.Chunk<OutElem>, OutDone], InDone, Env> => {
|
|
274
|
-
return suspend(() => {
|
|
275
|
-
const builder: Array<OutElem> = []
|
|
276
|
-
return flatMap(
|
|
277
|
-
pipeTo(self, collectElementsReader(builder)),
|
|
278
|
-
(value) => sync(() => [Chunk.fromIterable(builder), value])
|
|
279
|
-
)
|
|
280
|
-
})
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/** @internal */
|
|
284
|
-
const collectElementsReader = <OutErr, OutElem, OutDone>(
|
|
285
|
-
builder: Array<OutElem>
|
|
286
|
-
): Channel.Channel<never, OutElem, OutErr, OutErr, OutDone, OutDone> =>
|
|
287
|
-
readWith({
|
|
288
|
-
onInput: (outElem) =>
|
|
289
|
-
flatMap(
|
|
290
|
-
sync(() => {
|
|
291
|
-
builder.push(outElem)
|
|
292
|
-
}),
|
|
293
|
-
() => collectElementsReader<OutErr, OutElem, OutDone>(builder)
|
|
294
|
-
),
|
|
295
|
-
onFailure: fail,
|
|
296
|
-
onDone: succeedNow
|
|
297
|
-
})
|
|
298
|
-
|
|
299
|
-
/** @internal */
|
|
300
|
-
export const concatAll = <OutElem, InElem, OutErr, InErr, InDone, Env>(
|
|
301
|
-
channels: Channel.Channel<
|
|
302
|
-
Channel.Channel<OutElem, InElem, OutErr, InErr, any, InDone, Env>,
|
|
303
|
-
InElem,
|
|
304
|
-
OutErr,
|
|
305
|
-
InErr,
|
|
306
|
-
any,
|
|
307
|
-
InDone,
|
|
308
|
-
Env
|
|
309
|
-
>
|
|
310
|
-
): Channel.Channel<OutElem, InElem, OutErr, InErr, any, InDone, Env> => concatAllWith(channels, constVoid, constVoid)
|
|
311
|
-
|
|
312
|
-
/** @internal */
|
|
313
|
-
export const concatAllWith = <
|
|
314
|
-
OutElem,
|
|
315
|
-
InElem2,
|
|
316
|
-
OutErr2,
|
|
317
|
-
InErr2,
|
|
318
|
-
OutDone,
|
|
319
|
-
InDone2,
|
|
320
|
-
Env2,
|
|
321
|
-
InElem,
|
|
322
|
-
OutErr,
|
|
323
|
-
InErr,
|
|
324
|
-
OutDone2,
|
|
325
|
-
InDone,
|
|
326
|
-
Env,
|
|
327
|
-
OutDone3
|
|
328
|
-
>(
|
|
329
|
-
channels: Channel.Channel<
|
|
330
|
-
Channel.Channel<OutElem, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2>,
|
|
331
|
-
InElem,
|
|
332
|
-
OutErr,
|
|
333
|
-
InErr,
|
|
334
|
-
OutDone2,
|
|
335
|
-
InDone,
|
|
336
|
-
Env
|
|
337
|
-
>,
|
|
338
|
-
f: (o: OutDone, o1: OutDone) => OutDone,
|
|
339
|
-
g: (o: OutDone, o2: OutDone2) => OutDone3
|
|
340
|
-
): Channel.Channel<
|
|
341
|
-
OutElem,
|
|
342
|
-
InElem & InElem2,
|
|
343
|
-
OutErr | OutErr2,
|
|
344
|
-
InErr & InErr2,
|
|
345
|
-
OutDone3,
|
|
346
|
-
InDone & InDone2,
|
|
347
|
-
Env | Env2
|
|
348
|
-
> => {
|
|
349
|
-
const op = Object.create(proto)
|
|
350
|
-
op._tag = OpCodes.OP_CONCAT_ALL
|
|
351
|
-
op.combineInners = f
|
|
352
|
-
op.combineAll = g
|
|
353
|
-
op.onPull = () => upstreamPullStrategy.PullAfterNext(Option.none())
|
|
354
|
-
op.onEmit = () => childExecutorDecision.Continue
|
|
355
|
-
op.value = () => channels
|
|
356
|
-
op.k = identity
|
|
357
|
-
return op
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/** @internal */
|
|
361
|
-
export const concatMapWith = dual<
|
|
362
|
-
<OutElem, OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2, OutDone2, OutDone3>(
|
|
363
|
-
f: (o: OutElem) => Channel.Channel<OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2>,
|
|
364
|
-
g: (o: OutDone, o1: OutDone) => OutDone,
|
|
365
|
-
h: (o: OutDone, o2: OutDone2) => OutDone3
|
|
366
|
-
) => <Env, InErr, InElem, InDone, OutErr>(
|
|
367
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone2, InDone, Env>
|
|
368
|
-
) => Channel.Channel<
|
|
369
|
-
OutElem2,
|
|
370
|
-
InElem & InElem2,
|
|
371
|
-
OutErr2 | OutErr,
|
|
372
|
-
InErr & InErr2,
|
|
373
|
-
OutDone3,
|
|
374
|
-
InDone & InDone2,
|
|
375
|
-
Env2 | Env
|
|
376
|
-
>,
|
|
377
|
-
<
|
|
378
|
-
OutElem,
|
|
379
|
-
InElem,
|
|
380
|
-
OutErr,
|
|
381
|
-
InErr,
|
|
382
|
-
OutDone2,
|
|
383
|
-
InDone,
|
|
384
|
-
Env,
|
|
385
|
-
OutElem2,
|
|
386
|
-
InElem2,
|
|
387
|
-
OutErr2,
|
|
388
|
-
InErr2,
|
|
389
|
-
OutDone,
|
|
390
|
-
InDone2,
|
|
391
|
-
Env2,
|
|
392
|
-
OutDone3
|
|
393
|
-
>(
|
|
394
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone2, InDone, Env>,
|
|
395
|
-
f: (o: OutElem) => Channel.Channel<OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2>,
|
|
396
|
-
g: (o: OutDone, o1: OutDone) => OutDone,
|
|
397
|
-
h: (o: OutDone, o2: OutDone2) => OutDone3
|
|
398
|
-
) => Channel.Channel<
|
|
399
|
-
OutElem2,
|
|
400
|
-
InElem & InElem2,
|
|
401
|
-
OutErr2 | OutErr,
|
|
402
|
-
InErr & InErr2,
|
|
403
|
-
OutDone3,
|
|
404
|
-
InDone & InDone2,
|
|
405
|
-
Env2 | Env
|
|
406
|
-
>
|
|
407
|
-
>(4, <
|
|
408
|
-
Env,
|
|
409
|
-
InErr,
|
|
410
|
-
InElem,
|
|
411
|
-
InDone,
|
|
412
|
-
OutErr,
|
|
413
|
-
OutElem,
|
|
414
|
-
OutElem2,
|
|
415
|
-
OutDone,
|
|
416
|
-
OutDone2,
|
|
417
|
-
OutDone3,
|
|
418
|
-
Env2,
|
|
419
|
-
InErr2,
|
|
420
|
-
InElem2,
|
|
421
|
-
InDone2,
|
|
422
|
-
OutErr2
|
|
423
|
-
>(
|
|
424
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone2, InDone, Env>,
|
|
425
|
-
f: (
|
|
426
|
-
o: OutElem
|
|
427
|
-
) => Channel.Channel<OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2>,
|
|
428
|
-
g: (o: OutDone, o1: OutDone) => OutDone,
|
|
429
|
-
h: (o: OutDone, o2: OutDone2) => OutDone3
|
|
430
|
-
): Channel.Channel<
|
|
431
|
-
OutElem2,
|
|
432
|
-
InElem & InElem2,
|
|
433
|
-
OutErr | OutErr2,
|
|
434
|
-
InErr & InErr2,
|
|
435
|
-
OutDone3,
|
|
436
|
-
InDone & InDone2,
|
|
437
|
-
Env | Env2
|
|
438
|
-
> => {
|
|
439
|
-
const op = Object.create(proto)
|
|
440
|
-
op._tag = OpCodes.OP_CONCAT_ALL
|
|
441
|
-
op.combineInners = g
|
|
442
|
-
op.combineAll = h
|
|
443
|
-
op.onPull = () => upstreamPullStrategy.PullAfterNext(Option.none())
|
|
444
|
-
op.onEmit = () => childExecutorDecision.Continue
|
|
445
|
-
op.value = () => self
|
|
446
|
-
op.k = f
|
|
447
|
-
return op
|
|
448
|
-
})
|
|
449
|
-
|
|
450
|
-
/** @internal */
|
|
451
|
-
export const concatMapWithCustom = dual<
|
|
452
|
-
<OutElem, OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2, OutDone2, OutDone3>(
|
|
453
|
-
f: (o: OutElem) => Channel.Channel<OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2>,
|
|
454
|
-
g: (o: OutDone, o1: OutDone) => OutDone,
|
|
455
|
-
h: (o: OutDone, o2: OutDone2) => OutDone3,
|
|
456
|
-
onPull: (
|
|
457
|
-
upstreamPullRequest: UpstreamPullRequest.UpstreamPullRequest<OutElem>
|
|
458
|
-
) => UpstreamPullStrategy.UpstreamPullStrategy<OutElem2>,
|
|
459
|
-
onEmit: (elem: OutElem2) => ChildExecutorDecision.ChildExecutorDecision
|
|
460
|
-
) => <Env, InErr, InElem, InDone, OutErr>(
|
|
461
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone2, InDone, Env>
|
|
462
|
-
) => Channel.Channel<
|
|
463
|
-
OutElem2,
|
|
464
|
-
InElem & InElem2,
|
|
465
|
-
OutErr2 | OutErr,
|
|
466
|
-
InErr & InErr2,
|
|
467
|
-
OutDone3,
|
|
468
|
-
InDone & InDone2,
|
|
469
|
-
Env2 | Env
|
|
470
|
-
>,
|
|
471
|
-
<
|
|
472
|
-
OutElem,
|
|
473
|
-
InElem,
|
|
474
|
-
OutErr,
|
|
475
|
-
InErr,
|
|
476
|
-
OutDone2,
|
|
477
|
-
InDone,
|
|
478
|
-
Env,
|
|
479
|
-
OutElem2,
|
|
480
|
-
InElem2,
|
|
481
|
-
OutErr2,
|
|
482
|
-
InErr2,
|
|
483
|
-
OutDone,
|
|
484
|
-
InDone2,
|
|
485
|
-
Env2,
|
|
486
|
-
OutDone3
|
|
487
|
-
>(
|
|
488
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone2, InDone, Env>,
|
|
489
|
-
f: (o: OutElem) => Channel.Channel<OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2>,
|
|
490
|
-
g: (o: OutDone, o1: OutDone) => OutDone,
|
|
491
|
-
h: (o: OutDone, o2: OutDone2) => OutDone3,
|
|
492
|
-
onPull: (
|
|
493
|
-
upstreamPullRequest: UpstreamPullRequest.UpstreamPullRequest<OutElem>
|
|
494
|
-
) => UpstreamPullStrategy.UpstreamPullStrategy<OutElem2>,
|
|
495
|
-
onEmit: (elem: OutElem2) => ChildExecutorDecision.ChildExecutorDecision
|
|
496
|
-
) => Channel.Channel<
|
|
497
|
-
OutElem2,
|
|
498
|
-
InElem & InElem2,
|
|
499
|
-
OutErr2 | OutErr,
|
|
500
|
-
InErr & InErr2,
|
|
501
|
-
OutDone3,
|
|
502
|
-
InDone & InDone2,
|
|
503
|
-
Env2 | Env
|
|
504
|
-
>
|
|
505
|
-
>(6, <
|
|
506
|
-
Env,
|
|
507
|
-
InErr,
|
|
508
|
-
InElem,
|
|
509
|
-
InDone,
|
|
510
|
-
OutErr,
|
|
511
|
-
OutElem,
|
|
512
|
-
OutElem2,
|
|
513
|
-
OutDone,
|
|
514
|
-
OutDone2,
|
|
515
|
-
OutDone3,
|
|
516
|
-
Env2,
|
|
517
|
-
InErr2,
|
|
518
|
-
InElem2,
|
|
519
|
-
InDone2,
|
|
520
|
-
OutErr2
|
|
521
|
-
>(
|
|
522
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone2, InDone, Env>,
|
|
523
|
-
f: (
|
|
524
|
-
o: OutElem
|
|
525
|
-
) => Channel.Channel<OutElem2, InElem2, OutErr2, InErr2, OutDone, InDone2, Env2>,
|
|
526
|
-
g: (o: OutDone, o1: OutDone) => OutDone,
|
|
527
|
-
h: (o: OutDone, o2: OutDone2) => OutDone3,
|
|
528
|
-
onPull: (
|
|
529
|
-
upstreamPullRequest: UpstreamPullRequest.UpstreamPullRequest<OutElem>
|
|
530
|
-
) => UpstreamPullStrategy.UpstreamPullStrategy<OutElem2>,
|
|
531
|
-
onEmit: (elem: OutElem2) => ChildExecutorDecision.ChildExecutorDecision
|
|
532
|
-
): Channel.Channel<
|
|
533
|
-
OutElem2,
|
|
534
|
-
InElem & InElem2,
|
|
535
|
-
OutErr | OutErr2,
|
|
536
|
-
InErr & InErr2,
|
|
537
|
-
OutDone3,
|
|
538
|
-
InDone & InDone2,
|
|
539
|
-
Env | Env2
|
|
540
|
-
> => {
|
|
541
|
-
const op = Object.create(proto)
|
|
542
|
-
op._tag = OpCodes.OP_CONCAT_ALL
|
|
543
|
-
op.combineInners = g
|
|
544
|
-
op.combineAll = h
|
|
545
|
-
op.onPull = onPull
|
|
546
|
-
op.onEmit = onEmit
|
|
547
|
-
op.value = () => self
|
|
548
|
-
op.k = f
|
|
549
|
-
return op
|
|
550
|
-
})
|
|
551
|
-
|
|
552
|
-
/** @internal */
|
|
553
|
-
export const embedInput = dual<
|
|
554
|
-
<InErr, InElem, InDone>(
|
|
555
|
-
input: SingleProducerAsyncInput.AsyncInputProducer<InErr, InElem, InDone>
|
|
556
|
-
) => <OutElem, OutErr, OutDone, Env>(
|
|
557
|
-
self: Channel.Channel<OutElem, unknown, OutErr, unknown, OutDone, unknown, Env>
|
|
558
|
-
) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
559
|
-
<OutElem, OutErr, OutDone, Env, InErr, InElem, InDone>(
|
|
560
|
-
self: Channel.Channel<OutElem, unknown, OutErr, unknown, OutDone, unknown, Env>,
|
|
561
|
-
input: SingleProducerAsyncInput.AsyncInputProducer<InErr, InElem, InDone>
|
|
562
|
-
) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
563
|
-
>(
|
|
564
|
-
2,
|
|
565
|
-
<OutElem, OutErr, OutDone, Env, InErr, InElem, InDone>(
|
|
566
|
-
self: Channel.Channel<OutElem, unknown, OutErr, unknown, OutDone, unknown, Env>,
|
|
567
|
-
input: SingleProducerAsyncInput.AsyncInputProducer<InErr, InElem, InDone>
|
|
568
|
-
): Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env> => {
|
|
569
|
-
const op = Object.create(proto)
|
|
570
|
-
op._tag = OpCodes.OP_BRIDGE
|
|
571
|
-
op.input = input
|
|
572
|
-
op.channel = self
|
|
573
|
-
return op
|
|
574
|
-
}
|
|
575
|
-
)
|
|
576
|
-
|
|
577
|
-
/** @internal */
|
|
578
|
-
export const ensuringWith = dual<
|
|
579
|
-
<OutDone, OutErr, Env2>(
|
|
580
|
-
finalizer: (e: Exit.Exit<OutDone, OutErr>) => Effect.Effect<unknown, never, Env2>
|
|
581
|
-
) => <OutElem, InElem, InErr, InDone, Env>(
|
|
582
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
583
|
-
) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env2 | Env>,
|
|
584
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, Env2>(
|
|
585
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
586
|
-
finalizer: (e: Exit.Exit<OutDone, OutErr>) => Effect.Effect<unknown, never, Env2>
|
|
587
|
-
) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env2 | Env>
|
|
588
|
-
>(
|
|
589
|
-
2,
|
|
590
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, Env2>(
|
|
591
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
592
|
-
finalizer: (e: Exit.Exit<OutDone, OutErr>) => Effect.Effect<unknown, never, Env2>
|
|
593
|
-
): Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env | Env2> => {
|
|
594
|
-
const op = Object.create(proto)
|
|
595
|
-
op._tag = OpCodes.OP_ENSURING
|
|
596
|
-
op.channel = self
|
|
597
|
-
op.finalizer = finalizer
|
|
598
|
-
return op
|
|
599
|
-
}
|
|
600
|
-
)
|
|
601
|
-
|
|
602
|
-
/** @internal */
|
|
603
|
-
export const fail = <E>(error: E): Channel.Channel<never, unknown, E, unknown, never, unknown> =>
|
|
604
|
-
failCause(Cause.fail(error))
|
|
605
|
-
|
|
606
|
-
/** @internal */
|
|
607
|
-
export const failSync = <E>(
|
|
608
|
-
evaluate: LazyArg<E>
|
|
609
|
-
): Channel.Channel<never, unknown, E, unknown, never, unknown> => failCauseSync(() => Cause.fail(evaluate()))
|
|
610
|
-
|
|
611
|
-
/** @internal */
|
|
612
|
-
export const failCause = <E>(
|
|
613
|
-
cause: Cause.Cause<E>
|
|
614
|
-
): Channel.Channel<never, unknown, E, unknown, never, unknown> => failCauseSync(() => cause)
|
|
615
|
-
|
|
616
|
-
/** @internal */
|
|
617
|
-
export const failCauseSync = <E>(
|
|
618
|
-
evaluate: LazyArg<Cause.Cause<E>>
|
|
619
|
-
): Channel.Channel<never, unknown, E, unknown, never, unknown> => {
|
|
620
|
-
const op = Object.create(proto)
|
|
621
|
-
op._tag = OpCodes.OP_FAIL
|
|
622
|
-
op.error = evaluate
|
|
623
|
-
return op
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
/** @internal */
|
|
627
|
-
export const flatMap = dual<
|
|
628
|
-
<OutDone, OutElem1, InElem1, OutErr1, InErr1, OutDone2, InDone1, Env1>(
|
|
629
|
-
f: (d: OutDone) => Channel.Channel<OutElem1, InElem1, OutErr1, InErr1, OutDone2, InDone1, Env1>
|
|
630
|
-
) => <OutElem, InElem, OutErr, InErr, InDone, Env>(
|
|
631
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
632
|
-
) => Channel.Channel<
|
|
633
|
-
OutElem1 | OutElem,
|
|
634
|
-
InElem & InElem1,
|
|
635
|
-
OutErr1 | OutErr,
|
|
636
|
-
InErr & InErr1,
|
|
637
|
-
OutDone2,
|
|
638
|
-
InDone & InDone1,
|
|
639
|
-
Env1 | Env
|
|
640
|
-
>,
|
|
641
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, OutElem1, InElem1, OutErr1, InErr1, OutDone2, InDone1, Env1>(
|
|
642
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
643
|
-
f: (d: OutDone) => Channel.Channel<OutElem1, InElem1, OutErr1, InErr1, OutDone2, InDone1, Env1>
|
|
644
|
-
) => Channel.Channel<
|
|
645
|
-
OutElem1 | OutElem,
|
|
646
|
-
InElem & InElem1,
|
|
647
|
-
OutErr1 | OutErr,
|
|
648
|
-
InErr & InErr1,
|
|
649
|
-
OutDone2,
|
|
650
|
-
InDone & InDone1,
|
|
651
|
-
Env1 | Env
|
|
652
|
-
>
|
|
653
|
-
>(
|
|
654
|
-
2,
|
|
655
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, OutElem1, InElem1, OutErr1, InErr1, OutDone2, InDone1, Env1>(
|
|
656
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
657
|
-
f: (d: OutDone) => Channel.Channel<OutElem1, InElem1, OutErr1, InErr1, OutDone2, InDone1, Env1>
|
|
658
|
-
): Channel.Channel<
|
|
659
|
-
OutElem | OutElem1,
|
|
660
|
-
InElem & InElem1,
|
|
661
|
-
OutErr | OutErr1,
|
|
662
|
-
InErr & InErr1,
|
|
663
|
-
OutDone2,
|
|
664
|
-
InDone & InDone1,
|
|
665
|
-
Env | Env1
|
|
666
|
-
> => {
|
|
667
|
-
const op = Object.create(proto)
|
|
668
|
-
op._tag = OpCodes.OP_FOLD
|
|
669
|
-
op.channel = self
|
|
670
|
-
op.k = new ContinuationKImpl(f, failCause)
|
|
671
|
-
return op
|
|
672
|
-
}
|
|
673
|
-
)
|
|
674
|
-
|
|
675
|
-
/** @internal */
|
|
676
|
-
export const foldCauseChannel = dual<
|
|
677
|
-
<
|
|
678
|
-
OutErr,
|
|
679
|
-
OutElem1,
|
|
680
|
-
InElem1,
|
|
681
|
-
OutErr2,
|
|
682
|
-
InErr1,
|
|
683
|
-
OutDone2,
|
|
684
|
-
InDone1,
|
|
685
|
-
Env1,
|
|
686
|
-
OutDone,
|
|
687
|
-
OutElem2,
|
|
688
|
-
InElem2,
|
|
689
|
-
OutErr3,
|
|
690
|
-
InErr2,
|
|
691
|
-
OutDone3,
|
|
692
|
-
InDone2,
|
|
693
|
-
Env2
|
|
694
|
-
>(
|
|
695
|
-
options: {
|
|
696
|
-
readonly onFailure: (
|
|
697
|
-
c: Cause.Cause<OutErr>
|
|
698
|
-
) => Channel.Channel<OutElem1, InElem1, OutErr2, InErr1, OutDone2, InDone1, Env1>
|
|
699
|
-
readonly onSuccess: (o: OutDone) => Channel.Channel<OutElem2, InElem2, OutErr3, InErr2, OutDone3, InDone2, Env2>
|
|
700
|
-
}
|
|
701
|
-
) => <Env, InErr, InElem, InDone, OutElem>(
|
|
702
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
703
|
-
) => Channel.Channel<
|
|
704
|
-
OutElem1 | OutElem2 | OutElem,
|
|
705
|
-
InElem & InElem1 & InElem2,
|
|
706
|
-
OutErr2 | OutErr3,
|
|
707
|
-
InErr & InErr1 & InErr2,
|
|
708
|
-
OutDone2 | OutDone3,
|
|
709
|
-
InDone & InDone1 & InDone2,
|
|
710
|
-
Env1 | Env2 | Env
|
|
711
|
-
>,
|
|
712
|
-
<
|
|
713
|
-
OutElem,
|
|
714
|
-
InElem,
|
|
715
|
-
OutErr,
|
|
716
|
-
InErr,
|
|
717
|
-
OutDone,
|
|
718
|
-
InDone,
|
|
719
|
-
Env,
|
|
720
|
-
OutElem1,
|
|
721
|
-
InElem1,
|
|
722
|
-
OutErr2,
|
|
723
|
-
InErr1,
|
|
724
|
-
OutDone2,
|
|
725
|
-
InDone1,
|
|
726
|
-
Env1,
|
|
727
|
-
OutElem2,
|
|
728
|
-
InElem2,
|
|
729
|
-
OutErr3,
|
|
730
|
-
InErr2,
|
|
731
|
-
OutDone3,
|
|
732
|
-
InDone2,
|
|
733
|
-
Env2
|
|
734
|
-
>(
|
|
735
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
736
|
-
options: {
|
|
737
|
-
readonly onFailure: (
|
|
738
|
-
c: Cause.Cause<OutErr>
|
|
739
|
-
) => Channel.Channel<OutElem1, InElem1, OutErr2, InErr1, OutDone2, InDone1, Env1>
|
|
740
|
-
readonly onSuccess: (o: OutDone) => Channel.Channel<OutElem2, InElem2, OutErr3, InErr2, OutDone3, InDone2, Env2>
|
|
741
|
-
}
|
|
742
|
-
) => Channel.Channel<
|
|
743
|
-
OutElem1 | OutElem2 | OutElem,
|
|
744
|
-
InElem & InElem1 & InElem2,
|
|
745
|
-
OutErr2 | OutErr3,
|
|
746
|
-
InErr & InErr1 & InErr2,
|
|
747
|
-
OutDone2 | OutDone3,
|
|
748
|
-
InDone & InDone1 & InDone2,
|
|
749
|
-
Env1 | Env2 | Env
|
|
750
|
-
>
|
|
751
|
-
>(
|
|
752
|
-
2,
|
|
753
|
-
<
|
|
754
|
-
OutElem,
|
|
755
|
-
InElem,
|
|
756
|
-
OutErr,
|
|
757
|
-
InErr,
|
|
758
|
-
OutDone,
|
|
759
|
-
InDone,
|
|
760
|
-
Env,
|
|
761
|
-
OutElem1,
|
|
762
|
-
InElem1,
|
|
763
|
-
OutErr2,
|
|
764
|
-
InErr1,
|
|
765
|
-
OutDone2,
|
|
766
|
-
InDone1,
|
|
767
|
-
Env1,
|
|
768
|
-
OutElem2,
|
|
769
|
-
InElem2,
|
|
770
|
-
OutErr3,
|
|
771
|
-
InErr2,
|
|
772
|
-
OutDone3,
|
|
773
|
-
InDone2,
|
|
774
|
-
Env2
|
|
775
|
-
>(
|
|
776
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
777
|
-
options: {
|
|
778
|
-
readonly onFailure: (
|
|
779
|
-
c: Cause.Cause<OutErr>
|
|
780
|
-
) => Channel.Channel<OutElem1, InElem1, OutErr2, InErr1, OutDone2, InDone1, Env1>
|
|
781
|
-
readonly onSuccess: (o: OutDone) => Channel.Channel<OutElem2, InElem2, OutErr3, InErr2, OutDone3, InDone2, Env2>
|
|
782
|
-
}
|
|
783
|
-
): Channel.Channel<
|
|
784
|
-
OutElem | OutElem1 | OutElem2,
|
|
785
|
-
InElem & InElem1 & InElem2,
|
|
786
|
-
OutErr2 | OutErr3,
|
|
787
|
-
InErr & InErr1 & InErr2,
|
|
788
|
-
OutDone2 | OutDone3,
|
|
789
|
-
InDone & InDone1 & InDone2,
|
|
790
|
-
Env | Env1 | Env2
|
|
791
|
-
> => {
|
|
792
|
-
const op = Object.create(proto)
|
|
793
|
-
op._tag = OpCodes.OP_FOLD
|
|
794
|
-
op.channel = self
|
|
795
|
-
op.k = new ContinuationKImpl(options.onSuccess, options.onFailure as any)
|
|
796
|
-
return op
|
|
797
|
-
}
|
|
798
|
-
)
|
|
799
|
-
|
|
800
|
-
/** @internal */
|
|
801
|
-
export const fromEffect = <A, E, R>(
|
|
802
|
-
effect: Effect.Effect<A, E, R>
|
|
803
|
-
): Channel.Channel<never, unknown, E, unknown, A, unknown, R> => {
|
|
804
|
-
const op = Object.create(proto)
|
|
805
|
-
op._tag = OpCodes.OP_FROM_EFFECT
|
|
806
|
-
op.effect = () => effect
|
|
807
|
-
return op
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
/** @internal */
|
|
811
|
-
export const pipeTo = dual<
|
|
812
|
-
<OutElem2, OutElem, OutErr2, OutErr, OutDone2, OutDone, Env2>(
|
|
813
|
-
that: Channel.Channel<OutElem2, OutElem, OutErr2, OutErr, OutDone2, OutDone, Env2>
|
|
814
|
-
) => <InElem, InErr, InDone, Env>(
|
|
815
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
816
|
-
) => Channel.Channel<OutElem2, InElem, OutErr2, InErr, OutDone2, InDone, Env2 | Env>,
|
|
817
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, OutElem2, OutErr2, OutDone2, Env2>(
|
|
818
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
819
|
-
that: Channel.Channel<OutElem2, OutElem, OutErr2, OutErr, OutDone2, OutDone, Env2>
|
|
820
|
-
) => Channel.Channel<OutElem2, InElem, OutErr2, InErr, OutDone2, InDone, Env2 | Env>
|
|
821
|
-
>(
|
|
822
|
-
2,
|
|
823
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env, OutElem2, OutErr2, OutDone2, Env2>(
|
|
824
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
825
|
-
that: Channel.Channel<OutElem2, OutElem, OutErr2, OutErr, OutDone2, OutDone, Env2>
|
|
826
|
-
): Channel.Channel<OutElem2, InElem, OutErr2, InErr, OutDone2, InDone, Env | Env2> => {
|
|
827
|
-
const op = Object.create(proto)
|
|
828
|
-
op._tag = OpCodes.OP_PIPE_TO
|
|
829
|
-
op.left = () => self
|
|
830
|
-
op.right = () => that
|
|
831
|
-
return op
|
|
832
|
-
}
|
|
833
|
-
)
|
|
834
|
-
|
|
835
|
-
/** @internal */
|
|
836
|
-
export const provideContext = dual<
|
|
837
|
-
<Env>(
|
|
838
|
-
env: Context.Context<Env>
|
|
839
|
-
) => <OutElem, InElem, OutErr, InErr, OutDone, InDone>(
|
|
840
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
841
|
-
) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone>,
|
|
842
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>(
|
|
843
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
844
|
-
env: Context.Context<Env>
|
|
845
|
-
) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone>
|
|
846
|
-
>(
|
|
847
|
-
2,
|
|
848
|
-
<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>(
|
|
849
|
-
self: Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>,
|
|
850
|
-
env: Context.Context<Env>
|
|
851
|
-
): Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone> => {
|
|
852
|
-
const op = Object.create(proto)
|
|
853
|
-
op._tag = OpCodes.OP_PROVIDE
|
|
854
|
-
op.context = () => env
|
|
855
|
-
op.inner = self
|
|
856
|
-
return op
|
|
857
|
-
}
|
|
858
|
-
)
|
|
859
|
-
|
|
860
|
-
/** @internal */
|
|
861
|
-
export const readOrFail = <E, In = unknown>(
|
|
862
|
-
error: E
|
|
863
|
-
): Channel.Channel<never, In, E, unknown, In, unknown> => {
|
|
864
|
-
const op = Object.create(proto)
|
|
865
|
-
op._tag = OpCodes.OP_READ
|
|
866
|
-
op.more = succeed
|
|
867
|
-
op.done = new ContinuationKImpl(() => fail(error), () => fail(error))
|
|
868
|
-
return op
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
/** @internal */
|
|
872
|
-
export const readWith = <
|
|
873
|
-
InElem,
|
|
874
|
-
OutElem,
|
|
875
|
-
OutErr,
|
|
876
|
-
InErr,
|
|
877
|
-
OutDone,
|
|
878
|
-
InDone,
|
|
879
|
-
Env,
|
|
880
|
-
OutElem2,
|
|
881
|
-
OutErr2,
|
|
882
|
-
OutDone2,
|
|
883
|
-
Env2,
|
|
884
|
-
OutElem3,
|
|
885
|
-
OutErr3,
|
|
886
|
-
OutDone3,
|
|
887
|
-
Env3
|
|
888
|
-
>(
|
|
889
|
-
options: {
|
|
890
|
-
readonly onInput: (input: InElem) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
891
|
-
readonly onFailure: (error: InErr) => Channel.Channel<OutElem2, InElem, OutErr2, InErr, OutDone2, InDone, Env2>
|
|
892
|
-
readonly onDone: (done: InDone) => Channel.Channel<OutElem3, InElem, OutErr3, InErr, OutDone3, InDone, Env3>
|
|
893
|
-
}
|
|
894
|
-
): Channel.Channel<
|
|
895
|
-
OutElem | OutElem2 | OutElem3,
|
|
896
|
-
InElem,
|
|
897
|
-
OutErr | OutErr2 | OutErr3,
|
|
898
|
-
InErr,
|
|
899
|
-
OutDone | OutDone2 | OutDone3,
|
|
900
|
-
InDone,
|
|
901
|
-
Env | Env2 | Env3
|
|
902
|
-
> =>
|
|
903
|
-
readWithCause({
|
|
904
|
-
onInput: options.onInput,
|
|
905
|
-
onFailure: (cause) => Either.match(Cause.failureOrCause(cause), { onLeft: options.onFailure, onRight: failCause }),
|
|
906
|
-
onDone: options.onDone
|
|
907
|
-
})
|
|
908
|
-
|
|
909
|
-
/** @internal */
|
|
910
|
-
export const readWithCause = <
|
|
911
|
-
InElem,
|
|
912
|
-
OutElem,
|
|
913
|
-
OutErr,
|
|
914
|
-
InErr,
|
|
915
|
-
OutDone,
|
|
916
|
-
InDone,
|
|
917
|
-
Env,
|
|
918
|
-
OutElem2,
|
|
919
|
-
OutErr2,
|
|
920
|
-
OutDone2,
|
|
921
|
-
Env2,
|
|
922
|
-
OutElem3,
|
|
923
|
-
OutErr3,
|
|
924
|
-
OutDone3,
|
|
925
|
-
Env3
|
|
926
|
-
>(
|
|
927
|
-
options: {
|
|
928
|
-
readonly onInput: (input: InElem) => Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>
|
|
929
|
-
readonly onFailure: (
|
|
930
|
-
cause: Cause.Cause<InErr>
|
|
931
|
-
) => Channel.Channel<OutElem2, InElem, OutErr2, InErr, OutDone2, InDone, Env2>
|
|
932
|
-
readonly onDone: (done: InDone) => Channel.Channel<OutElem3, InElem, OutErr3, InErr, OutDone3, InDone, Env3>
|
|
933
|
-
}
|
|
934
|
-
): Channel.Channel<
|
|
935
|
-
OutElem | OutElem2 | OutElem3,
|
|
936
|
-
InElem,
|
|
937
|
-
OutErr | OutErr2 | OutErr3,
|
|
938
|
-
InErr,
|
|
939
|
-
OutDone | OutDone2 | OutDone3,
|
|
940
|
-
InDone,
|
|
941
|
-
Env | Env2 | Env3
|
|
942
|
-
> => {
|
|
943
|
-
const op = Object.create(proto)
|
|
944
|
-
op._tag = OpCodes.OP_READ
|
|
945
|
-
op.more = options.onInput
|
|
946
|
-
op.done = new ContinuationKImpl(options.onDone, options.onFailure as any)
|
|
947
|
-
return op
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
/** @internal */
|
|
951
|
-
export const succeed = <A>(
|
|
952
|
-
value: A
|
|
953
|
-
): Channel.Channel<never, unknown, never, unknown, A, unknown> => sync(() => value)
|
|
954
|
-
|
|
955
|
-
/** @internal */
|
|
956
|
-
export const succeedNow = <OutDone>(
|
|
957
|
-
result: OutDone
|
|
958
|
-
): Channel.Channel<never, unknown, never, unknown, OutDone, unknown> => {
|
|
959
|
-
const op = Object.create(proto)
|
|
960
|
-
op._tag = OpCodes.OP_SUCCEED_NOW
|
|
961
|
-
op.terminal = result
|
|
962
|
-
return op
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
/** @internal */
|
|
966
|
-
export const suspend = <OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>(
|
|
967
|
-
evaluate: LazyArg<Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env>>
|
|
968
|
-
): Channel.Channel<OutElem, InElem, OutErr, InErr, OutDone, InDone, Env> => {
|
|
969
|
-
const op = Object.create(proto)
|
|
970
|
-
op._tag = OpCodes.OP_SUSPEND
|
|
971
|
-
op.channel = evaluate
|
|
972
|
-
return op
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
export const sync = <OutDone>(
|
|
976
|
-
evaluate: LazyArg<OutDone>
|
|
977
|
-
): Channel.Channel<never, unknown, never, unknown, OutDone, unknown> => {
|
|
978
|
-
const op = Object.create(proto)
|
|
979
|
-
op._tag = OpCodes.OP_SUCCEED
|
|
980
|
-
op.evaluate = evaluate
|
|
981
|
-
return op
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
const void_: Channel.Channel<never> = succeedNow(void 0)
|
|
985
|
-
export {
|
|
986
|
-
/** @internal */
|
|
987
|
-
void_ as void
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
/** @internal */
|
|
991
|
-
export const write = <OutElem>(
|
|
992
|
-
out: OutElem
|
|
993
|
-
): Channel.Channel<OutElem, unknown, never, unknown, void, unknown> => {
|
|
994
|
-
const op = Object.create(proto)
|
|
995
|
-
op._tag = OpCodes.OP_EMIT
|
|
996
|
-
op.out = out
|
|
997
|
-
return op
|
|
998
|
-
}
|