@fncts/io 0.0.15 → 0.0.18

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 (131) hide show
  1. package/Cached/internal.d.ts +1 -1
  2. package/CancellerState.d.ts +1 -1
  3. package/Channel/ChildExecutorDecision/definition.d.ts +1 -1
  4. package/Channel/UpstreamPullRequest/definition.d.ts +1 -1
  5. package/Channel/UpstreamPullStrategy/definition.d.ts +1 -1
  6. package/Channel/api/mergeAllWith.d.ts +1 -1
  7. package/Channel/internal/ChannelExecutor.d.ts +1 -1
  8. package/Channel/internal/ChannelState.d.ts +2 -2
  9. package/Channel/internal/MergeDecision.d.ts +1 -1
  10. package/Channel/internal/MergeState.d.ts +1 -1
  11. package/Channel/internal/SingleProducerAsyncInput.d.ts +1 -1
  12. package/Fiber/FiberContext.d.ts +18 -18
  13. package/Fiber/definition.d.ts +2 -2
  14. package/FiberRef/api.d.ts +2 -2
  15. package/FiberRef/definition.d.ts +2 -2
  16. package/FiberRef/unsafe.d.ts +6 -0
  17. package/FiberRefs/definition.d.ts +1 -1
  18. package/FiberState/definition.d.ts +2 -2
  19. package/FiberStatus/definition.d.ts +1 -1
  20. package/Future/definition.d.ts +1 -1
  21. package/Hub/definition.d.ts +1 -1
  22. package/IO/api/core-scope.d.ts +4 -3
  23. package/IO/api/interrupt.d.ts +2 -2
  24. package/IO/api/supervised.d.ts +10 -0
  25. package/IO/api.d.ts +7 -10
  26. package/IO/definition.d.ts +16 -139
  27. package/IO.d.ts +1 -0
  28. package/IOEnv/definition.d.ts +1 -1
  29. package/Layer/definition.d.ts +2 -2
  30. package/Ref/definition.d.ts +3 -3
  31. package/RuntimeConfig.d.ts +1 -1
  32. package/STM/definition.d.ts +5 -5
  33. package/STM/internal/CommitState.d.ts +1 -1
  34. package/STM/internal/Entry.d.ts +2 -2
  35. package/STM/internal/Journal.d.ts +6 -6
  36. package/STM/internal/TryCommit.d.ts +2 -2
  37. package/STM/internal/Versioned.d.ts +1 -1
  38. package/Schedule/Decision.d.ts +1 -1
  39. package/Scope/ReleaseMap/definition.d.ts +1 -1
  40. package/Scope/definition.d.ts +2 -2
  41. package/ScopedRef/definition.d.ts +1 -1
  42. package/State/internal.d.ts +1 -1
  43. package/Stream/api.d.ts +1 -1
  44. package/Stream/definition.d.ts +1 -1
  45. package/Stream/internal/DebounceState.d.ts +4 -4
  46. package/Stream/internal/Handoff.d.ts +5 -5
  47. package/Stream/internal/Pull.d.ts +1 -1
  48. package/Stream/internal/SinkEndReason.d.ts +1 -1
  49. package/TExit/definition.d.ts +3 -3
  50. package/TReentrantLock/definition.d.ts +1 -1
  51. package/TRef/definition.d.ts +1 -1
  52. package/TxnId.d.ts +1 -1
  53. package/_cjs/Clock/definition.cjs +1 -1
  54. package/_cjs/Clock/definition.cjs.map +1 -1
  55. package/_cjs/Console/definition.cjs +1 -1
  56. package/_cjs/Console/definition.cjs.map +1 -1
  57. package/_cjs/Fiber/FiberContext.cjs +161 -294
  58. package/_cjs/Fiber/FiberContext.cjs.map +1 -1
  59. package/_cjs/FiberRef/api.cjs +19 -10
  60. package/_cjs/FiberRef/api.cjs.map +1 -1
  61. package/_cjs/FiberRef/unsafe.cjs +9 -1
  62. package/_cjs/FiberRef/unsafe.cjs.map +1 -1
  63. package/_cjs/IO/api/core-scope.cjs +23 -15
  64. package/_cjs/IO/api/core-scope.cjs.map +1 -1
  65. package/_cjs/IO/api/ensuringChildren.cjs +4 -2
  66. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -1
  67. package/_cjs/IO/api/interrupt.cjs +17 -9
  68. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  69. package/_cjs/IO/api/supervised.cjs +26 -0
  70. package/_cjs/IO/api/supervised.cjs.map +1 -0
  71. package/_cjs/IO/api/withChildren.cjs +4 -2
  72. package/_cjs/IO/api/withChildren.cjs.map +1 -1
  73. package/_cjs/IO/api.cjs +69 -63
  74. package/_cjs/IO/api.cjs.map +1 -1
  75. package/_cjs/IO/definition.cjs +8 -226
  76. package/_cjs/IO/definition.cjs.map +1 -1
  77. package/_cjs/IO.cjs +13 -0
  78. package/_cjs/IO.cjs.map +1 -1
  79. package/_cjs/Layer/api.cjs +1 -1
  80. package/_cjs/Layer/api.cjs.map +1 -1
  81. package/_cjs/Random/definition.cjs +1 -1
  82. package/_cjs/Random/definition.cjs.map +1 -1
  83. package/_cjs/Scope/definition.cjs +1 -1
  84. package/_cjs/Scope/definition.cjs.map +1 -1
  85. package/_mjs/Clock/definition.mjs +1 -1
  86. package/_mjs/Clock/definition.mjs.map +1 -1
  87. package/_mjs/Console/definition.mjs +1 -1
  88. package/_mjs/Console/definition.mjs.map +1 -1
  89. package/_mjs/Fiber/FiberContext.mjs +161 -293
  90. package/_mjs/Fiber/FiberContext.mjs.map +1 -1
  91. package/_mjs/FiberRef/api.mjs +18 -9
  92. package/_mjs/FiberRef/api.mjs.map +1 -1
  93. package/_mjs/FiberRef/unsafe.mjs +6 -0
  94. package/_mjs/FiberRef/unsafe.mjs.map +1 -1
  95. package/_mjs/IO/api/core-scope.mjs +21 -16
  96. package/_mjs/IO/api/core-scope.mjs.map +1 -1
  97. package/_mjs/IO/api/ensuringChildren.mjs +3 -2
  98. package/_mjs/IO/api/ensuringChildren.mjs.map +1 -1
  99. package/_mjs/IO/api/interrupt.mjs +14 -6
  100. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  101. package/_mjs/IO/api/supervised.mjs +14 -0
  102. package/_mjs/IO/api/supervised.mjs.map +1 -0
  103. package/_mjs/IO/api/withChildren.mjs +3 -2
  104. package/_mjs/IO/api/withChildren.mjs.map +1 -1
  105. package/_mjs/IO/api.mjs +67 -60
  106. package/_mjs/IO/api.mjs.map +1 -1
  107. package/_mjs/IO/definition.mjs +5 -184
  108. package/_mjs/IO/definition.mjs.map +1 -1
  109. package/_mjs/IO.mjs +1 -0
  110. package/_mjs/IO.mjs.map +1 -1
  111. package/_mjs/Layer/api.mjs +1 -1
  112. package/_mjs/Layer/api.mjs.map +1 -1
  113. package/_mjs/Random/definition.mjs +1 -1
  114. package/_mjs/Random/definition.mjs.map +1 -1
  115. package/_mjs/Scope/definition.mjs +1 -1
  116. package/_mjs/Scope/definition.mjs.map +1 -1
  117. package/_src/Clock/definition.ts +1 -1
  118. package/_src/Console/definition.ts +1 -1
  119. package/_src/Fiber/FiberContext.ts +21 -111
  120. package/_src/FiberRef/api.ts +15 -7
  121. package/_src/FiberRef/unsafe.ts +5 -0
  122. package/_src/IO/api/core-scope.ts +12 -10
  123. package/_src/IO/api/interrupt.ts +8 -3
  124. package/_src/IO/api/supervised.ts +14 -0
  125. package/_src/IO/api.ts +25 -26
  126. package/_src/IO/definition.ts +8 -158
  127. package/_src/IO.ts +1 -0
  128. package/_src/Layer/api.ts +1 -1
  129. package/_src/Random/definition.ts +1 -1
  130. package/_src/Scope/definition.ts +1 -1
  131. package/package.json +4 -3
