@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
@@ -24,75 +24,73 @@ var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require
24
24
 
25
25
  var tsplus_module_9 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/internal/Stack"));
26
26
 
27
- var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api"));
27
+ var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRef/unsafe"));
28
28
 
29
- var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/HashMap/api"));
29
+ var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api"));
30
30
 
31
- var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRefs/api"));
31
+ var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/HashMap/api"));
32
32
 
33
- var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRefs/join"));
33
+ var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRefs/api"));
34
34
 
35
- var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/api"));
35
+ var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRefs/join"));
36
36
 
37
- var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc"));
37
+ var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/api"));
38
38
 
39
- var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/api/empty"));
39
+ var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc"));
40
40
 
41
- var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/api"));
41
+ var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/Conc/api/empty"));
42
42
 
43
- var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
43
+ var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/api"));
44
44
 
45
- var tsplus_module_19 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/fulfill"));
45
+ var tsplus_module_19 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
46
46
 
47
- var tsplus_module_20 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/constructors"));
47
+ var tsplus_module_20 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/fulfill"));
48
48
 
49
- var tsplus_module_21 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/constructors"));
49
+ var tsplus_module_21 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Future/constructors"));
50
50
 
51
- var tsplus_module_22 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberScope/constructors"));
51
+ var tsplus_module_22 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/constructors"));
52
52
 
53
- var tsplus_module_23 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/List/constructors"));
53
+ var tsplus_module_23 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberScope/constructors"));
54
54
 
55
- var tsplus_module_24 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/RuntimeConfig"));
55
+ var tsplus_module_24 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/List/constructors"));
56
56
 
57
- var tsplus_module_25 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Supervisor/constructors"));
57
+ var tsplus_module_25 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/RuntimeConfig"));
58
58
 
59
- var tsplus_module_26 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api"));
59
+ var tsplus_module_26 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Supervisor/constructors"));
60
60
 
61
- var tsplus_module_27 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/constructors"));
61
+ var tsplus_module_27 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api"));
62
62
 
63
- var tsplus_module_28 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/InterruptStatus/constructors"));
63
+ var tsplus_module_28 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/constructors"));
64
64
 
65
- var tsplus_module_29 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Supervisor/api"));
65
+ var tsplus_module_29 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/exceptions"));
66
66
 
67
- var tsplus_module_30 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRef/unsafe"));
67
+ var tsplus_module_30 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/FiberId/constructors"));
68
68
 
69
- var tsplus_module_31 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/api"));
69
+ var tsplus_module_31 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/interrupt"));
70
70
 
71
- var tsplus_module_32 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/exceptions"));
71
+ var tsplus_module_32 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRef/api"));
72
72
 
73
- var tsplus_module_33 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/FiberId/constructors"));
73
+ var tsplus_module_33 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/api"));
74
74
 
75
- var tsplus_module_34 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/interrupt"));
75
+ var tsplus_module_34 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/List/definition"));
76
76
 
77
- var tsplus_module_35 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberRef/api"));
77
+ var tsplus_module_35 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api/isEmpty"));
78
78
 
79
- var tsplus_module_36 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/List/definition"));
79
+ var tsplus_module_36 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberStatus/constructors"));
80
80
 
81
- var tsplus_module_37 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api/isEmpty"));
81
+ var tsplus_module_37 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/CancellerState"));
82
82
 
83
- var tsplus_module_38 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberStatus/constructors"));
83
+ var tsplus_module_38 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberState/api"));
84
84
 
85
- var tsplus_module_39 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/CancellerState"));
85
+ var tsplus_module_39 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/TraceElement/definition"));
86
86
 
87
- var tsplus_module_40 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberState/api"));
87
+ var tsplus_module_40 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberDescriptor"));
88
88
 
89
- var tsplus_module_41 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/TraceElement/definition"));
89
+ var tsplus_module_41 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/InterruptStatus/constructors"));
90
90
 
91
- var tsplus_module_42 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/FiberDescriptor"));
91
+ var tsplus_module_42 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/List/api"));
92
92
 
93
- var tsplus_module_43 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/List/api"));
94
-
95
- var tsplus_module_44 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Trace/definition"));
93
+ var tsplus_module_43 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Trace/definition"));
96
94
 
97
95
  var _AtomicReference = /*#__PURE__*/require("@fncts/base/internal/AtomicReference");
98
96
 
@@ -181,15 +179,15 @@ class FiberContext {
181
179
  this.interruptExit = new InterruptExit(v => {
182
180
  if (this.unsafeIsInterruptible) {
183
181
  this.interruptStatus.pop();
184
- return tsplus_module_10.succeedNow(v, fileName_1 + ":586:27");
182
+ return tsplus_module_11.succeedNow(v, fileName_1 + ":492:27");
185
183
  } else {
186
- return tsplus_module_10.succeed(() => {
184
+ return tsplus_module_11.succeed(() => {
187
185
  this.interruptStatus.pop();
188
186
  return v;
189
- }, fileName_1 + ":588:24");
187
+ }, fileName_1 + ":494:24");
190
188
  }
191
189
  });
192
- this.currentSupervisor = this.runtimeConfig.supervisor;
190
+ this.unsafeSetRef(tsplus_module_10.currentSupervisor, this.runtimeConfig.supervisor);
193
191
  }
194
192
 