@@ -8,41 +8,40 @@ import * as tsplus_module_6 from "@fncts/io/Fiber/api/id";
8
8
  import * as tsplus_module_7 from "@fncts/base/typeclass/Equatable/api";
9
9
  import * as tsplus_module_8 from "@fncts/io/FiberState/constructors";
10
10
  import * as tsplus_module_9 from "@fncts/base/internal/Stack";
11
- import * as tsplus_module_10 from "@fncts/io/IO/api";
12
- import * as tsplus_module_11 from "@fncts/base/collection/immutable/HashMap/api";
13
- import * as tsplus_module_12 from "@fncts/io/FiberRefs/api";
14
- import * as tsplus_module_13 from "@fncts/io/FiberRefs/join";
15
- import * as tsplus_module_14 from "@fncts/base/data/Exit/api";
16
- import * as tsplus_module_15 from "@fncts/base/collection/immutable/Conc";
17
- import * as tsplus_module_16 from "@fncts/base/collection/immutable/Conc/api/empty";
18
- import * as tsplus_module_17 from "@fncts/io/Future/api";
19
- import * as tsplus_module_18 from "@fncts/io/IO/api/environment";
20
- import * as tsplus_module_19 from "@fncts/io/IO/api/fulfill";
21
- import * as tsplus_module_20 from "@fncts/io/Future/constructors";
22
- import * as tsplus_module_21 from "@fncts/base/data/Either/constructors";
23
- import * as tsplus_module_22 from "@fncts/io/FiberScope/constructors";
24
- import * as tsplus_module_23 from "@fncts/base/collection/immutable/List/constructors";
25
- import * as tsplus_module_24 from "@fncts/io/RuntimeConfig";
26
- import * as tsplus_module_25 from "@fncts/io/Supervisor/constructors";
27
- import * as tsplus_module_26 from "@fncts/base/data/Cause/api";
28
- import * as tsplus_module_27 from "@fncts/base/data/Exit/constructors";
29
- import * as tsplus_module_28 from "@fncts/io/InterruptStatus/constructors";
30
- import * as tsplus_module_29 from "@fncts/io/Supervisor/api";
31
- import * as tsplus_module_30 from "@fncts/io/FiberRef/unsafe";
32
- import * as tsplus_module_31 from "@fncts/base/data/Maybe/api";
33
- import * as tsplus_module_32 from "@fncts/base/data/exceptions";
34
- import * as tsplus_module_33 from "@fncts/base/data/FiberId/constructors";
35
- import * as tsplus_module_34 from "@fncts/io/IO/api/interrupt";
36
- import * as tsplus_module_35 from "@fncts/io/FiberRef/api";
37
- import * as tsplus_module_36 from "@fncts/base/collection/immutable/List/definition";
38
- import * as tsplus_module_37 from "@fncts/base/data/Cause/api/isEmpty";
39
- import * as tsplus_module_38 from "@fncts/io/FiberStatus/constructors";
40
- import * as tsplus_module_39 from "@fncts/io/CancellerState";
41
- import * as tsplus_module_40 from "@fncts/io/FiberState/api";
42
- import * as tsplus_module_41 from "@fncts/base/data/TraceElement/definition";
43
- import * as tsplus_module_42 from "@fncts/io/FiberDescriptor";
44
- import * as tsplus_module_43 from "@fncts/base/collection/immutable/List/api";
45
- import * as tsplus_module_44 from "@fncts/base/data/Trace/definition";
11
+ import * as tsplus_module_10 from "@fncts/io/FiberRef/unsafe";
12
+ import * as tsplus_module_11 from "@fncts/io/IO/api";
13
+ import * as tsplus_module_12 from "@fncts/base/collection/immutable/HashMap/api";
14
+ import * as tsplus_module_13 from "@fncts/io/FiberRefs/api";
15
+ import * as tsplus_module_14 from "@fncts/io/FiberRefs/join";
16
+ import * as tsplus_module_15 from "@fncts/base/data/Exit/api";
17
+ import * as tsplus_module_16 from "@fncts/base/collection/immutable/Conc";
18
+ import * as tsplus_module_17 from "@fncts/base/collection/immutable/Conc/api/empty";
19
+ import * as tsplus_module_18 from "@fncts/io/Future/api";
20
+ import * as tsplus_module_19 from "@fncts/io/IO/api/environment";
21
+ import * as tsplus_module_20 from "@fncts/io/IO/api/fulfill";
22
+ import * as tsplus_module_21 from "@fncts/io/Future/constructors";
23
+ import * as tsplus_module_22 from "@fncts/base/data/Either/constructors";
24
+ import * as tsplus_module_23 from "@fncts/io/FiberScope/constructors";
25
+ import * as tsplus_module_24 from "@fncts/base/collection/immutable/List/constructors";
26
+ import * as tsplus_module_25 from "@fncts/io/RuntimeConfig";
27
+ import * as tsplus_module_26 from "@fncts/io/Supervisor/constructors";
28
+ import * as tsplus_module_27 from "@fncts/base/data/Cause/api";
29
+ import * as tsplus_module_28 from "@fncts/base/data/Exit/constructors";
30
+ import * as tsplus_module_29 from "@fncts/base/data/exceptions";
31
+ import * as tsplus_module_30 from "@fncts/base/data/FiberId/constructors";
32
+ import * as tsplus_module_31 from "@fncts/io/IO/api/interrupt";
33
+ import * as tsplus_module_32 from "@fncts/io/FiberRef/api";
34
+ import * as tsplus_module_33 from "@fncts/base/data/Maybe/api";
35
+ import * as tsplus_module_34 from "@fncts/base/collection/immutable/List/definition";
36
+ import * as tsplus_module_35 from "@fncts/base/data/Cause/api/isEmpty";
37
+ import * as tsplus_module_36 from "@fncts/io/FiberStatus/constructors";
38
+ import * as tsplus_module_37 from "@fncts/io/CancellerState";
39
+ import * as tsplus_module_38 from "@fncts/io/FiberState/api";
40
+ import * as tsplus_module_39 from "@fncts/base/data/TraceElement/definition";
41
+ import * as tsplus_module_40 from "@fncts/io/FiberDescriptor";
42
+ import * as tsplus_module_41 from "@fncts/io/InterruptStatus/constructors";
43
+ import * as tsplus_module_42 from "@fncts/base/collection/immutable/List/api";
44
+ import * as tsplus_module_43 from "@fncts/base/data/Trace/definition";
46
45
  import { AtomicReference } from "@fncts/base/internal/AtomicReference";
47
46
  import { Stack } from "@fncts/base/internal/Stack";
48
47
  import { FiberTypeId, isFiber } from "@fncts/io/Fiber/definition";
@@ -107,15 +106,15 @@ export class FiberContext {
107
106
  this.interruptExit = new InterruptExit(v => {
108
107
  if (this.unsafeIsInterruptible) {
109
108
  this.interruptStatus.pop();
110
- return tsplus_module_10.succeedNow(v, fileName_1 + ":586:27");
109
+ return tsplus_module_11.succeedNow(v, fileName_1 + ":492:27");
111
110
  } else {
112
- return tsplus_module_10.succeed(() => {
111
+ return tsplus_module_11.succeed(() => {
113
112
  this.interruptStatus.pop();
114
113
  return v;
115
- }, fileName_1 + ":588:24");
114
+ }, fileName_1 + ":494:24");
116
115
  }
117
116
  });
118
- this.currentSupervisor = this.runtimeConfig.supervisor;
117
+ this.unsafeSetRef(tsplus_module_10.currentSupervisor, this.runtimeConfig.supervisor);
119
118
  }
120
119
 
121
120
  get [tsplus_module_2.hashSymbol]() {
@@ -123,23 +122,23 @@ export class FiberContext {
123
122
  }
124
123
 
125
124
  [tsplus_module_5.equalsSymbol](that) {
126
- return isFiber(that) && tsplus_module_7.strictEquals(this.id, tsplus_module_6.id(that, fileName_1 + ":69:44"));
125
+ return isFiber(that) && tsplus_module_7.strictEquals(this.id, tsplus_module_6.id(that, fileName_1 + ":68:44"));
127
126
  }
128
127
 
129
128
  get poll() {
130
- return tsplus_module_10.succeed(() => this.unsafePoll(), fileName_1 + ":89:22");
129
+ return tsplus_module_11.succeed(() => this.unsafePoll(), fileName_1 + ":87:22");
131
130
  }
132
131
 
133
132
  get inheritRefs() {
134
- return tsplus_module_10.defer(() => {
133
+ return tsplus_module_11.defer(() => {
135
134
  const childFiberRefLocals = this.fiberRefLocals.get;
136
135
 
137
- if (tsplus_module_11.isEmpty(childFiberRefLocals)) {
138
- return tsplus_module_10.unit;
136
+ if (tsplus_module_12.isEmpty(childFiberRefLocals)) {
137
+ return tsplus_module_11.unit;
139
138
  } else {
140
- return tsplus_module_10.updateFiberRefs((parentFiberId, parentFiberRefs) => tsplus_module_13.join(parentFiberRefs, parentFiberId, tsplus_module_12.make(childFiberRefLocals)), fileName_1 + ":98:34");
139
+ return tsplus_module_11.updateFiberRefs((parentFiberId, parentFiberRefs) => tsplus_module_14.join(parentFiberRefs, parentFiberId, tsplus_module_13.make(childFiberRefLocals)), fileName_1 + ":96:34");
141
140
  }
142
- }, fileName_1 + ":93:20");
141
+ }, fileName_1 + ":91:20");
143
142
  }
144
143
 
145
144
  get id() {
@@ -147,7 +146,7 @@ export class FiberContext {
147
146
  }
148
147
 
149
148
  awaitAsync(k) {
150
- const exit = this.unsafeAddObserver(exit => k(tsplus_module_14.flatten(exit)));
149
+ const exit = this.unsafeAddObserver(exit => k(tsplus_module_15.flatten(exit)));
151
150
 
152
151
  if (exit != null) {
153
152
  k(exit);
@@ -155,33 +154,33 @@ export class FiberContext {
155
154
  }
156
155
 
157
156
  get children() {
158
- return this.evalOnIO(tsplus_module_10.succeed(() => {
159
- const concBuilder = new tsplus_module_15.ConcBuilder(tsplus_module_16.empty());
157
+ return this.evalOnIO(tsplus_module_11.succeed(() => {
158
+ const concBuilder = new tsplus_module_16.ConcBuilder(tsplus_module_17.empty());
160
159
 
161
160
  for (const child of this._children) {
162
161
  concBuilder.append(child);
163
162
  }
164
163
 
165
164
  return concBuilder.result();
166
- }, fileName_1 + ":119:17"), tsplus_module_10.succeed(() => tsplus_module_16.empty(), fileName_1 + ":128:17"), fileName_1 + ":118:25");
165
+ }, fileName_1 + ":117:17"), tsplus_module_11.succeed(() => tsplus_module_17.empty(), fileName_1 + ":126:17"), fileName_1 + ":116:25");
167
166
  }
168
167
 
169
168
  evalOnIO(effect, orElse, __tsplusTrace) {
170
- return tsplus_module_10.flatMap_(tsplus_module_18.environment(fileName_1 + ":138:33"), r => tsplus_module_10.flatMap_(tsplus_module_20.make(fileName_1 + ":139:30"), p => tsplus_module_10.flatMap_(this.evalOn(tsplus_module_19.fulfill_(tsplus_module_18.provideEnvironment_(effect, r, fileName_1 + ":140:46"), p, fileName_1 + ":140:57"), tsplus_module_19.fulfill_(tsplus_module_18.provideEnvironment_(orElse, r, fileName_1 + ":140:87"), p, fileName_1 + ":140:98")), () => tsplus_module_17.wait(p, fileName_1 + ":141:17"), fileName_1 + ":140:8"), fileName_1 + ":139:18"), fileName_1 + ":138:18");
169
+ return tsplus_module_11.flatMap_(tsplus_module_19.environment(fileName_1 + ":136:33"), r => tsplus_module_11.flatMap_(tsplus_module_21.make(fileName_1 + ":137:30"), p => tsplus_module_11.flatMap_(this.evalOn(tsplus_module_20.fulfill_(tsplus_module_19.provideEnvironment_(effect, r, fileName_1 + ":138:46"), p, fileName_1 + ":138:57"), tsplus_module_20.fulfill_(tsplus_module_19.provideEnvironment_(orElse, r, fileName_1 + ":138:87"), p, fileName_1 + ":138:98")), () => tsplus_module_18.wait(p, fileName_1 + ":139:17"), fileName_1 + ":138:8"), fileName_1 + ":137:18"), fileName_1 + ":136:18");
171
170
  }
172
171
 
173
172
  get await() {
174
- return tsplus_module_10.asyncInterrupt(k => {
175
- const cb = x => k(tsplus_module_10.fromExit(() => x, fileName_1 + ":147:78"));
173
+ return tsplus_module_11.asyncInterrupt(k => {
174
+ const cb = x => k(tsplus_module_11.fromExit(() => x, fileName_1 + ":145:78"));
176
175
 
177
176
  const result = this.unsafeAddObserver(cb);
178
177
 
179
178
  if (result == null) {
180
- return tsplus_module_21.left(tsplus_module_10.succeed(() => this.unsafeRemoveObserver(cb), fileName_1 + ":150:38"));
179
+ return tsplus_module_22.left(tsplus_module_11.succeed(() => this.unsafeRemoveObserver(cb), fileName_1 + ":148:38"));
181
180
  } else {
182
- return tsplus_module_21.right(tsplus_module_10.succeedNow(result, fileName_1 + ":152:42"));
181
+ return tsplus_module_22.right(tsplus_module_11.succeedNow(result, fileName_1 + ":150:42"));
183
182
  }
184
- }, this.fiberId, fileName_1 + ":146:29");
183
+ }, this.fiberId, fileName_1 + ":144:29");
185
184
  }
186
185
 
187
186
  run() {
@@ -189,15 +188,15 @@ export class FiberContext {
189
188
  }
190
189
 
191
190
  get scope() {
192
- return tsplus_module_22.unsafeMake(this);
191
+ return tsplus_module_23.unsafeMake(this);
193
192
  }
194
193
 
195
194
  get status() {
196
- return tsplus_module_10.succeedNow(this.state.status, fileName_1 + ":166:25");
195
+ return tsplus_module_11.succeedNow(this.state.status, fileName_1 + ":164:25");
197
196
  }
198
197
 
199
198
  get trace() {
200
- return tsplus_module_10.succeed(() => this.unsafeCaptureTrace(tsplus_module_23.empty()), fileName_1 + ":170:22");
199
+ return tsplus_module_11.succeed(() => this.unsafeCaptureTrace(tsplus_module_24.empty()), fileName_1 + ":168:22");
201
200
  }
202
201
 
203
202
  interruptAs(fiberId) {
@@ -205,7 +204,7 @@ export class FiberContext {
205
204
  }
206
205
 
207
206
  evalOn(effect, orElse) {
208
- return tsplus_module_10.defer(() => this.unsafeEvalOn(effect, orElse), fileName_1 + ":178:20");
207
+ return tsplus_module_11.defer(() => this.unsafeEvalOn(effect, orElse), fileName_1 + ":176:20");
209
208
  }
210
209
 
211
210
  get location() {
@@ -224,9 +223,9 @@ export class FiberContext {
224
223
  this.nextIO = null;
225
224
  let extraTrace = undefined;
226
225
  const flags = this.runtimeConfig.flags;
227
- const superviseOps = flags.isEnabled(tsplus_module_24.RuntimeConfigFlag.SuperviseOperations) && this.currentSupervisor !== tsplus_module_25.none;
228
- this.runtimeConfig.flags.isEnabled(tsplus_module_24.RuntimeConfigFlag.EnableCurrentFiber) && currentFiber.set(this);
229
- this.currentSupervisor !== tsplus_module_25.none && this.currentSupervisor.unsafeOnResume(this);
226
+ const superviseOps = flags.isEnabled(tsplus_module_25.RuntimeConfigFlag.SuperviseOperations) && this.currentSupervisor !== tsplus_module_26.none;
227
+ this.runtimeConfig.flags.isEnabled(tsplus_module_25.RuntimeConfigFlag.EnableCurrentFiber) && currentFiber.set(this);
228
+ this.currentSupervisor !== tsplus_module_26.none && this.currentSupervisor.unsafeOnResume(this);
230
229
 
231
230
  while (current !== null) {
232
231
  try {
@@ -238,7 +237,7 @@ export class FiberContext {
238
237
 
239
238
  if (message !== null) {
240
239
  const oldIO = current;
241
- current = tsplus_module_10.flatMap_(message, () => oldIO, fileName_1 + ":215:55");
240
+ current = tsplus_module_11.flatMap_(message, () => oldIO, fileName_1 + ":213:55");
242
241
  } else if (opCount === maxOpCount) {
243
242
  this.unsafeRunLater(current);
244
243
  current = null;
@@ -289,7 +288,7 @@ export class FiberContext {
289
288
  :
290
289
  {
291
290
  extraTrace = current.trace;
292
- this.unsafeRunLater(tsplus_module_10.unit);
291
+ this.unsafeRunLater(tsplus_module_11.unit);
293
292
  extraTrace = undefined;
294
293
  current = null;
295
294
  break;
@@ -310,7 +309,7 @@ export class FiberContext {
310
309
  /* IOTag.Trace */
311
310
  :
312
311
  {
313
- current = this.unsafeNextEffect(this.unsafeCaptureTrace(tsplus_module_23.cons(current.trace, tsplus_module_23.nil())));
312
+ current = this.unsafeNextEffect(this.unsafeCaptureTrace(tsplus_module_24.cons(current.trace, tsplus_module_24.nil())));
314
313
  break;
315
314
  }
316
315
 
@@ -342,25 +341,25 @@ export class FiberContext {
342
341
  /* IOTag.Fail */
343
342
  :
344
343
  {
345
- const fastPathTrace = extraTrace === undefined ? tsplus_module_23.nil() : tsplus_module_23.cons(extraTrace, tsplus_module_23.nil());
344
+ const fastPathTrace = extraTrace === undefined ? tsplus_module_24.nil() : tsplus_module_24.cons(extraTrace, tsplus_module_24.nil());
346
345
  extraTrace = undefined;
347
346
  const cause = current.cause();
348
- const tracedCause = tsplus_module_26.isTraced(cause) ? cause : tsplus_module_26.traced(cause, this.unsafeCaptureTrace(tsplus_module_23.cons(current.trace, fastPathTrace)));
347
+ const tracedCause = tsplus_module_27.isTraced(cause) ? cause : tsplus_module_27.traced(cause, this.unsafeCaptureTrace(tsplus_module_24.cons(current.trace, fastPathTrace)));
349
348
  const discardedFolds = this.unsafeUnwindStack();
350
349
  const strippedCause = discardedFolds ? // We threw away some error handlers while unwinding the stack because
351
- tsplus_module_26.stripFailures( // We threw away some error handlers while unwinding the stack because
350
+ tsplus_module_27.stripFailures( // We threw away some error handlers while unwinding the stack because
352
351
  // we got interrupted during this instruction. So it's not safe to return
353
352
  // typed failures from cause0, because they might not be typed correctly.
354
353
  // Instead, we strip the typed failures, and return the remainders and
355
354
  // the interruption
356
355
  tracedCause) : tracedCause;
357
356
  const suppressed = this.unsafeClearSuppressedCause();
358
- const fullCause = tsplus_module_26.contains_(strippedCause, suppressed) ? strippedCause : tsplus_module_26.then(strippedCause, suppressed);
357
+ const fullCause = tsplus_module_27.contains_(strippedCause, suppressed) ? strippedCause : tsplus_module_27.then(strippedCause, suppressed);
359
358
 
360
359
  if (!this.stack.hasNext) {
361
360
  // Error not caught, stack is empty:
362
361
  this.unsafeSetInterrupting(true);
363
- current = this.unsafeTryDone(tsplus_module_27.failCause(fullCause), current.trace);
362
+ current = this.unsafeTryDone(tsplus_module_28.failCause(fullCause), current.trace);
364
363
  } else {
365
364
  this.unsafeSetInterrupting(false); // Error caught, next continuation on the stack will deal
366
365
  // with it, so we just have to compute it here
@@ -380,29 +379,6 @@ export class FiberContext {
380
379
  break;
381
380
  }
382
381
 
383
- case "SetInterrupt"
384
- /* IOTag.SetInterrupt */
385
- :
386
- {
387
- const boolFlag = current.flag.toBoolean;
388
-
389
- if (this.unsafeIsInterruptible !== boolFlag) {
390
- this.interruptStatus.push(current.flag.toBoolean);
391
- this.unsafeRestoreInterruptStatus();
392
- }
393
-
394
- current = current.io;
395
- break;
396
- }
397
-
398
- case "GetInterrupt"
399
- /* IOTag.GetInterrupt */
400
- :
401
- {
402
- current = current.f(tsplus_module_28.fromBoolean(this.unsafeIsInterruptible));
403
- break;
404
- }
405
-
406
382
  case "Async"
407
383
  /* IOTag.Async */
408
384
  :
@@ -422,7 +398,7 @@ export class FiberContext {
422
398
  if (this.unsafeShouldInterrupt) {
423
399
  if (this.unsafeExitAsync(epoch)) {
424
400
  this.unsafeSetInterrupting(true);
425
- current = tsplus_module_10.flatMap_(r.left, () => tsplus_module_10.failCauseNow(this.unsafeClearSuppressedCause(), fileName_1 + ":349:67"), fileName_1 + ":349:45");
401
+ current = tsplus_module_11.flatMap_(r.left, () => tsplus_module_11.failCauseNow(this.unsafeClearSuppressedCause(), fileName_1 + ":336:67"), fileName_1 + ":336:45");
426
402
  } else {
427
403
  current = null;
428
404
  }
@@ -454,20 +430,12 @@ export class FiberContext {
454
430
  break;
455
431
  }
456
432
 
457
- case "GetDescriptor"
458
- /* IOTag.GetDescriptor */
459
- :
460
- {
461
- current = current.f(this.unsafeGetDescriptor());
462
- break;
463
- }
464
-
465
433
  case "Yield"
466
434
  /* IOTag.Yield */
467
435
  :
468
436
  {
469
437
  current = null;
470
- this.unsafeRunLater(tsplus_module_10.unit);
438
+ this.unsafeRunLater(tsplus_module_11.unit);
471
439
  break;
472
440
  }
473
441
 
@@ -487,63 +455,11 @@ export class FiberContext {
487
455
  break;
488
456
  }
489
457
 
490
- case "FiberRefModifyAll"
491
- /* IOTag.FiberRefModifyAll */
492
- :
493
- {
494
- const [result, newValue] = current.f(this.fiberId, tsplus_module_12.make(this.fiberRefLocals.get));
495
- this.fiberRefLocals.set(newValue.fiberRefLocals);
496
- current = this.unsafeNextEffect(result);
497
- break;
498
- }
499
-
500
- case "FiberRefModify"
501
- /* IOTag.FiberRefModify */
502
- :
503
- {
504
- const c = current;
505
- const [result, newValue] = current.f(this.unsafeGetRef(current.fiberRef));
506
- this.unsafeSetRef(c.fiberRef, newValue);
507
- current = this.unsafeNextEffect(result);
508
- break;
509
- }
510
-
511
- case "FiberRefLocally"
512
- /* IOTag.FiberRefLocally */
513
- :
514
- {
515
- const oldValue = this.unsafeGetRef(current.fiberRef);
516
- const fiberRef = current.fiberRef;
517
- this.unsafeSetRef(fiberRef, current.localValue);
518
- this.unsafeAddFinalizer(tsplus_module_10.succeed(() => {
519
- this.unsafeSetRef(fiberRef, oldValue);
520
- }, fileName_1 + ":413:33"));
521
- current = current.io;
522
- break;
523
- }
524
-
525
- case "FiberRefDelete"
526
- /* IOTag.FiberRefDelete */
527
- :
528
- {
529
- this.unsafeDeleteRef(current.fiberRef);
530
- current = this.unsafeNextEffect(undefined);
531
- break;
532
- }
533
-
534
- case "FiberRefWith"
535
- /* IOTag.FiberRefWith */
536
- :
537
- {
538
- current = current.f(this.unsafeGetRef(current.fiberRef));
539
- break;
540
- }
541
-
542
- case "GetRuntimeConfig"
543
- /* IOTag.GetRuntimeConfig */
458
+ case "Stateful"
459
+ /* IOTag.Stateful */
544
460
  :
545
461
  {
546
- current = current.f(this.runtimeConfig);
462
+ current = current.onState(this, this.state.status);
547
463
  break;
548
464
  }
549
465
 
@@ -555,49 +471,6 @@ export class FiberContext {
555
471
  break;
556
472
  }
557
473
 
558
- case "Supervise"
559
- /* IOTag.Supervise */
560
- :
561
- {
562
- const oldSupervisor = this.currentSupervisor;
563
- this.currentSupervisor = tsplus_module_29.zip_(current.supervisor, oldSupervisor);
564
- this.unsafeAddFinalizer(tsplus_module_10.succeed(() => {
565
- this.currentSupervisor = oldSupervisor;
566
- }, fileName_1 + ":446:33"));
567
- current = current.io;
568
- break;
569
- }
570
-
571
- case "GetForkScope"
572
- /* IOTag.GetForkScope */
573
- :
574
- {
575
- current = current.f(tsplus_module_31.getOrElse_(this.unsafeGetRef(tsplus_module_30.forkScopeOverride), () => this.scope));
576
- break;
577
- }
578
-
579
- case "OverrideForkScope"
580
- /* IOTag.OverrideForkScope */
581
- :
582
- {
583
- const oldForkScopeOverride = this.unsafeGetRef(tsplus_module_30.forkScopeOverride);
584
- this.unsafeSetRef(tsplus_module_30.forkScopeOverride, current.forkScope);
585
- this.unsafeAddFinalizer(tsplus_module_10.succeed(() => {
586
- this.unsafeSetRef(tsplus_module_30.forkScopeOverride, oldForkScopeOverride);
587
- }, fileName_1 + ":463:33"));
588
- current = current.io;
589
- break;
590
- }
591
-
592
- case "Ensuring"
593
- /* IOTag.Ensuring */
594
- :
595
- {
596
- this.unsafeAddFinalizer(current.finalizer);
597
- current = current.io;
598
- break;
599
- }
600
-
601
474
  case "Logged"
602
475
  /* IOTag.Logged */
603
476
  :
@@ -607,15 +480,6 @@ export class FiberContext {
607
480
  break;
608
481
  }
609
482
 
610
- case "SetRuntimeConfig"
611
- /* IOTag.SetRuntimeConfig */
612
- :
613
- {
614
- this.runtimeConfig = current.runtimeConfig;
615
- current = tsplus_module_10.unit;
616
- break;
617
- }
618
-
619
483
  default:
620
484
  {
621
485
  console.log("Unrecognized Instruction", current);
@@ -625,16 +489,16 @@ export class FiberContext {
625
489
  }
626
490
  } else {
627
491
  const trace = current.trace;
628
- current = tsplus_module_10.failCauseNow(this.unsafeClearSuppressedCause(), trace);
492
+ current = tsplus_module_11.failCauseNow(this.unsafeClearSuppressedCause(), trace);
629
493
  this.unsafeSetInterrupting(true);
630
494
  }
631
495
 
632
496
  opCount++;
633
497
  }
634
498
  } catch (e) {
635
- if (tsplus_module_32.isInterruptedException(e)) {
499
+ if (tsplus_module_29.isInterruptedException(e)) {
636
500
  const trace = current ? current.trace : undefined;
637
- current = tsplus_module_34.interruptAs(tsplus_module_33.none, trace);
501
+ current = tsplus_module_31.interruptAs(tsplus_module_30.none, trace);
638
502
  this.unsafeSetInterrupting(true);
639
503
  } else if (isIOError(e)) {
640
504
  switch (e.exit._tag) {
@@ -647,55 +511,55 @@ export class FiberContext {
647
511
  case "Failure":
648
512
  {
649
513
  const trace = current ? current.trace : undefined;
650
- current = tsplus_module_10.failCauseNow(e.exit.cause, trace);
514
+ current = tsplus_module_11.failCauseNow(e.exit.cause, trace);
651
515
  }
652
516
  }
653
517
  } else {
654
518
  this.unsafeSetInterrupting(true);
655
- current = tsplus_module_10.haltNow(e, fileName_1 + ":525:42");
519
+ current = tsplus_module_11.haltNow(e, fileName_1 + ":431:42");
656
520
  }
657
521
  }
658
522
  }
659
523
  } finally {
660
524
  currentFiber.set(null);
661
- this.currentSupervisor !== tsplus_module_25.none && this.currentSupervisor.unsafeOnSuspend(this);
525
+ this.currentSupervisor.unsafeOnSuspend(this);
662
526
  }
663
527
  }
664
528
 
665
529
  unsafeRunLater(i0) {
666
- this.unsafeGetRef(tsplus_module_30.currentScheduler).scheduleTask(() => {
530
+ this.unsafeGetRef(tsplus_module_10.currentScheduler).scheduleTask(() => {
667
531
  this.nextIO = i0;
668
532
  this.runUntil(this.runtimeConfig.yieldOpCount);
669
533
  });
670
534
  }
671
535
 
672
536
  unsafeGetRef(ref) {
673
- return tsplus_module_31.getOrElse_(tsplus_module_31.map_(tsplus_module_11.get_(this.fiberRefLocals.get, ref), _ => _.head[1]), () => tsplus_module_35.initial(ref));
537
+ return tsplus_module_33.getOrElse_(tsplus_module_33.map_(tsplus_module_12.get_(this.fiberRefLocals.get, ref), _ => _.head[1]), () => tsplus_module_32.initial(ref));
674
538
  }
675
539
 
676
540
  unsafeGetRefs(fiberRefLocals) {
677
- return tsplus_module_11.map_(fiberRefLocals.get, stack => stack.head[1]);
541
+ return tsplus_module_12.map_(fiberRefLocals.get, stack => stack.head[1]);
678
542
  }
679
543
 
680
544
  unsafeSetRef(ref, value) {
681
545
  const oldState = this.fiberRefLocals.get;
682
- const oldStack = tsplus_module_31.getOrElse_(tsplus_module_11.get_(oldState, ref), () => tsplus_module_23.empty());
546
+ const oldStack = tsplus_module_33.getOrElse_(tsplus_module_12.get_(oldState, ref), () => tsplus_module_24.empty());
683
547
  let newStack;
684
548
 
685
- if (tsplus_module_36.isEmpty(oldStack)) {
686
- newStack = tsplus_module_23.cons([this.fiberId, value]);
549
+ if (tsplus_module_34.isEmpty(oldStack)) {
550
+ newStack = tsplus_module_24.cons([this.fiberId, value]);
687
551
  } else if (tsplus_module_7.strictEquals(oldStack.head[0], this.fiberId)) {
688
- newStack = tsplus_module_23.cons([this.fiberId, value], oldStack.tail);
552
+ newStack = tsplus_module_24.cons([this.fiberId, value], oldStack.tail);
689
553
  } else {
690
- newStack = tsplus_module_23.cons([this.fiberId, value], oldStack);
554
+ newStack = tsplus_module_24.cons([this.fiberId, value], oldStack);
691
555
  }
692
556
 
693
- const newState = tsplus_module_11.set_(oldState, ref, newStack);
557
+ const newState = tsplus_module_12.set_(oldState, ref, newStack);
694
558
  this.fiberRefLocals.set(newState);
695
559
  }
696
560
 
697
561
  unsafeDeleteRef(ref) {
698
- this.fiberRefLocals.set(tsplus_module_11.remove_(this.fiberRefLocals.get, ref));
562
+ this.fiberRefLocals.set(tsplus_module_12.remove_(this.fiberRefLocals.get, ref));
699
563
  }
700
564
 
701
565
  unsafePoll() {
@@ -716,7 +580,7 @@ export class FiberContext {
716
580
  this.stack.push(new Finalizer(finalizer, v => {
717
581
  this.unsafeDisableInterruption();
718
582
  this.unsafeRestoreInterruptStatus();
719
- return tsplus_module_10.map_(finalizer, () => v, fileName_1 + ":600:29");
583
+ return tsplus_module_11.map_(finalizer, () => v, fileName_1 + ":506:29");
720
584
  }));
721
585
  }
722
586
 
@@ -745,9 +609,9 @@ export class FiberContext {
745
609
  }
746
610
 
747
611
  unsafeAddSuppressedCause(cause) {
748
- if (!tsplus_module_37.isEmpty(cause)) {
612
+ if (!tsplus_module_35.isEmpty(cause)) {
749
613
  if (this.state._tag === "Executing") {
750
- this.state.suppressed = tsplus_module_26.then(this.state.suppressed, cause);
614
+ this.state.suppressed = tsplus_module_27.then(this.state.suppressed, cause);
751
615
  }
752
616
  }
753
617
  }
@@ -775,14 +639,14 @@ export class FiberContext {
775
639
  case "Finalizer":
776
640
  {
777
641
  this.unsafeDisableInterruption();
778
- this.stack.push(new TracedCont(cause => tsplus_module_10.matchCauseIO_(frame.finalizer, finalizerCause => {
642
+ this.stack.push(new TracedCont(cause => tsplus_module_11.matchCauseIO_(frame.finalizer, finalizerCause => {
779
643
  this.interruptStatus.pop();
780
644
  this.unsafeAddSuppressedCause(finalizerCause);
781
- return tsplus_module_10.failCauseNow(cause, fileName_1 + ":664:43");
645
+ return tsplus_module_11.failCauseNow(cause, fileName_1 + ":570:43");
782
646
  }, () => {
783
647
  this.interruptStatus.pop();
784
- return tsplus_module_10.failCauseNow(cause, fileName_1 + ":668:43");
785
- }, fileName_1 + ":660:45"), frame.trace));
648
+ return tsplus_module_11.failCauseNow(cause, fileName_1 + ":574:43");
649
+ }, fileName_1 + ":566:45"), frame.trace));
786
650
  unwinding = false;
787
651
  break;
788
652
  }
@@ -827,13 +691,13 @@ export class FiberContext {
827
691
  const k = this.stack.pop();
828
692
  return k.apply(value);
829
693
  } else {
830
- return this.unsafeTryDone(tsplus_module_27.succeed(value));
694
+ return this.unsafeTryDone(tsplus_module_28.succeed(value));
831
695
  }
832
696
  }
833
697
 
834
698
  unsafeNotifyObservers(v, observers) {
835
699
  if (observers.size > 0) {
836
- const result = tsplus_module_27.succeed(v);
700
+ const result = tsplus_module_28.succeed(v);
837
701
  observers.forEach(k => k(result));
838
702
  }
839
703
  }
@@ -845,25 +709,25 @@ export class FiberContext {
845
709
  }
846
710
 
847
711
  unsafeInterruptAs(fiberId) {
848
- const interruptedCause = tsplus_module_26.interrupt(fiberId);
849
- return tsplus_module_10.defer(() => {
712
+ const interruptedCause = tsplus_module_27.interrupt(fiberId);
713
+ return tsplus_module_11.defer(() => {
850
714
  const oldState = this.state;
851
715
 
852
716
  if (this.state._tag === "Executing" && this.state.status._tag === "Suspended" && this.state.status.interruptible && this.state.asyncCanceller._tag === "Registered") {
853
717
  const asyncCanceller = this.state.asyncCanceller.asyncCanceller;
854
- const interrupt = tsplus_module_10.failCauseNow(interruptedCause, fileName_1 + ":738:52");
855
- this.state.status = tsplus_module_38.running(true);
718
+ const interrupt = tsplus_module_11.failCauseNow(interruptedCause, fileName_1 + ":644:52");
719
+ this.state.status = tsplus_module_36.running(true);
856
720
  this.state.interruptors = new Set(oldState.interruptors).add(fiberId);
857
- this.state.asyncCanceller = tsplus_module_39.empty;
858
- this.unsafeRunLater(tsplus_module_10.flatMap_(asyncCanceller, () => interrupt, fileName_1 + ":742:60"));
721
+ this.state.asyncCanceller = tsplus_module_37.empty;
722
+ this.unsafeRunLater(tsplus_module_11.flatMap_(asyncCanceller, () => interrupt, fileName_1 + ":648:60"));
859
723
  } else if (this.state._tag === "Executing") {
860
- const newCause = tsplus_module_26.then(this.state.suppressed, interruptedCause);
724
+ const newCause = tsplus_module_27.then(this.state.suppressed, interruptedCause);
861
725
  this.state.interruptors.add(fiberId);
862
726
  this.state.suppressed = newCause;
863
727
  }
864
728
 
865
729
  return this.await;
866
- }, fileName_1 + ":729:20");
730
+ }, fileName_1 + ":635:20");
867
731
  }
868
732
 
869
733
  unsafeTryDone(exit, trace) {
@@ -881,16 +745,16 @@ export class FiberContext {
881
745
  const mailbox = this.state.mailbox;
882
746
  this.state.mailbox = null;
883
747
  this.unsafeSetInterrupting(true);
884
- return tsplus_module_10.flatMap_(mailbox, () => tsplus_module_10.fromExit(() => exit, fileName_1 + ":764:60"), fileName_1 + ":764:42");
748
+ return tsplus_module_11.flatMap_(mailbox, () => tsplus_module_11.fromExit(() => exit, fileName_1 + ":670:60"), fileName_1 + ":670:42");
885
749
  } else if (this._children.size === 0) {
886
750
  // We are truly "done" because all the children of this fiber have terminated,
887
751
  // and there are no more pending effects that we have to execute on the fiber.
888
- const interruptorsCause = tsplus_module_40.interruptorsCause(this.state);
889
- const newExit = tsplus_module_37.isEmpty(interruptorsCause) ? exit : tsplus_module_14.mapErrorCause_(exit, cause => {
890
- if (tsplus_module_26.contains_(cause, interruptorsCause)) {
752
+ const interruptorsCause = tsplus_module_38.interruptorsCause(this.state);
753
+ const newExit = tsplus_module_35.isEmpty(interruptorsCause) ? exit : tsplus_module_15.mapErrorCause_(exit, cause => {
754
+ if (tsplus_module_27.contains_(cause, interruptorsCause)) {
891
755
  return cause;
892
756
  } else {
893
- return tsplus_module_26.then(cause, interruptorsCause);
757
+ return tsplus_module_27.then(cause, interruptorsCause);
894
758
  }
895
759
  });
896
760
  const observers = this.state.observers;
@@ -901,26 +765,26 @@ export class FiberContext {
901
765
  } else {
902
766
  // not done because there are children left to close
903
767
  this.unsafeSetInterrupting(true);
904
- let interruptChildren = tsplus_module_10.unit;
768
+ let interruptChildren = tsplus_module_11.unit;
905
769
 
906
770
  this._children.forEach(child => {
907
- interruptChildren = tsplus_module_10.flatMap_(interruptChildren, () => child.interruptAs(this.fiberId), fileName_1 + ":796:58");
771
+ interruptChildren = tsplus_module_11.flatMap_(interruptChildren, () => child.interruptAs(this.fiberId), fileName_1 + ":702:58");
908
772
  });
909
773
 
910
774
  this._children.clear();
911
775
 
912
- return tsplus_module_10.flatMap_(interruptChildren, () => tsplus_module_10.fromExit(() => exit, fileName_1 + ":800:70"), fileName_1 + ":800:52");
776
+ return tsplus_module_11.flatMap_(interruptChildren, () => tsplus_module_11.fromExit(() => exit, fileName_1 + ":706:70"), fileName_1 + ":706:52");
913
777
  }
914
778
  }
915
779
  }
916
780
  }
917
781
 
918
782
  unsafeSetAsyncCanceller(epoch, asyncCanceller0) {
919
- const asyncCanceller = !asyncCanceller0 ? tsplus_module_10.unit : asyncCanceller0;
783
+ const asyncCanceller = !asyncCanceller0 ? tsplus_module_11.unit : asyncCanceller0;
920
784
 
921
785
  if (this.state._tag === "Executing") {
922
786
  if (this.state.status._tag === "Suspended" && this.state.asyncCanceller._tag === "Pending" && this.state.status.epoch === epoch) {
923
- this.state.asyncCanceller = tsplus_module_39.registered(asyncCanceller);
787
+ this.state.asyncCanceller = tsplus_module_37.registered(asyncCanceller);
924
788
  } else if (this.state.status._tag === "Suspended" && this.state.asyncCanceller._tag === "Registered" && this.state.status.epoch === epoch) {
925
789
  throw new Error("inconsistent state in setAsyncCanceller");
926
790
  }
@@ -956,18 +820,18 @@ export class FiberContext {
956
820
  if (this.state._tag === "Executing" && this.state.status._tag === "Running"
957
821
  /* FiberStatusTag.Running */
958
822
  && this.state.asyncCanceller._tag === "Empty") {
959
- const newStatus = tsplus_module_38.suspended(this.state.status.interrupting, this.unsafeIsInterruptible && !this.unsafeIsInterrupting, epoch, blockingOn, trace);
823
+ const newStatus = tsplus_module_36.suspended(this.state.status.interrupting, this.unsafeIsInterruptible && !this.unsafeIsInterrupting, epoch, blockingOn, trace);
960
824
  this.state.status = newStatus;
961
- this.state.asyncCanceller = tsplus_module_39.pending;
825
+ this.state.asyncCanceller = tsplus_module_37.pending;
962
826
  } else {
963
- throw new tsplus_module_32.IllegalStateError(`Fiber ${tsplus_module_3.threadName(this.fiberId)} is not running`);
827
+ throw new tsplus_module_29.IllegalStateError(`Fiber ${tsplus_module_3.threadName(this.fiberId)} is not running`);
964
828
  }
965
829
  }
966
830
 
967
831
  unsafeExitAsync(epoch) {
968
832
  if (this.state._tag === "Executing" && this.state.status._tag === "Suspended" && this.state.status.epoch === epoch) {
969
- this.state.status = tsplus_module_38.running(this.state.status.interrupting);
970
- this.state.asyncCanceller = tsplus_module_39.empty;
833
+ this.state.status = tsplus_module_36.running(this.state.status.interrupting);
834
+ this.state.asyncCanceller = tsplus_module_37.empty;
971
835
  return true;
972
836
  }
973
837
 
@@ -983,31 +847,31 @@ export class FiberContext {
983
847
  }
984
848
 
985
849
  unsafeFork(io, forkScope = tsplus_module_1.nothing(), trace) {
986
- const childId = tsplus_module_33.unsafeMake(tsplus_module_41.parse(trace));
987
- const childFiberRefLocals = tsplus_module_11.mapWithIndex_(this.fiberRefLocals.get, (fiberRef, stack) => {
850
+ const childId = tsplus_module_30.unsafeMake(tsplus_module_39.parse(trace));
851
+ const childFiberRefLocals = tsplus_module_12.mapWithIndex_(this.fiberRefLocals.get, (fiberRef, stack) => {
988
852
  const oldValue = stack.head[1];
989
- const newValue = tsplus_module_35.patch(fiberRef)(tsplus_module_35.fork(fiberRef))(oldValue);
853
+ const newValue = tsplus_module_32.patch(fiberRef)(tsplus_module_32.fork(fiberRef))(oldValue);
990
854
 
991
855
  if (oldValue === newValue) {
992
856
  return stack;
993
857
  } else {
994
- return tsplus_module_23.cons([childId, newValue], stack);
858
+ return tsplus_module_24.cons([childId, newValue], stack);
995
859
  }
996
860
  });
997
- const parentScope = tsplus_module_31.getOrElse_(tsplus_module_31.orElse_(forkScope, () => this.unsafeGetRef(tsplus_module_30.forkScopeOverride)), () => this.scope);
861
+ const parentScope = tsplus_module_33.getOrElse_(tsplus_module_33.orElse_(forkScope, () => this.unsafeGetRef(tsplus_module_10.forkScopeOverride)), () => this.scope);
998
862
  const grandChildren = new Set();
999
863
  const childContext = new FiberContext(childId, this.runtimeConfig, tsplus_module_9.single(this.unsafeIsInterruptible), new AtomicReference(childFiberRefLocals), grandChildren);
1000
864
 
1001
- if (this.currentSupervisor !== tsplus_module_25.none) {
1002
- this.currentSupervisor.unsafeOnStart(this.unsafeGetRef(tsplus_module_30.currentEnvironment), io, tsplus_module_1.just(this), childContext);
865
+ if (this.currentSupervisor !== tsplus_module_26.none) {
866
+ this.currentSupervisor.unsafeOnStart(this.unsafeGetRef(tsplus_module_10.currentEnvironment), io, tsplus_module_1.just(this), childContext);
1003
867
  childContext.unsafeOnDone(exit => {
1004
- this.currentSupervisor.unsafeOnEnd(tsplus_module_14.flatten(exit), childContext);
868
+ this.currentSupervisor.unsafeOnEnd(tsplus_module_15.flatten(exit), childContext);
1005
869
  });
1006
870
  }
1007
871
 
1008
- const childIO = !parentScope.unsafeAdd(childContext) ? tsplus_module_34.interruptAs(parentScope.fiberId, fileName_1 + ":929:74") : io;
872
+ const childIO = !parentScope.unsafeAdd(childContext) ? tsplus_module_31.interruptAs(parentScope.fiberId, fileName_1 + ":835:74") : io;
1009
873
  childContext.nextIO = childIO;
1010
- this.unsafeGetRef(tsplus_module_30.currentScheduler).scheduleTask(() => childContext.runUntil(this.runtimeConfig.yieldOpCount));
874
+ this.unsafeGetRef(tsplus_module_10.currentScheduler).scheduleTask(() => childContext.runUntil(this.runtimeConfig.yieldOpCount));
1011
875
  return childContext;
1012
876
  }
1013
877
 
@@ -1017,7 +881,7 @@ export class FiberContext {
1017
881
  if (exit == null) {
1018
882
  return;
1019
883
  } else {
1020
- k(tsplus_module_27.succeed(exit));
884
+ k(tsplus_module_28.succeed(exit));
1021
885
  }
1022
886
  }
1023
887
 
@@ -1026,26 +890,26 @@ export class FiberContext {
1026
890
  case "Executing":
1027
891
  {
1028
892
  const suppressed = this.state.suppressed;
1029
- this.state.suppressed = tsplus_module_26.empty();
893
+ this.state.suppressed = tsplus_module_27.empty();
1030
894
  return suppressed;
1031
895
  }
1032
896
 
1033
897
  case "Done":
1034
898
  {
1035
- return tsplus_module_26.empty();
899
+ return tsplus_module_27.empty();
1036
900
  }
1037
901
  }
1038
902
  }
1039
903
 
1040
904
  unsafeGetDescriptor() {
1041
- return new tsplus_module_42.FiberDescriptor(this.fiberId, this.state.status, this.state.interruptors, tsplus_module_28.fromBoolean(this.unsafeIsInterruptible), this.scope);
905
+ return new tsplus_module_40.FiberDescriptor(this.fiberId, this.state.status, this.state.interruptors, tsplus_module_41.fromBoolean(this.unsafeIsInterruptible), this.scope);
1042
906
  }
1043
907
 
1044
908
  unsafeRace(race) {
1045
909
  const raceIndicator = new AtomicReference(true);
1046
910
  const left = this.unsafeFork(race.left, tsplus_module_1.nothing(), race.trace);
1047
911
  const right = this.unsafeFork(race.right, tsplus_module_1.nothing(), race.trace);
1048
- return tsplus_module_10.async(cb => {
912
+ return tsplus_module_11.async(cb => {
1049
913
  const leftRegister = left.unsafeAddObserver(() => {
1050
914
  this.unsafeCompleteRace(left, right, race.leftWins, raceIndicator, cb);
1051
915
  });
@@ -1061,7 +925,7 @@ export class FiberContext {
1061
925
  this.unsafeCompleteRace(right, left, race.rightWins, raceIndicator, cb);
1062
926
  }
1063
927
  }
1064
- }, tsplus_module_3.combine_(left.fiberId, right.fiberId), fileName_1 + ":978:20");
928
+ }, tsplus_module_3.combine_(left.fiberId, right.fiberId), fileName_1 + ":884:20");
1065
929
  }
1066
930
 
1067
931
  unsafeCompleteRace(winner, loser, cont, ab, cb) {
@@ -1072,23 +936,23 @@ export class FiberContext {
1072
936
 
1073
937
  unsafeCaptureTrace(prefix) {
1074
938
  const builder = new StackTraceBuilder();
1075
- tsplus_module_43.forEach_(prefix, element => builder.append(tsplus_module_41.parse(element)));
939
+ tsplus_module_42.forEach_(prefix, element => builder.append(tsplus_module_39.parse(element)));
1076
940
  const stack = this.stack.clone();
1077
941
 
1078
942
  while (stack.hasNext) {
1079
- builder.append(tsplus_module_41.parse(stack.pop().trace));
943
+ builder.append(tsplus_module_39.parse(stack.pop().trace));
1080
944
  }
1081
945
 
1082
- return new tsplus_module_44.Trace(this.fiberId, builder.result());
946
+ return new tsplus_module_43.Trace(this.fiberId, builder.result());
1083
947
  }
1084
948
 
1085
949
  unsafeEvalOn(effect, orElse) {
1086
950
  if (this.state._tag === "Executing") {
1087
- const newMailbox = this.state.mailbox == null ? effect : tsplus_module_10.flatMap_(this.state.mailbox, () => effect, fileName_1 + ":1022:92");
951
+ const newMailbox = this.state.mailbox == null ? effect : tsplus_module_11.flatMap_(this.state.mailbox, () => effect, fileName_1 + ":928:92");
1088
952
  this.state.mailbox = newMailbox;
1089
- return tsplus_module_10.unit;
953
+ return tsplus_module_11.unit;
1090
954
  } else {
1091
- return tsplus_module_10.asUnit(orElse, fileName_1 + ":1026:20");
955
+ return tsplus_module_11.asUnit(orElse, fileName_1 + ":932:20");
1092
956
  }
1093
957
  }
1094
958
 
@@ -1103,31 +967,31 @@ export class FiberContext {
1103
967
  }
1104
968
 
1105
969
  unsafeAddChild(child) {
1106
- this.unsafeEvalOn(tsplus_module_10.succeed(() => {
970
+ this.unsafeEvalOn(tsplus_module_11.succeed(() => {
1107
971
  this._children.add(child);
1108
- }, fileName_1 + ":1042:17"), tsplus_module_10.unit);
972
+ }, fileName_1 + ":948:17"), tsplus_module_11.unit);
1109
973
  }
1110
974
 
1111
975
  unsafeLog(message, trace) {
1112
- const logLevel = this.unsafeGetRef(tsplus_module_30.currentLogLevel);
1113
- const spans = this.unsafeGetRef(tsplus_module_30.currentLogSpan);
1114
- const annotations = this.unsafeGetRef(tsplus_module_30.currentLogAnnotations);
1115
- this.runtimeConfig.logger.log(tsplus_module_41.parse(trace), this.fiberId, logLevel, message, tsplus_module_26.empty(), this.fiberRefLocals.get, spans, annotations);
976
+ const logLevel = this.unsafeGetRef(tsplus_module_10.currentLogLevel);
977
+ const spans = this.unsafeGetRef(tsplus_module_10.currentLogSpan);
978
+ const annotations = this.unsafeGetRef(tsplus_module_10.currentLogAnnotations);
979
+ this.runtimeConfig.logger.log(tsplus_module_39.parse(trace), this.fiberId, logLevel, message, tsplus_module_27.empty(), this.fiberRefLocals.get, spans, annotations);
1116
980
  }
1117
981
 
1118
982
  unsafeLogWith(message, cause, overrideLogLevel, overrideRef1 = null, overrideValue1 = null, trace) {
1119
- const logLevel = tsplus_module_31.getOrElse_(overrideLogLevel, () => this.unsafeGetRef(tsplus_module_30.currentLogLevel));
1120
- const spans = this.unsafeGetRef(tsplus_module_30.currentLogSpan);
1121
- const annotations = this.unsafeGetRef(tsplus_module_30.currentLogAnnotations);
983
+ const logLevel = tsplus_module_33.getOrElse_(overrideLogLevel, () => this.unsafeGetRef(tsplus_module_10.currentLogLevel));
984
+ const spans = this.unsafeGetRef(tsplus_module_10.currentLogSpan);
985
+ const annotations = this.unsafeGetRef(tsplus_module_10.currentLogAnnotations);
1122
986
  let contextMap;
1123
987
 
1124
988
  if (overrideRef1 !== null) {
1125
989
  const map = this.unsafeGetRefs(this.fiberRefLocals);
1126
990
 
1127
991
  if (overrideValue1 === null) {
1128
- tsplus_module_11.remove_(map, overrideRef1);
992
+ tsplus_module_12.remove_(map, overrideRef1);
1129
993
  } else {
1130
- tsplus_module_11.set_(map, overrideRef1, overrideValue1);
994
+ tsplus_module_12.set_(map, overrideRef1, overrideValue1);
1131
995
  }
1132
996
 
1133
997
  contextMap = map;
@@ -1135,7 +999,11 @@ export class FiberContext {
1135
999
  contextMap = this.fiberRefLocals.get;
1136
1000
  }
1137
1001
 
1138
- this.runtimeConfig.logger.log(tsplus_module_41.parse(trace), this.fiberId, logLevel, message, cause, contextMap, spans, annotations);
1002
+ this.runtimeConfig.logger.log(tsplus_module_39.parse(trace), this.fiberId, logLevel, message, cause, contextMap, spans, annotations);
1003
+ }
1004
+
1005
+ get currentSupervisor() {
1006
+ return this.unsafeGetRef(tsplus_module_10.currentSupervisor);
1139
1007
  }
1140
1008
 
1141
1009
  }