195
193
  get [tsplus_module_2.hashSymbol]() {
@@ -197,23 +195,23 @@ class FiberContext {
197
195
  }
198
196
 
199
197
  [tsplus_module_5.equalsSymbol](that) {
200
- return (0, _definition6.isFiber)(that) && tsplus_module_7.strictEquals(this.id, tsplus_module_6.id(that, fileName_1 + ":69:44"));
198
+ return (0, _definition6.isFiber)(that) && tsplus_module_7.strictEquals(this.id, tsplus_module_6.id(that, fileName_1 + ":68:44"));
201
199
  }
202
200
 
203
201
  get poll() {
204
- return tsplus_module_10.succeed(() => this.unsafePoll(), fileName_1 + ":89:22");
202
+ return tsplus_module_11.succeed(() => this.unsafePoll(), fileName_1 + ":87:22");
205
203
  }
206
204
 
207
205
  get inheritRefs() {
208
- return tsplus_module_10.defer(() => {
206
+ return tsplus_module_11.defer(() => {
209
207
  const childFiberRefLocals = this.fiberRefLocals.get;
210
208
 
211
- if (tsplus_module_11.isEmpty(childFiberRefLocals)) {
212
- return tsplus_module_10.unit;
209
+ if (tsplus_module_12.isEmpty(childFiberRefLocals)) {
210
+ return tsplus_module_11.unit;
213
211
  } else {
214
- return tsplus_module_10.updateFiberRefs((parentFiberId, parentFiberRefs) => tsplus_module_13.join(parentFiberRefs, parentFiberId, tsplus_module_12.make(childFiberRefLocals)), fileName_1 + ":98:34");
212
+ return tsplus_module_11.updateFiberRefs((parentFiberId, parentFiberRefs) => tsplus_module_14.join(parentFiberRefs, parentFiberId, tsplus_module_13.make(childFiberRefLocals)), fileName_1 + ":96:34");
215
213
  }
216
- }, fileName_1 + ":93:20");
214
+ }, fileName_1 + ":91:20");
217
215
  }
218
216
 
219
217
  get id() {
@@ -221,7 +219,7 @@ class FiberContext {
221
219
  }
222
220
 
223
221
  awaitAsync(k) {
224
- const exit = this.unsafeAddObserver(exit => k(tsplus_module_14.flatten(exit)));
222
+ const exit = this.unsafeAddObserver(exit => k(tsplus_module_15.flatten(exit)));
225
223
 
226
224
  if (exit != null) {
227
225
  k(exit);
@@ -229,33 +227,33 @@ class FiberContext {
229
227
  }
230
228
 
231
229
  get children() {
232
- return this.evalOnIO(tsplus_module_10.succeed(() => {
233
- const concBuilder = new tsplus_module_15.ConcBuilder(tsplus_module_16.empty());
230
+ return this.evalOnIO(tsplus_module_11.succeed(() => {
231
+ const concBuilder = new tsplus_module_16.ConcBuilder(tsplus_module_17.empty());
234
232
 
235
233
  for (const child of this._children) {
236
234
  concBuilder.append(child);
237
235
  }
238
236
 
239
237
  return concBuilder.result();
240
- }, fileName_1 + ":119:17"), tsplus_module_10.succeed(() => tsplus_module_16.empty(), fileName_1 + ":128:17"), fileName_1 + ":118:25");
238
+ }, fileName_1 + ":117:17"), tsplus_module_11.succeed(() => tsplus_module_17.empty(), fileName_1 + ":126:17"), fileName_1 + ":116:25");
241
239
  }
242
240
 
243
241
  evalOnIO(effect, orElse, __tsplusTrace) {
244
- 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");
242
+ 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");
245
243
  }
246
244
 
247
245
  get await() {
248
- return tsplus_module_10.asyncInterrupt(k => {
249
- const cb = x => k(tsplus_module_10.fromExit(() => x, fileName_1 + ":147:78"));
246
+ return tsplus_module_11.asyncInterrupt(k => {
247
+ const cb = x => k(tsplus_module_11.fromExit(() => x, fileName_1 + ":145:78"));
250
248
 
251
249
  const result = this.unsafeAddObserver(cb);
252
250
 
253
251
  if (result == null) {
254
- return tsplus_module_21.left(tsplus_module_10.succeed(() => this.unsafeRemoveObserver(cb), fileName_1 + ":150:38"));
252
+ return tsplus_module_22.left(tsplus_module_11.succeed(() => this.unsafeRemoveObserver(cb), fileName_1 + ":148:38"));
255
253
  } else {
256
- return tsplus_module_21.right(tsplus_module_10.succeedNow(result, fileName_1 + ":152:42"));
254
+ return tsplus_module_22.right(tsplus_module_11.succeedNow(result, fileName_1 + ":150:42"));
257
255
  }
258
- }, this.fiberId, fileName_1 + ":146:29");
256
+ }, this.fiberId, fileName_1 + ":144:29");
259
257
  }
260
258
 
261
259
  run() {
@@ -263,15 +261,15 @@ class FiberContext {
263
261
  }
264
262
 
265
263
  get scope() {
266
- return tsplus_module_22.unsafeMake(this);
264
+ return tsplus_module_23.unsafeMake(this);
267
265
  }
268
266
 
269
267
  get status() {
270
- return tsplus_module_10.succeedNow(this.state.status, fileName_1 + ":166:25");
268
+ return tsplus_module_11.succeedNow(this.state.status, fileName_1 + ":164:25");
271
269
  }
272
270
 
273
271
  get trace() {
274
- return tsplus_module_10.succeed(() => this.unsafeCaptureTrace(tsplus_module_23.empty()), fileName_1 + ":170:22");
272
+ return tsplus_module_11.succeed(() => this.unsafeCaptureTrace(tsplus_module_24.empty()), fileName_1 + ":168:22");
275
273
  }
276
274
 
277
275
  interruptAs(fiberId) {
@@ -279,7 +277,7 @@ class FiberContext {
279
277
  }
280
278
 
281
279
  evalOn(effect, orElse) {
282
- return tsplus_module_10.defer(() => this.unsafeEvalOn(effect, orElse), fileName_1 + ":178:20");
280
+ return tsplus_module_11.defer(() => this.unsafeEvalOn(effect, orElse), fileName_1 + ":176:20");
283
281
  }
284
282
 
285
283
  get location() {
@@ -298,9 +296,9 @@ class FiberContext {
298
296
  this.nextIO = null;
299
297
  let extraTrace = undefined;
300
298
  const flags = this.runtimeConfig.flags;
301
- const superviseOps = flags.isEnabled(tsplus_module_24.RuntimeConfigFlag.SuperviseOperations) && this.currentSupervisor !== tsplus_module_25.none;
302
- this.runtimeConfig.flags.isEnabled(tsplus_module_24.RuntimeConfigFlag.EnableCurrentFiber) && currentFiber.set(this);
303
- this.currentSupervisor !== tsplus_module_25.none && this.currentSupervisor.unsafeOnResume(this);
299
+ const superviseOps = flags.isEnabled(tsplus_module_25.RuntimeConfigFlag.SuperviseOperations) && this.currentSupervisor !== tsplus_module_26.none;
300
+ this.runtimeConfig.flags.isEnabled(tsplus_module_25.RuntimeConfigFlag.EnableCurrentFiber) && currentFiber.set(this);
301
+ this.currentSupervisor !== tsplus_module_26.none && this.currentSupervisor.unsafeOnResume(this);
304
302
 
305
303
  while (current !== null) {
306
304
  try {
@@ -312,7 +310,7 @@ class FiberContext {
312
310
 
313
311
  if (message !== null) {
314
312
  const oldIO = current;
315
- current = tsplus_module_10.flatMap_(message, () => oldIO, fileName_1 + ":215:55");
313
+ current = tsplus_module_11.flatMap_(message, () => oldIO, fileName_1 + ":213:55");
316
314
  } else if (opCount === maxOpCount) {
317
315
  this.unsafeRunLater(current);
318
316
  current = null;
@@ -363,7 +361,7 @@ class FiberContext {
363
361
  :
364
362
  {
365
363
  extraTrace = current.trace;
366
- this.unsafeRunLater(tsplus_module_10.unit);
364
+ this.unsafeRunLater(tsplus_module_11.unit);
367
365
  extraTrace = undefined;
368
366
  current = null;
369
367
  break;
@@ -384,7 +382,7 @@ class FiberContext {
384
382
  /* IOTag.Trace */
385
383
  :
386
384
  {
387
- current = this.unsafeNextEffect(this.unsafeCaptureTrace(tsplus_module_23.cons(current.trace, tsplus_module_23.nil())));
385
+ current = this.unsafeNextEffect(this.unsafeCaptureTrace(tsplus_module_24.cons(current.trace, tsplus_module_24.nil())));
388
386
  break;
389
387
  }
390
388
 
@@ -416,25 +414,25 @@ class FiberContext {
416
414
  /* IOTag.Fail */
417
415
  :
418
416
  {
419
- const fastPathTrace = extraTrace === undefined ? tsplus_module_23.nil() : tsplus_module_23.cons(extraTrace, tsplus_module_23.nil());
417
+ const fastPathTrace = extraTrace === undefined ? tsplus_module_24.nil() : tsplus_module_24.cons(extraTrace, tsplus_module_24.nil());
420
418
  extraTrace = undefined;
421
419
  const cause = current.cause();
422
- const tracedCause = tsplus_module_26.isTraced(cause) ? cause : tsplus_module_26.traced(cause, this.unsafeCaptureTrace(tsplus_module_23.cons(current.trace, fastPathTrace)));
420
+ const tracedCause = tsplus_module_27.isTraced(cause) ? cause : tsplus_module_27.traced(cause, this.unsafeCaptureTrace(tsplus_module_24.cons(current.trace, fastPathTrace)));
423
421
  const discardedFolds = this.unsafeUnwindStack();
424
422
  const strippedCause = discardedFolds ? // We threw away some error handlers while unwinding the stack because
425
- tsplus_module_26.stripFailures( // We threw away some error handlers while unwinding the stack because
423
+ tsplus_module_27.stripFailures( // We threw away some error handlers while unwinding the stack because
426
424
  // we got interrupted during this instruction. So it's not safe to return
427
425
  // typed failures from cause0, because they might not be typed correctly.
428
426
  // Instead, we strip the typed failures, and return the remainders and
429
427
  // the interruption
430
428
  tracedCause) : tracedCause;
431
429
  const suppressed = this.unsafeClearSuppressedCause();
432
- const fullCause = tsplus_module_26.contains_(strippedCause, suppressed) ? strippedCause : tsplus_module_26.then(strippedCause, suppressed);
430
+ const fullCause = tsplus_module_27.contains_(strippedCause, suppressed) ? strippedCause : tsplus_module_27.then(strippedCause, suppressed);
433
431
 
434
432
  if (!this.stack.hasNext) {
435
433
  // Error not caught, stack is empty:
436
434
  this.unsafeSetInterrupting(true);
437
- current = this.unsafeTryDone(tsplus_module_27.failCause(fullCause), current.trace);
435
+ current = this.unsafeTryDone(tsplus_module_28.failCause(fullCause), current.trace);
438
436
  } else {
439
437
  this.unsafeSetInterrupting(false); // Error caught, next continuation on the stack will deal
440
438
  // with it, so we just have to compute it here
@@ -454,29 +452,6 @@ class FiberContext {
454
452
  break;
455
453
  }
456
454
 
457
- case "SetInterrupt"
458
- /* IOTag.SetInterrupt */
459
- :
460
- {
461
- const boolFlag = current.flag.toBoolean;
462
-
463
- if (this.unsafeIsInterruptible !== boolFlag) {
464
- this.interruptStatus.push(current.flag.toBoolean);
465
- this.unsafeRestoreInterruptStatus();
466
- }
467
-
468
- current = current.io;
469
- break;
470
- }
471
-
472
- case "GetInterrupt"
473
- /* IOTag.GetInterrupt */
474
- :
475
- {
476
- current = current.f(tsplus_module_28.fromBoolean(this.unsafeIsInterruptible));
477
- break;
478
- }
479
-
480
455
  case "Async"
481
456
  /* IOTag.Async */
482
457
  :
@@ -496,7 +471,7 @@ class FiberContext {
496
471
  if (this.unsafeShouldInterrupt) {
497
472
  if (this.unsafeExitAsync(epoch)) {
498
473
  this.unsafeSetInterrupting(true);
499
- current = tsplus_module_10.flatMap_(r.left, () => tsplus_module_10.failCauseNow(this.unsafeClearSuppressedCause(), fileName_1 + ":349:67"), fileName_1 + ":349:45");
474
+ current = tsplus_module_11.flatMap_(r.left, () => tsplus_module_11.failCauseNow(this.unsafeClearSuppressedCause(), fileName_1 + ":336:67"), fileName_1 + ":336:45");
500
475
  } else {
501
476
  current = null;
502
477
  }
@@ -528,20 +503,12 @@ class FiberContext {
528
503
  break;
529
504
  }
530
505
 
531
- case "GetDescriptor"
532
- /* IOTag.GetDescriptor */
533
- :
534
- {
535
- current = current.f(this.unsafeGetDescriptor());
536
- break;
537
- }
538
-
539
506
  case "Yield"
540
507
  /* IOTag.Yield */
541
508
  :
542
509
  {
543
510
  current = null;
544
- this.unsafeRunLater(tsplus_module_10.unit);
511
+ this.unsafeRunLater(tsplus_module_11.unit);
545
512
  break;
546
513
  }
547
514
 
@@ -561,63 +528,11 @@ class FiberContext {
561
528
  break;
562
529
  }
563
530
 
564
- case "FiberRefModifyAll"
565
- /* IOTag.FiberRefModifyAll */
531
+ case "Stateful"
532
+ /* IOTag.Stateful */
566
533
  :
567
534
  {
568
- const [result, newValue] = current.f(this.fiberId, tsplus_module_12.make(this.fiberRefLocals.get));
569
- this.fiberRefLocals.set(newValue.fiberRefLocals);
570
- current = this.unsafeNextEffect(result);
571
- break;
572
- }
573
-
574
- case "FiberRefModify"
575
- /* IOTag.FiberRefModify */
576
- :
577
- {
578
- const c = current;
579
- const [result, newValue] = current.f(this.unsafeGetRef(current.fiberRef));
580
- this.unsafeSetRef(c.fiberRef, newValue);
581
- current = this.unsafeNextEffect(result);
582
- break;
583
- }
584
-
585
- case "FiberRefLocally"
586
- /* IOTag.FiberRefLocally */
587
- :
588
- {
589
- const oldValue = this.unsafeGetRef(current.fiberRef);
590
- const fiberRef = current.fiberRef;
591
- this.unsafeSetRef(fiberRef, current.localValue);
592
- this.unsafeAddFinalizer(tsplus_module_10.succeed(() => {
593
- this.unsafeSetRef(fiberRef, oldValue);
594
- }, fileName_1 + ":413:33"));
595
- current = current.io;
596
- break;
597
- }
598
-
599
- case "FiberRefDelete"
600
- /* IOTag.FiberRefDelete */
601
- :
602
- {
603
- this.unsafeDeleteRef(current.fiberRef);
604
- current = this.unsafeNextEffect(undefined);
605
- break;
606
- }
607
-
608
- case "FiberRefWith"
609
- /* IOTag.FiberRefWith */
610
- :
611
- {
612
- current = current.f(this.unsafeGetRef(current.fiberRef));
613
- break;
614
- }
615
-
616
- case "GetRuntimeConfig"
617
- /* IOTag.GetRuntimeConfig */
618
- :
619
- {
620
- current = current.f(this.runtimeConfig);
535
+ current = current.onState(this, this.state.status);
621
536
  break;
622
537
  }
623
538
 
@@ -629,49 +544,6 @@ class FiberContext {
629
544
  break;
630
545
  }
631
546
 
632
- case "Supervise"
633
- /* IOTag.Supervise */
634
- :
635
- {
636
- const oldSupervisor = this.currentSupervisor;
637
- this.currentSupervisor = tsplus_module_29.zip_(current.supervisor, oldSupervisor);
638
- this.unsafeAddFinalizer(tsplus_module_10.succeed(() => {
639
- this.currentSupervisor = oldSupervisor;
640
- }, fileName_1 + ":446:33"));
641
- current = current.io;
642
- break;
643
- }
644
-
645
- case "GetForkScope"
646
- /* IOTag.GetForkScope */
647
- :
648
- {
649
- current = current.f(tsplus_module_31.getOrElse_(this.unsafeGetRef(tsplus_module_30.forkScopeOverride), () => this.scope));
650
- break;
651
- }
652
-
653
- case "OverrideForkScope"
654
- /* IOTag.OverrideForkScope */
655
- :
656
- {
657
- const oldForkScopeOverride = this.unsafeGetRef(tsplus_module_30.forkScopeOverride);
658
- this.unsafeSetRef(tsplus_module_30.forkScopeOverride, current.forkScope);
659
- this.unsafeAddFinalizer(tsplus_module_10.succeed(() => {
660
- this.unsafeSetRef(tsplus_module_30.forkScopeOverride, oldForkScopeOverride);
661
- }, fileName_1 + ":463:33"));
662
- current = current.io;
663
- break;
664
- }
665
-
666
- case "Ensuring"
667
- /* IOTag.Ensuring */
668
- :
669
- {
670
- this.unsafeAddFinalizer(current.finalizer);
671
- current = current.io;
672
- break;
673
- }
674
-
675
547
  case "Logged"
676
548
  /* IOTag.Logged */
677
549
  :
@@ -681,15 +553,6 @@ class FiberContext {
681
553
  break;
682
554
  }
683
555
 
684
- case "SetRuntimeConfig"
685
- /* IOTag.SetRuntimeConfig */
686
- :
687
- {
688
- this.runtimeConfig = current.runtimeConfig;
689
- current = tsplus_module_10.unit;
690
- break;
691
- }
692
-
693
556
  default:
694
557
  {
695
558
  console.log("Unrecognized Instruction", current);
@@ -699,16 +562,16 @@ class FiberContext {
699
562
  }
700
563
  } else {
701
564
  const trace = current.trace;
702
- current = tsplus_module_10.failCauseNow(this.unsafeClearSuppressedCause(), trace);
565
+ current = tsplus_module_11.failCauseNow(this.unsafeClearSuppressedCause(), trace);
703
566
  this.unsafeSetInterrupting(true);
704
567
  }
705
568
 
706
569
  opCount++;
707
570
  }
708
571
  } catch (e) {
709
- if (tsplus_module_32.isInterruptedException(e)) {
572
+ if (tsplus_module_29.isInterruptedException(e)) {
710
573
  const trace = current ? current.trace : undefined;
711
- current = tsplus_module_34.interruptAs(tsplus_module_33.none, trace);
574
+ current = tsplus_module_31.interruptAs(tsplus_module_30.none, trace);
712
575
  this.unsafeSetInterrupting(true);
713
576
  } else if ((0, _definition7.isIOError)(e)) {
714
577
  switch (e.exit._tag) {
@@ -721,55 +584,55 @@ class FiberContext {
721
584
  case "Failure":
722
585
  {
723
586
  const trace = current ? current.trace : undefined;
724
- current = tsplus_module_10.failCauseNow(e.exit.cause, trace);
587
+ current = tsplus_module_11.failCauseNow(e.exit.cause, trace);
725
588
  }
726
589
  }
727
590
  } else {
728
591
  this.unsafeSetInterrupting(true);
729
- current = tsplus_module_10.haltNow(e, fileName_1 + ":525:42");
592
+ current = tsplus_module_11.haltNow(e, fileName_1 + ":431:42");
730
593
  }
731
594
  }
732
595
  }
733
596
  } finally {
734
597
  currentFiber.set(null);
735
- this.currentSupervisor !== tsplus_module_25.none && this.currentSupervisor.unsafeOnSuspend(this);
598
+ this.currentSupervisor.unsafeOnSuspend(this);
736
599
  }
737
600
  }
738
601
 
739
602
  unsafeRunLater(i0) {
740
- this.unsafeGetRef(tsplus_module_30.currentScheduler).scheduleTask(() => {
603
+ this.unsafeGetRef(tsplus_module_10.currentScheduler).scheduleTask(() => {
741
604
  this.nextIO = i0;
742
605
  this.runUntil(this.runtimeConfig.yieldOpCount);
743
606
  });
744
607
  }
745
608
 
746
609
  unsafeGetRef(ref) {
747
- return tsplus_module_31.getOrElse_(tsplus_module_31.map_(tsplus_module_11.get_(this.fiberRefLocals.get, ref), _ => _.head[1]), () => tsplus_module_35.initial(ref));
610
+ return tsplus_module_33.getOrElse_(tsplus_module_33.map_(tsplus_module_12.get_(this.fiberRefLocals.get, ref), _ => _.head[1]), () => tsplus_module_32.initial(ref));
748
611
  }
749
612
 
750
613
  unsafeGetRefs(fiberRefLocals) {
751
- return tsplus_module_11.map_(fiberRefLocals.get, stack => stack.head[1]);
614
+ return tsplus_module_12.map_(fiberRefLocals.get, stack => stack.head[1]);
752
615
  }
753
616
 
754
617
  unsafeSetRef(ref, value) {
755
618
  const oldState = this.fiberRefLocals.get;
756
- const oldStack = tsplus_module_31.getOrElse_(tsplus_module_11.get_(oldState, ref), () => tsplus_module_23.empty());
619
+ const oldStack = tsplus_module_33.getOrElse_(tsplus_module_12.get_(oldState, ref), () => tsplus_module_24.empty());
757
620
  let newStack;
758
621
 
759
- if (tsplus_module_36.isEmpty(oldStack)) {
760
- newStack = tsplus_module_23.cons([this.fiberId, value]);
622
+ if (tsplus_module_34.isEmpty(oldStack)) {
623
+ newStack = tsplus_module_24.cons([this.fiberId, value]);
761
624
  } else if (tsplus_module_7.strictEquals(oldStack.head[0], this.fiberId)) {
762
- newStack = tsplus_module_23.cons([this.fiberId, value], oldStack.tail);
625
+ newStack = tsplus_module_24.cons([this.fiberId, value], oldStack.tail);
763
626
  } else {
764
- newStack = tsplus_module_23.cons([this.fiberId, value], oldStack);
627
+ newStack = tsplus_module_24.cons([this.fiberId, value], oldStack);
765
628
  }
766
629
 
767
- const newState = tsplus_module_11.set_(oldState, ref, newStack);
630
+ const newState = tsplus_module_12.set_(oldState, ref, newStack);
768
631
  this.fiberRefLocals.set(newState);
769
632
  }
770
633
 
771
634
  unsafeDeleteRef(ref) {
772
- this.fiberRefLocals.set(tsplus_module_11.remove_(this.fiberRefLocals.get, ref));
635
+ this.fiberRefLocals.set(tsplus_module_12.remove_(this.fiberRefLocals.get, ref));
773
636
  }
774
637
 
775
638
  unsafePoll() {
@@ -790,7 +653,7 @@ class FiberContext {
790
653
  this.stack.push(new Finalizer(finalizer, v => {
791
654
  this.unsafeDisableInterruption();
792
655
  this.unsafeRestoreInterruptStatus();
793
- return tsplus_module_10.map_(finalizer, () => v, fileName_1 + ":600:29");
656
+ return tsplus_module_11.map_(finalizer, () => v, fileName_1 + ":506:29");
794
657
  }));
795
658
  }
796
659
 
@@ -819,9 +682,9 @@ class FiberContext {
819
682
  }
820
683
 
821
684
  unsafeAddSuppressedCause(cause) {
822
- if (!tsplus_module_37.isEmpty(cause)) {
685
+ if (!tsplus_module_35.isEmpty(cause)) {
823
686
  if (this.state._tag === "Executing") {
824
- this.state.suppressed = tsplus_module_26.then(this.state.suppressed, cause);
687
+ this.state.suppressed = tsplus_module_27.then(this.state.suppressed, cause);
825
688
  }
826
689
  }
827
690
  }
@@ -849,14 +712,14 @@ class FiberContext {
849
712
  case "Finalizer":
850
713
  {
851
714
  this.unsafeDisableInterruption();
852
- this.stack.push(new TracedCont(cause => tsplus_module_10.matchCauseIO_(frame.finalizer, finalizerCause => {
715
+ this.stack.push(new TracedCont(cause => tsplus_module_11.matchCauseIO_(frame.finalizer, finalizerCause => {
853
716
  this.interruptStatus.pop();
854
717
  this.unsafeAddSuppressedCause(finalizerCause);
855
- return tsplus_module_10.failCauseNow(cause, fileName_1 + ":664:43");
718
+ return tsplus_module_11.failCauseNow(cause, fileName_1 + ":570:43");
856
719
  }, () => {
857
720
  this.interruptStatus.pop();
858
- return tsplus_module_10.failCauseNow(cause, fileName_1 + ":668:43");
859
- }, fileName_1 + ":660:45"), frame.trace));
721
+ return tsplus_module_11.failCauseNow(cause, fileName_1 + ":574:43");
722
+ }, fileName_1 + ":566:45"), frame.trace));
860
723
  unwinding = false;
861
724
  break;
862
725
  }
@@ -901,13 +764,13 @@ class FiberContext {
901
764
  const k = this.stack.pop();
902
765
  return k.apply(value);
903
766
  } else {
904
- return this.unsafeTryDone(tsplus_module_27.succeed(value));
767
+ return this.unsafeTryDone(tsplus_module_28.succeed(value));
905
768
  }
906
769
  }
907
770
 
908
771
  unsafeNotifyObservers(v, observers) {
909
772
  if (observers.size > 0) {
910
- const result = tsplus_module_27.succeed(v);
773
+ const result = tsplus_module_28.succeed(v);
911
774
  observers.forEach(k => k(result));
912
775
  }
913
776
  }
@@ -919,25 +782,25 @@ class FiberContext {
919
782
  }
920
783
 
921
784
  unsafeInterruptAs(fiberId) {
922
- const interruptedCause = tsplus_module_26.interrupt(fiberId);
923
- return tsplus_module_10.defer(() => {
785
+ const interruptedCause = tsplus_module_27.interrupt(fiberId);
786
+ return tsplus_module_11.defer(() => {
924
787
  const oldState = this.state;
925
788
 
926
789
  if (this.state._tag === "Executing" && this.state.status._tag === "Suspended" && this.state.status.interruptible && this.state.asyncCanceller._tag === "Registered") {
927
790
  const asyncCanceller = this.state.asyncCanceller.asyncCanceller;
928
- const interrupt = tsplus_module_10.failCauseNow(interruptedCause, fileName_1 + ":738:52");
929
- this.state.status = tsplus_module_38.running(true);
791
+ const interrupt = tsplus_module_11.failCauseNow(interruptedCause, fileName_1 + ":644:52");
792
+ this.state.status = tsplus_module_36.running(true);
930
793
  this.state.interruptors = new Set(oldState.interruptors).add(fiberId);
931
- this.state.asyncCanceller = tsplus_module_39.empty;
932
- this.unsafeRunLater(tsplus_module_10.flatMap_(asyncCanceller, () => interrupt, fileName_1 + ":742:60"));
794
+ this.state.asyncCanceller = tsplus_module_37.empty;
795
+ this.unsafeRunLater(tsplus_module_11.flatMap_(asyncCanceller, () => interrupt, fileName_1 + ":648:60"));
933
796
  } else if (this.state._tag === "Executing") {
934
- const newCause = tsplus_module_26.then(this.state.suppressed, interruptedCause);
797
+ const newCause = tsplus_module_27.then(this.state.suppressed, interruptedCause);
935
798
  this.state.interruptors.add(fiberId);
936
799
  this.state.suppressed = newCause;
937
800
  }
938
801
 
939
802
  return this.await;
940
- }, fileName_1 + ":729:20");
803
+ }, fileName_1 + ":635:20");
941
804
  }
942
805
 
943
806
  unsafeTryDone(exit, trace) {
@@ -955,16 +818,16 @@ class FiberContext {
955
818
  const mailbox = this.state.mailbox;
956
819
  this.state.mailbox = null;
957
820
  this.unsafeSetInterrupting(true);
958
- return tsplus_module_10.flatMap_(mailbox, () => tsplus_module_10.fromExit(() => exit, fileName_1 + ":764:60"), fileName_1 + ":764:42");
821
+ return tsplus_module_11.flatMap_(mailbox, () => tsplus_module_11.fromExit(() => exit, fileName_1 + ":670:60"), fileName_1 + ":670:42");
959
822
  } else if (this._children.size === 0) {
960
823
  // We are truly "done" because all the children of this fiber have terminated,
961
824
  // and there are no more pending effects that we have to execute on the fiber.
962
- const interruptorsCause = tsplus_module_40.interruptorsCause(this.state);
963
- const newExit = tsplus_module_37.isEmpty(interruptorsCause) ? exit : tsplus_module_14.mapErrorCause_(exit, cause => {
964
- if (tsplus_module_26.contains_(cause, interruptorsCause)) {
825
+ const interruptorsCause = tsplus_module_38.interruptorsCause(this.state);
826
+ const newExit = tsplus_module_35.isEmpty(interruptorsCause) ? exit : tsplus_module_15.mapErrorCause_(exit, cause => {
827
+ if (tsplus_module_27.contains_(cause, interruptorsCause)) {
965
828
  return cause;
966
829
  } else {
967
- return tsplus_module_26.then(cause, interruptorsCause);
830
+ return tsplus_module_27.then(cause, interruptorsCause);
968
831
  }
969
832
  });
970
833
  const observers = this.state.observers;
@@ -975,26 +838,26 @@ class FiberContext {
975
838
  } else {
976
839
  // not done because there are children left to close
977
840
  this.unsafeSetInterrupting(true);
978
- let interruptChildren = tsplus_module_10.unit;
841
+ let interruptChildren = tsplus_module_11.unit;
979
842
 
980
843
  this._children.forEach(child => {
981
- interruptChildren = tsplus_module_10.flatMap_(interruptChildren, () => child.interruptAs(this.fiberId), fileName_1 + ":796:58");
844
+ interruptChildren = tsplus_module_11.flatMap_(interruptChildren, () => child.interruptAs(this.fiberId), fileName_1 + ":702:58");
982
845
  });
983
846
 
984
847
  this._children.clear();
985
848
 
986
- return tsplus_module_10.flatMap_(interruptChildren, () => tsplus_module_10.fromExit(() => exit, fileName_1 + ":800:70"), fileName_1 + ":800:52");
849
+ return tsplus_module_11.flatMap_(interruptChildren, () => tsplus_module_11.fromExit(() => exit, fileName_1 + ":706:70"), fileName_1 + ":706:52");
987
850
  }
988
851
  }
989
852
  }
990
853
  }
991
854
 
992
855
  unsafeSetAsyncCanceller(epoch, asyncCanceller0) {
993
- const asyncCanceller = !asyncCanceller0 ? tsplus_module_10.unit : asyncCanceller0;
856
+ const asyncCanceller = !asyncCanceller0 ? tsplus_module_11.unit : asyncCanceller0;
994
857
 
995
858
  if (this.state._tag === "Executing") {
996
859
  if (this.state.status._tag === "Suspended" && this.state.asyncCanceller._tag === "Pending" && this.state.status.epoch === epoch) {
997
- this.state.asyncCanceller = tsplus_module_39.registered(asyncCanceller);
860
+ this.state.asyncCanceller = tsplus_module_37.registered(asyncCanceller);
998
861
  } else if (this.state.status._tag === "Suspended" && this.state.asyncCanceller._tag === "Registered" && this.state.status.epoch === epoch) {
999
862
  throw new Error("inconsistent state in setAsyncCanceller");
1000
863
  }
@@ -1030,18 +893,18 @@ class FiberContext {
1030
893
  if (this.state._tag === "Executing" && this.state.status._tag === "Running"
1031
894
  /* FiberStatusTag.Running */
1032
895
  && this.state.asyncCanceller._tag === "Empty") {
1033
- const newStatus = tsplus_module_38.suspended(this.state.status.interrupting, this.unsafeIsInterruptible && !this.unsafeIsInterrupting, epoch, blockingOn, trace);
896
+ const newStatus = tsplus_module_36.suspended(this.state.status.interrupting, this.unsafeIsInterruptible && !this.unsafeIsInterrupting, epoch, blockingOn, trace);
1034
897
  this.state.status = newStatus;
1035
- this.state.asyncCanceller = tsplus_module_39.pending;
898
+ this.state.asyncCanceller = tsplus_module_37.pending;
1036
899
  } else {
1037
- throw new tsplus_module_32.IllegalStateError(`Fiber ${tsplus_module_3.threadName(this.fiberId)} is not running`);
900
+ throw new tsplus_module_29.IllegalStateError(`Fiber ${tsplus_module_3.threadName(this.fiberId)} is not running`);
1038
901
  }
1039
902
  }
1040
903
 
1041
904
  unsafeExitAsync(epoch) {
1042
905
  if (this.state._tag === "Executing" && this.state.status._tag === "Suspended" && this.state.status.epoch === epoch) {
1043
- this.state.status = tsplus_module_38.running(this.state.status.interrupting);
1044
- this.state.asyncCanceller = tsplus_module_39.empty;
906
+ this.state.status = tsplus_module_36.running(this.state.status.interrupting);
907
+ this.state.asyncCanceller = tsplus_module_37.empty;
1045
908
  return true;
1046
909
  }
1047
910
 
@@ -1057,31 +920,31 @@ class FiberContext {
1057
920
  }
1058
921
 
1059
922
  unsafeFork(io, forkScope = tsplus_module_1.nothing(), trace) {
1060
- const childId = tsplus_module_33.unsafeMake(tsplus_module_41.parse(trace));
1061
- const childFiberRefLocals = tsplus_module_11.mapWithIndex_(this.fiberRefLocals.get, (fiberRef, stack) => {
923
+ const childId = tsplus_module_30.unsafeMake(tsplus_module_39.parse(trace));
924
+ const childFiberRefLocals = tsplus_module_12.mapWithIndex_(this.fiberRefLocals.get, (fiberRef, stack) => {
1062
925
  const oldValue = stack.head[1];
1063
- const newValue = tsplus_module_35.patch(fiberRef)(tsplus_module_35.fork(fiberRef))(oldValue);
926
+ const newValue = tsplus_module_32.patch(fiberRef)(tsplus_module_32.fork(fiberRef))(oldValue);
1064
927
 
1065
928
  if (oldValue === newValue) {
1066
929
  return stack;
1067
930
  } else {
1068
- return tsplus_module_23.cons([childId, newValue], stack);
931
+ return tsplus_module_24.cons([childId, newValue], stack);
1069
932
  }
1070
933
  });
1071
- const parentScope = tsplus_module_31.getOrElse_(tsplus_module_31.orElse_(forkScope, () => this.unsafeGetRef(tsplus_module_30.forkScopeOverride)), () => this.scope);
934
+ const parentScope = tsplus_module_33.getOrElse_(tsplus_module_33.orElse_(forkScope, () => this.unsafeGetRef(tsplus_module_10.forkScopeOverride)), () => this.scope);
1072
935
  const grandChildren = new Set();
1073
936
  const childContext = new FiberContext(childId, this.runtimeConfig, tsplus_module_9.single(this.unsafeIsInterruptible), new _AtomicReference.AtomicReference(childFiberRefLocals), grandChildren);
1074
937
 
1075
- if (this.currentSupervisor !== tsplus_module_25.none) {
1076
- this.currentSupervisor.unsafeOnStart(this.unsafeGetRef(tsplus_module_30.currentEnvironment), io, tsplus_module_1.just(this), childContext);
938
+ if (this.currentSupervisor !== tsplus_module_26.none) {
939
+ this.currentSupervisor.unsafeOnStart(this.unsafeGetRef(tsplus_module_10.currentEnvironment), io, tsplus_module_1.just(this), childContext);
1077
940
  childContext.unsafeOnDone(exit => {
1078
- this.currentSupervisor.unsafeOnEnd(tsplus_module_14.flatten(exit), childContext);
941
+ this.currentSupervisor.unsafeOnEnd(tsplus_module_15.flatten(exit), childContext);
1079
942
  });
1080
943
  }
1081
944
 
1082
- const childIO = !parentScope.unsafeAdd(childContext) ? tsplus_module_34.interruptAs(parentScope.fiberId, fileName_1 + ":929:74") : io;
945
+ const childIO = !parentScope.unsafeAdd(childContext) ? tsplus_module_31.interruptAs(parentScope.fiberId, fileName_1 + ":835:74") : io;
1083
946
  childContext.nextIO = childIO;
1084
- this.unsafeGetRef(tsplus_module_30.currentScheduler).scheduleTask(() => childContext.runUntil(this.runtimeConfig.yieldOpCount));
947
+ this.unsafeGetRef(tsplus_module_10.currentScheduler).scheduleTask(() => childContext.runUntil(this.runtimeConfig.yieldOpCount));
1085
948
  return childContext;
1086
949
  }
1087
950
 
@@ -1091,7 +954,7 @@ class FiberContext {
1091
954
  if (exit == null) {
1092
955
  return;
1093
956
  } else {
1094
- k(tsplus_module_27.succeed(exit));
957
+ k(tsplus_module_28.succeed(exit));
1095
958
  }
1096
959
  }
1097
960
 
@@ -1100,26 +963,26 @@ class FiberContext {
1100
963
  case "Executing":
1101
964
  {
1102
965
  const suppressed = this.state.suppressed;
1103
- this.state.suppressed = tsplus_module_26.empty();
966
+ this.state.suppressed = tsplus_module_27.empty();
1104
967
  return suppressed;
1105
968
  }
1106
969
 
1107
970
  case "Done":
1108
971
  {
1109
- return tsplus_module_26.empty();
972
+ return tsplus_module_27.empty();
1110
973
  }
1111
974
  }
1112
975
  }
1113
976
 
1114
977
  unsafeGetDescriptor() {
1115
- return new tsplus_module_42.FiberDescriptor(this.fiberId, this.state.status, this.state.interruptors, tsplus_module_28.fromBoolean(this.unsafeIsInterruptible), this.scope);
978
+ return new tsplus_module_40.FiberDescriptor(this.fiberId, this.state.status, this.state.interruptors, tsplus_module_41.fromBoolean(this.unsafeIsInterruptible), this.scope);
1116
979
  }
1117
980
 
1118
981
  unsafeRace(race) {
1119
982
  const raceIndicator = new _AtomicReference.AtomicReference(true);
1120
983
  const left = this.unsafeFork(race.left, tsplus_module_1.nothing(), race.trace);
1121
984
  const right = this.unsafeFork(race.right, tsplus_module_1.nothing(), race.trace);
1122
- return tsplus_module_10.async(cb => {
985
+ return tsplus_module_11.async(cb => {
1123
986
  const leftRegister = left.unsafeAddObserver(() => {
1124
987
  this.unsafeCompleteRace(left, right, race.leftWins, raceIndicator, cb);
1125
988
  });
@@ -1135,7 +998,7 @@ class FiberContext {
1135
998
  this.unsafeCompleteRace(right, left, race.rightWins, raceIndicator, cb);
1136
999
  }
1137
1000
  }
1138
- }, tsplus_module_3.combine_(left.fiberId, right.fiberId), fileName_1 + ":978:20");
1001
+ }, tsplus_module_3.combine_(left.fiberId, right.fiberId), fileName_1 + ":884:20");
1139
1002
  }
1140
1003
 
1141
1004
  unsafeCompleteRace(winner, loser, cont, ab, cb) {
@@ -1146,23 +1009,23 @@ class FiberContext {
1146
1009
 
1147
1010
  unsafeCaptureTrace(prefix) {
1148
1011
  const builder = new _StackTraceBuilder.StackTraceBuilder();
1149
- tsplus_module_43.forEach_(prefix, element => builder.append(tsplus_module_41.parse(element)));
1012
+ tsplus_module_42.forEach_(prefix, element => builder.append(tsplus_module_39.parse(element)));
1150
1013
  const stack = this.stack.clone();
1151
1014
 
1152
1015
  while (stack.hasNext) {
1153
- builder.append(tsplus_module_41.parse(stack.pop().trace));
1016
+ builder.append(tsplus_module_39.parse(stack.pop().trace));
1154
1017
  }
1155
1018
 
1156
- return new tsplus_module_44.Trace(this.fiberId, builder.result());
1019
+ return new tsplus_module_43.Trace(this.fiberId, builder.result());
1157
1020
  }
1158
1021
 
1159
1022
  unsafeEvalOn(effect, orElse) {
1160
1023
  if (this.state._tag === "Executing") {
1161
- const newMailbox = this.state.mailbox == null ? effect : tsplus_module_10.flatMap_(this.state.mailbox, () => effect, fileName_1 + ":1022:92");
1024
+ const newMailbox = this.state.mailbox == null ? effect : tsplus_module_11.flatMap_(this.state.mailbox, () => effect, fileName_1 + ":928:92");
1162
1025
  this.state.mailbox = newMailbox;
1163
- return tsplus_module_10.unit;
1026
+ return tsplus_module_11.unit;
1164
1027
  } else {
1165
- return tsplus_module_10.asUnit(orElse, fileName_1 + ":1026:20");
1028
+ return tsplus_module_11.asUnit(orElse, fileName_1 + ":932:20");
1166
1029
  }
1167
1030
  }
1168
1031
 
@@ -1177,31 +1040,31 @@ class FiberContext {
1177
1040
  }
1178
1041
 
1179
1042
  unsafeAddChild(child) {
1180
- this.unsafeEvalOn(tsplus_module_10.succeed(() => {
1043
+ this.unsafeEvalOn(tsplus_module_11.succeed(() => {
1181
1044
  this._children.add(child);
1182
- }, fileName_1 + ":1042:17"), tsplus_module_10.unit);
1045
+ }, fileName_1 + ":948:17"), tsplus_module_11.unit);
1183
1046
  }
1184
1047
 
1185
1048
  unsafeLog(message, trace) {
1186
- const logLevel = this.unsafeGetRef(tsplus_module_30.currentLogLevel);
1187
- const spans = this.unsafeGetRef(tsplus_module_30.currentLogSpan);
1188
- const annotations = this.unsafeGetRef(tsplus_module_30.currentLogAnnotations);
1189
- this.runtimeConfig.logger.log(tsplus_module_41.parse(trace), this.fiberId, logLevel, message, tsplus_module_26.empty(), this.fiberRefLocals.get, spans, annotations);
1049
+ const logLevel = this.unsafeGetRef(tsplus_module_10.currentLogLevel);
1050
+ const spans = this.unsafeGetRef(tsplus_module_10.currentLogSpan);
1051
+ const annotations = this.unsafeGetRef(tsplus_module_10.currentLogAnnotations);
1052
+ this.runtimeConfig.logger.log(tsplus_module_39.parse(trace), this.fiberId, logLevel, message, tsplus_module_27.empty(), this.fiberRefLocals.get, spans, annotations);
1190
1053
  }
1191
1054
 
1192
1055
  unsafeLogWith(message, cause, overrideLogLevel, overrideRef1 = null, overrideValue1 = null, trace) {
1193
- const logLevel = tsplus_module_31.getOrElse_(overrideLogLevel, () => this.unsafeGetRef(tsplus_module_30.currentLogLevel));
1194
- const spans = this.unsafeGetRef(tsplus_module_30.currentLogSpan);
1195
- const annotations = this.unsafeGetRef(tsplus_module_30.currentLogAnnotations);
1056
+ const logLevel = tsplus_module_33.getOrElse_(overrideLogLevel, () => this.unsafeGetRef(tsplus_module_10.currentLogLevel));
1057
+ const spans = this.unsafeGetRef(tsplus_module_10.currentLogSpan);
1058
+ const annotations = this.unsafeGetRef(tsplus_module_10.currentLogAnnotations);
1196
1059
  let contextMap;
1197
1060
 
1198
1061
  if (overrideRef1 !== null) {
1199
1062
  const map = this.unsafeGetRefs(this.fiberRefLocals);
1200
1063
 
1201
1064
  if (overrideValue1 === null) {
1202
- tsplus_module_11.remove_(map, overrideRef1);
1065
+ tsplus_module_12.remove_(map, overrideRef1);
1203
1066
  } else {
1204
- tsplus_module_11.set_(map, overrideRef1, overrideValue1);
1067
+ tsplus_module_12.set_(map, overrideRef1, overrideValue1);
1205
1068
  }
1206
1069
 
1207
1070
  contextMap = map;
@@ -1209,7 +1072,11 @@ class FiberContext {
1209
1072
  contextMap = this.fiberRefLocals.get;
1210
1073
  }
1211
1074
 
1212
- this.runtimeConfig.logger.log(tsplus_module_41.parse(trace), this.fiberId, logLevel, message, cause, contextMap, spans, annotations);
1075
+ this.runtimeConfig.logger.log(tsplus_module_39.parse(trace), this.fiberId, logLevel, message, cause, contextMap, spans, annotations);
1076
+ }
1077
+
1078
+ get currentSupervisor() {
1079
+ return this.unsafeGetRef(tsplus_module_10.currentSupervisor);
1213
1080
  }
1214
1081
 
1215
1082
  }