effect 4.0.0-beta.65 → 4.0.0-beta.66

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 (243) hide show
  1. package/dist/Cause.d.ts +4 -4
  2. package/dist/Cause.d.ts.map +1 -1
  3. package/dist/Config.d.ts +1 -2
  4. package/dist/Config.d.ts.map +1 -1
  5. package/dist/Config.js +7 -6
  6. package/dist/Config.js.map +1 -1
  7. package/dist/Context.d.ts +3 -4
  8. package/dist/Context.d.ts.map +1 -1
  9. package/dist/Context.js +10 -8
  10. package/dist/Context.js.map +1 -1
  11. package/dist/DateTime.d.ts +1 -1
  12. package/dist/DateTime.d.ts.map +1 -1
  13. package/dist/DateTime.js +2 -2
  14. package/dist/DateTime.js.map +1 -1
  15. package/dist/Effect.d.ts +337 -412
  16. package/dist/Effect.d.ts.map +1 -1
  17. package/dist/Effect.js +5 -32
  18. package/dist/Effect.js.map +1 -1
  19. package/dist/Effectable.d.ts +1 -1
  20. package/dist/Effectable.d.ts.map +1 -1
  21. package/dist/Effectable.js +1 -1
  22. package/dist/Effectable.js.map +1 -1
  23. package/dist/ExecutionPlan.d.ts +2 -3
  24. package/dist/ExecutionPlan.d.ts.map +1 -1
  25. package/dist/ExecutionPlan.js +1 -1
  26. package/dist/ExecutionPlan.js.map +1 -1
  27. package/dist/FiberHandle.d.ts +2 -2
  28. package/dist/FiberHandle.js +2 -2
  29. package/dist/FiberMap.d.ts +2 -2
  30. package/dist/FiberMap.js +2 -2
  31. package/dist/FiberSet.d.ts +1 -1
  32. package/dist/FiberSet.js +1 -1
  33. package/dist/Layer.js +1 -1
  34. package/dist/Layer.js.map +1 -1
  35. package/dist/LayerMap.d.ts.map +1 -1
  36. package/dist/LayerMap.js +3 -3
  37. package/dist/LayerMap.js.map +1 -1
  38. package/dist/ManagedRuntime.d.ts +1 -1
  39. package/dist/ManagedRuntime.js +1 -1
  40. package/dist/Option.d.ts +11 -7
  41. package/dist/Option.d.ts.map +1 -1
  42. package/dist/Option.js +74 -0
  43. package/dist/Option.js.map +1 -1
  44. package/dist/Result.d.ts +11 -3
  45. package/dist/Result.d.ts.map +1 -1
  46. package/dist/Result.js.map +1 -1
  47. package/dist/Schedule.js +1 -1
  48. package/dist/Schedule.js.map +1 -1
  49. package/dist/Schema.d.ts +12 -12
  50. package/dist/Schema.d.ts.map +1 -1
  51. package/dist/Schema.js +6 -4
  52. package/dist/Schema.js.map +1 -1
  53. package/dist/SchemaGetter.js +2 -2
  54. package/dist/SchemaGetter.js.map +1 -1
  55. package/dist/SchemaRepresentation.d.ts +2 -2
  56. package/dist/Stream.d.ts +3 -3
  57. package/dist/Stream.js +1 -1
  58. package/dist/TxRef.js +1 -1
  59. package/dist/TxRef.js.map +1 -1
  60. package/dist/internal/concurrency.js +2 -2
  61. package/dist/internal/concurrency.js.map +1 -1
  62. package/dist/internal/core.js +8 -20
  63. package/dist/internal/core.js.map +1 -1
  64. package/dist/internal/effect.js +20 -19
  65. package/dist/internal/effect.js.map +1 -1
  66. package/dist/internal/executionPlan.js +2 -2
  67. package/dist/internal/executionPlan.js.map +1 -1
  68. package/dist/internal/option.js +5 -8
  69. package/dist/internal/option.js.map +1 -1
  70. package/dist/internal/result.js +5 -8
  71. package/dist/internal/result.js.map +1 -1
  72. package/dist/unstable/ai/LanguageModel.d.ts +5 -5
  73. package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
  74. package/dist/unstable/ai/LanguageModel.js +1 -1
  75. package/dist/unstable/ai/LanguageModel.js.map +1 -1
  76. package/dist/unstable/ai/McpServer.js +2 -2
  77. package/dist/unstable/ai/McpServer.js.map +1 -1
  78. package/dist/unstable/ai/Model.d.ts +5 -1
  79. package/dist/unstable/ai/Model.d.ts.map +1 -1
  80. package/dist/unstable/ai/Model.js +4 -4
  81. package/dist/unstable/ai/Model.js.map +1 -1
  82. package/dist/unstable/ai/Toolkit.d.ts +1 -3
  83. package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
  84. package/dist/unstable/ai/Toolkit.js +28 -31
  85. package/dist/unstable/ai/Toolkit.js.map +1 -1
  86. package/dist/unstable/cli/Command.d.ts +25 -5
  87. package/dist/unstable/cli/Command.d.ts.map +1 -1
  88. package/dist/unstable/cli/Command.js.map +1 -1
  89. package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
  90. package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
  91. package/dist/unstable/cli/Param.js +1 -1
  92. package/dist/unstable/cli/Param.js.map +1 -1
  93. package/dist/unstable/cli/Prompt.d.ts +1 -2
  94. package/dist/unstable/cli/Prompt.d.ts.map +1 -1
  95. package/dist/unstable/cli/Prompt.js +8 -10
  96. package/dist/unstable/cli/Prompt.js.map +1 -1
  97. package/dist/unstable/cli/internal/command.d.ts +2 -6
  98. package/dist/unstable/cli/internal/command.d.ts.map +1 -1
  99. package/dist/unstable/cli/internal/command.js +7 -9
  100. package/dist/unstable/cli/internal/command.js.map +1 -1
  101. package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
  102. package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
  103. package/dist/unstable/cluster/Entity.js +3 -3
  104. package/dist/unstable/cluster/Entity.js.map +1 -1
  105. package/dist/unstable/cluster/MessageStorage.js +1 -1
  106. package/dist/unstable/cluster/MessageStorage.js.map +1 -1
  107. package/dist/unstable/cluster/ShardingConfig.js +1 -1
  108. package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
  109. package/dist/unstable/eventlog/EventLogMessage.d.ts +4 -4
  110. package/dist/unstable/http/HttpBody.js +2 -2
  111. package/dist/unstable/http/HttpBody.js.map +1 -1
  112. package/dist/unstable/http/HttpClient.js +1 -1
  113. package/dist/unstable/http/HttpClient.js.map +1 -1
  114. package/dist/unstable/http/HttpClientRequest.js +2 -2
  115. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  116. package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
  117. package/dist/unstable/http/HttpMiddleware.js +18 -21
  118. package/dist/unstable/http/HttpMiddleware.js.map +1 -1
  119. package/dist/unstable/http/HttpPlatform.js +1 -1
  120. package/dist/unstable/http/HttpPlatform.js.map +1 -1
  121. package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
  122. package/dist/unstable/http/HttpRouter.js +4 -4
  123. package/dist/unstable/http/HttpRouter.js.map +1 -1
  124. package/dist/unstable/http/HttpServer.js +1 -1
  125. package/dist/unstable/http/HttpServer.js.map +1 -1
  126. package/dist/unstable/http/HttpServerRequest.js +11 -11
  127. package/dist/unstable/http/HttpServerRequest.js.map +1 -1
  128. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  129. package/dist/unstable/http/HttpServerResponse.js +5 -5
  130. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  131. package/dist/unstable/http/Multipart.js +1 -1
  132. package/dist/unstable/http/Multipart.js.map +1 -1
  133. package/dist/unstable/httpapi/HttpApiBuilder.js +3 -3
  134. package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
  135. package/dist/unstable/httpapi/HttpApiClient.js +1 -1
  136. package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
  137. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +2 -0
  138. package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
  139. package/dist/unstable/httpapi/HttpApiMiddleware.js +2 -1
  140. package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
  141. package/dist/unstable/httpapi/HttpApiTest.d.ts +3 -1
  142. package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
  143. package/dist/unstable/httpapi/HttpApiTest.js +2 -2
  144. package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
  145. package/dist/unstable/persistence/RateLimiter.js +1 -1
  146. package/dist/unstable/persistence/RateLimiter.js.map +1 -1
  147. package/dist/unstable/process/ChildProcess.d.ts +2 -45
  148. package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
  149. package/dist/unstable/process/ChildProcess.js +51 -7
  150. package/dist/unstable/process/ChildProcess.js.map +1 -1
  151. package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
  152. package/dist/unstable/reactivity/Atom.js +4 -4
  153. package/dist/unstable/reactivity/Atom.js.map +1 -1
  154. package/dist/unstable/rpc/RpcClient.js +1 -1
  155. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  156. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  157. package/dist/unstable/rpc/RpcServer.js +1 -1
  158. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  159. package/dist/unstable/rpc/RpcWorker.js +1 -1
  160. package/dist/unstable/rpc/RpcWorker.js.map +1 -1
  161. package/dist/unstable/socket/Socket.d.ts.map +1 -1
  162. package/dist/unstable/socket/Socket.js +1 -1
  163. package/dist/unstable/socket/Socket.js.map +1 -1
  164. package/dist/unstable/sql/Migrator.js +1 -1
  165. package/dist/unstable/sql/Migrator.js.map +1 -1
  166. package/dist/unstable/workflow/Activity.js +1 -1
  167. package/dist/unstable/workflow/Activity.js.map +1 -1
  168. package/dist/unstable/workflow/DurableQueue.d.ts +122 -0
  169. package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -0
  170. package/dist/unstable/workflow/DurableQueue.js +182 -0
  171. package/dist/unstable/workflow/DurableQueue.js.map +1 -0
  172. package/dist/unstable/workflow/Workflow.js +1 -1
  173. package/dist/unstable/workflow/Workflow.js.map +1 -1
  174. package/dist/unstable/workflow/index.d.ts +4 -0
  175. package/dist/unstable/workflow/index.d.ts.map +1 -1
  176. package/dist/unstable/workflow/index.js +4 -0
  177. package/dist/unstable/workflow/index.js.map +1 -1
  178. package/package.json +1 -1
  179. package/src/Cause.ts +4 -4
  180. package/src/Config.ts +8 -8
  181. package/src/Context.ts +13 -14
  182. package/src/DateTime.ts +2 -2
  183. package/src/Effect.ts +340 -431
  184. package/src/Effectable.ts +2 -2
  185. package/src/ExecutionPlan.ts +3 -4
  186. package/src/FiberHandle.ts +2 -2
  187. package/src/FiberMap.ts +2 -2
  188. package/src/FiberSet.ts +1 -1
  189. package/src/Layer.ts +1 -1
  190. package/src/LayerMap.ts +3 -4
  191. package/src/ManagedRuntime.ts +1 -1
  192. package/src/Option.ts +14 -7
  193. package/src/Result.ts +14 -3
  194. package/src/Schedule.ts +1 -1
  195. package/src/Schema.ts +26 -24
  196. package/src/SchemaGetter.ts +3 -3
  197. package/src/Stream.ts +4 -4
  198. package/src/TxRef.ts +1 -1
  199. package/src/internal/concurrency.ts +2 -2
  200. package/src/internal/core.ts +12 -23
  201. package/src/internal/effect.ts +25 -29
  202. package/src/internal/executionPlan.ts +2 -2
  203. package/src/internal/option.ts +5 -8
  204. package/src/internal/result.ts +5 -8
  205. package/src/unstable/ai/LanguageModel.ts +12 -19
  206. package/src/unstable/ai/McpServer.ts +2 -2
  207. package/src/unstable/ai/Model.ts +15 -12
  208. package/src/unstable/ai/Toolkit.ts +30 -38
  209. package/src/unstable/cli/Command.ts +32 -13
  210. package/src/unstable/cli/GlobalFlag.ts +1 -1
  211. package/src/unstable/cli/Param.ts +1 -1
  212. package/src/unstable/cli/Prompt.ts +9 -13
  213. package/src/unstable/cli/internal/command.ts +12 -14
  214. package/src/unstable/cluster/ClusterWorkflowEngine.ts +1 -1
  215. package/src/unstable/cluster/Entity.ts +3 -3
  216. package/src/unstable/cluster/MessageStorage.ts +1 -1
  217. package/src/unstable/cluster/ShardingConfig.ts +1 -1
  218. package/src/unstable/http/HttpBody.ts +2 -2
  219. package/src/unstable/http/HttpClient.ts +1 -1
  220. package/src/unstable/http/HttpClientRequest.ts +2 -2
  221. package/src/unstable/http/HttpMiddleware.ts +4 -5
  222. package/src/unstable/http/HttpPlatform.ts +1 -1
  223. package/src/unstable/http/HttpRouter.ts +4 -5
  224. package/src/unstable/http/HttpServer.ts +1 -1
  225. package/src/unstable/http/HttpServerRequest.ts +11 -11
  226. package/src/unstable/http/HttpServerResponse.ts +5 -5
  227. package/src/unstable/http/Multipart.ts +1 -1
  228. package/src/unstable/httpapi/HttpApiBuilder.ts +4 -4
  229. package/src/unstable/httpapi/HttpApiClient.ts +1 -1
  230. package/src/unstable/httpapi/HttpApiMiddleware.ts +2 -1
  231. package/src/unstable/httpapi/HttpApiTest.ts +5 -2
  232. package/src/unstable/persistence/RateLimiter.ts +1 -1
  233. package/src/unstable/process/ChildProcess.ts +11 -14
  234. package/src/unstable/reactivity/Atom.ts +4 -4
  235. package/src/unstable/rpc/RpcClient.ts +1 -1
  236. package/src/unstable/rpc/RpcServer.ts +1 -2
  237. package/src/unstable/rpc/RpcWorker.ts +2 -2
  238. package/src/unstable/socket/Socket.ts +1 -1
  239. package/src/unstable/sql/Migrator.ts +1 -1
  240. package/src/unstable/workflow/Activity.ts +1 -1
  241. package/src/unstable/workflow/DurableQueue.ts +343 -0
  242. package/src/unstable/workflow/Workflow.ts +1 -1
  243. package/src/unstable/workflow/index.ts +5 -0
package/src/Effectable.ts CHANGED
@@ -30,7 +30,7 @@ const Base: new<A, E, R>() => Effect.Effect<A, E, R> = (() => {
30
30
  Base.prototype = Prototype({
31
31
  label: "Effectable",
32
32
  evaluate(_) {
33
- return this.asEffect()
33
+ return this
34
34
  }
35
35
  })
36
36
  return Base as any
@@ -43,5 +43,5 @@ const Base: new<A, E, R>() => Effect.Effect<A, E, R> = (() => {
43
43
  * @category Constructors
44
44
  */
45
45
  export abstract class Class<A, E = never, R = never> extends Base<A, E, R> {
46
- abstract override asEffect(): Effect.Effect<A, E, R>
46
+ abstract override: Effect.Effect<A, E, R>
47
47
  }
@@ -94,10 +94,9 @@ export interface ExecutionPlan<
94
94
  }>
95
95
 
96
96
  /**
97
- * Returns an equivalent `ExecutionPlan` with the requirements satisfied,
98
- * using the current context.
97
+ * Returns an equivalent `ExecutionPlan` with the requirements satisfied, using the current context.
99
98
  */
100
- readonly withRequirements: Effect.Effect<
99
+ readonly captureRequirements: Effect.Effect<
101
100
  ExecutionPlan<{
102
101
  provides: Config["provides"]
103
102
  input: Config["input"]
@@ -256,7 +255,7 @@ export declare namespace make {
256
255
 
257
256
  const Proto: Omit<ExecutionPlan<any>, "steps"> = {
258
257
  [TypeId]: TypeId,
259
- get withRequirements() {
258
+ get captureRequirements() {
260
259
  const self = this as any as ExecutionPlan<any>
261
260
  return effect.contextWith((context: Context.Context<any>) =>
262
261
  effect.succeed(makeProto(self.steps.map((step) => ({
@@ -705,10 +705,10 @@ const runImpl = <A, E, R, XE extends E, XA extends A>(
705
705
  * const run = yield* FiberHandle.runtime(handle)<Users>()
706
706
  *
707
707
  * // run an effect and set the fiber in the handle
708
- * run(Effect.andThen(Users.asEffect(), (_) => _.getAll))
708
+ * run(Effect.andThen(Users, (_) => _.getAll))
709
709
  *
710
710
  * // this will interrupt the previous fiber
711
- * run(Effect.andThen(Users.asEffect(), (_) => _.getAll))
711
+ * run(Effect.andThen(Users, (_) => _.getAll))
712
712
  * }).pipe(
713
713
  * Effect.scoped // The fiber will be interrupted when the scope is closed
714
714
  * )
package/src/FiberMap.ts CHANGED
@@ -1171,8 +1171,8 @@ const runImpl = <K, A, E, R, XE extends E, XA extends A>(
1171
1171
  * const run = yield* FiberMap.runtime(map)<Users>()
1172
1172
  *
1173
1173
  * // run some effects and add the fibers to the map
1174
- * run("effect-a", Effect.andThen(Users.asEffect(), (_) => _.getAll))
1175
- * run("effect-b", Effect.andThen(Users.asEffect(), (_) => _.getAll))
1174
+ * run("effect-a", Effect.andThen(Users, (_) => _.getAll))
1175
+ * run("effect-b", Effect.andThen(Users, (_) => _.getAll))
1176
1176
  * }).pipe(
1177
1177
  * Effect.scoped // The fibers will be interrupted when the scope is closed
1178
1178
  * )
package/src/FiberSet.ts CHANGED
@@ -612,7 +612,7 @@ const runImpl = <A, E, R, XE extends E, XA extends A>(
612
612
  * const run = yield* FiberSet.runtime(set)<Users>()
613
613
  *
614
614
  * // run some effects and add the fibers to the set
615
- * run(Effect.andThen(Users.asEffect(), (_) => _.getAll))
615
+ * run(Effect.andThen(Users, (_) => _.getAll))
616
616
  * }).pipe(
617
617
  * Effect.scoped // The fibers will be interrupted when the scope is closed
618
618
  * )
package/src/Layer.ts CHANGED
@@ -3077,7 +3077,7 @@ export const updateService: {
3077
3077
  layer: Layer<A1, E1, R1>,
3078
3078
  service: Context.Key<I, A>,
3079
3079
  f: (a: Types.NoInfer<A>) => A
3080
- ): Layer<A1, E1, I | R1> => provide(layer, effect(service, internalEffect.map(service.asEffect(), f)))
3080
+ ): Layer<A1, E1, I | R1> => provide(layer, effect(service, internalEffect.map(service, f)))
3081
3081
  )
3082
3082
 
3083
3083
  /**
package/src/LayerMap.ts CHANGED
@@ -365,10 +365,9 @@ export const Service = <Self>() =>
365
365
  Layer.provide(TagClass_.layerNoDeps, options.dependencies as any) :
366
366
  TagClass_.layerNoDeps
367
367
 
368
- TagClass_.get = (key: string) => Layer.unwrap(Effect.map(TagClass_.asEffect(), (layerMap) => layerMap.get(key)))
369
- TagClass_.contextEffect = (key: string) =>
370
- Effect.flatMap(TagClass_.asEffect(), (layerMap) => layerMap.contextEffect(key))
371
- TagClass_.invalidate = (key: string) => Effect.flatMap(TagClass_.asEffect(), (layerMap) => layerMap.invalidate(key))
368
+ TagClass_.get = (key: string) => Layer.unwrap(Effect.map(TagClass_, (layerMap) => layerMap.get(key)))
369
+ TagClass_.contextEffect = (key: string) => Effect.flatMap(TagClass_, (layerMap) => layerMap.contextEffect(key))
370
+ TagClass_.invalidate = (key: string) => Effect.flatMap(TagClass_, (layerMap) => layerMap.invalidate(key))
372
371
 
373
372
  return TagClass as any
374
373
  }
@@ -148,7 +148,7 @@ export interface ManagedRuntime<in R, out ER> {
148
148
  * async function main() {
149
149
  * const runtime = ManagedRuntime.make(Notifications.layer)
150
150
  * await runtime.runPromise(Effect.flatMap(
151
- * Notifications.asEffect(),
151
+ * Notifications,
152
152
  * (_) => _.notify("Hello, world!")
153
153
  * ))
154
154
  * await runtime.dispose()
package/src/Option.ts CHANGED
@@ -72,9 +72,7 @@
72
72
  * @since 2.0.0
73
73
  * @module
74
74
  */
75
- import type { NoSuchElementError } from "./Cause.ts"
76
75
  import * as Combiner from "./Combiner.ts"
77
- import type { EffectIterator, Yieldable } from "./Effect.ts"
78
76
  import * as Equal from "./Equal.ts"
79
77
  import * as Equivalence from "./Equivalence.ts"
80
78
  import type * as Filter from "./Filter.ts"
@@ -144,7 +142,6 @@ export type Option<A> = None<A> | Some<A>
144
142
  * **Behavior**
145
143
  *
146
144
  * - `_tag` is always `"None"`
147
- * - Yieldable in `Effect.gen` — yields `NoSuchElementError`
148
145
  * - Implements `Pipeable`, `Inspectable`, and structural equality
149
146
  *
150
147
  * @see {@link isNone} to check if an `Option` is `None`
@@ -153,18 +150,29 @@ export type Option<A> = None<A> | Some<A>
153
150
  * @category Models
154
151
  * @since 2.0.0
155
152
  */
156
- export interface None<out A> extends Pipeable, Inspectable, Yieldable<Option<A>, A, NoSuchElementError> {
153
+ export interface None<out A> extends Pipeable, Inspectable {
157
154
  readonly _tag: "None"
158
155
  readonly _op: "None"
159
156
  readonly valueOrUndefined: undefined
160
157
  readonly [TypeId]: {
161
158
  readonly _A: Covariant<A>
162
159
  }
160
+ [Symbol.iterator](): OptionIterator<Option<A>>
163
161
  [Unify.typeSymbol]?: unknown
164
162
  [Unify.unifySymbol]?: OptionUnify<this>
165
163
  [Unify.ignoreSymbol]?: OptionUnifyIgnore
166
164
  }
167
165
 
166
+ /**
167
+ * @since 4.0.0
168
+ * @category Models
169
+ */
170
+ export interface OptionIterator<T extends Option<any>> {
171
+ next(
172
+ ...args: ReadonlyArray<any>
173
+ ): IteratorResult<T, Option.Value<T>>
174
+ }
175
+
168
176
  /**
169
177
  * Represents the presence of a value within an {@link Option}.
170
178
  *
@@ -177,7 +185,6 @@ export interface None<out A> extends Pipeable, Inspectable, Yieldable<Option<A>,
177
185
  *
178
186
  * - `_tag` is always `"Some"`
179
187
  * - `.value` holds the contained value of type `A`
180
- * - Yieldable in `Effect.gen` — yields the inner value
181
188
  * - Implements `Pipeable`, `Inspectable`, and structural equality
182
189
  *
183
190
  * @see {@link isSome} to check if an `Option` is `Some`
@@ -186,7 +193,7 @@ export interface None<out A> extends Pipeable, Inspectable, Yieldable<Option<A>,
186
193
  * @category Models
187
194
  * @since 2.0.0
188
195
  */
189
- export interface Some<out A> extends Pipeable, Inspectable, Yieldable<Option<A>, A, NoSuchElementError> {
196
+ export interface Some<out A> extends Pipeable, Inspectable {
190
197
  readonly _tag: "Some"
191
198
  readonly _op: "Some"
192
199
  readonly value: A
@@ -194,7 +201,7 @@ export interface Some<out A> extends Pipeable, Inspectable, Yieldable<Option<A>,
194
201
  readonly [TypeId]: {
195
202
  readonly _A: Covariant<A>
196
203
  }
197
- [Symbol.iterator](): EffectIterator<Option<A>>
204
+ [Symbol.iterator](): OptionIterator<Option<A>>
198
205
  [Unify.typeSymbol]?: unknown
199
206
  [Unify.unifySymbol]?: OptionUnify<this>
200
207
  [Unify.ignoreSymbol]?: OptionUnifyIgnore
package/src/Result.ts CHANGED
@@ -68,7 +68,6 @@
68
68
  * @since 4.0.0
69
69
  */
70
70
 
71
- import type { Yieldable } from "./Effect.ts"
72
71
  import * as Equivalence from "./Equivalence.ts"
73
72
  import type { LazyArg } from "./Function.ts"
74
73
  import { constNull, constUndefined, dual, identity } from "./Function.ts"
@@ -154,7 +153,7 @@ export type Result<A, E = never> = Success<A, E> | Failure<A, E>
154
153
  * @category Models
155
154
  * @since 4.0.0
156
155
  */
157
- export interface Failure<out A, out E> extends Pipeable, Inspectable, Yieldable<Result<A, E>, A, E> {
156
+ export interface Failure<out A, out E> extends Pipeable, Inspectable {
158
157
  readonly _tag: "Failure"
159
158
  readonly _op: "Failure"
160
159
  readonly failure: E
@@ -162,11 +161,22 @@ export interface Failure<out A, out E> extends Pipeable, Inspectable, Yieldable<
162
161
  readonly _A: Covariant<E>
163
162
  readonly _E: Covariant<A>
164
163
  }
164
+ [Symbol.iterator](): ResultIterator<Result<A, E>>
165
165
  [Unify.typeSymbol]?: unknown
166
166
  [Unify.unifySymbol]?: ResultUnify<this>
167
167
  [Unify.ignoreSymbol]?: ResultUnifyIgnore
168
168
  }
169
169
 
170
+ /**
171
+ * @since 4.0.0
172
+ * @category Models
173
+ */
174
+ export interface ResultIterator<T extends Result<any, any>> {
175
+ next(
176
+ ...args: ReadonlyArray<any>
177
+ ): IteratorResult<T, Result.Success<T>>
178
+ }
179
+
170
180
  /**
171
181
  * The success variant of {@link Result}. Wraps a value of type `A`.
172
182
  *
@@ -194,7 +204,7 @@ export interface Failure<out A, out E> extends Pipeable, Inspectable, Yieldable<
194
204
  * @category Models
195
205
  * @since 4.0.0
196
206
  */
197
- export interface Success<out A, out E> extends Pipeable, Inspectable, Yieldable<Result<A, E>, A, E> {
207
+ export interface Success<out A, out E> extends Pipeable, Inspectable {
198
208
  readonly _tag: "Success"
199
209
  readonly _op: "Success"
200
210
  readonly success: A
@@ -202,6 +212,7 @@ export interface Success<out A, out E> extends Pipeable, Inspectable, Yieldable<
202
212
  readonly _A: Covariant<E>
203
213
  readonly _E: Covariant<A>
204
214
  }
215
+ [Symbol.iterator](): ResultIterator<Result<A, E>>
205
216
  [Unify.typeSymbol]?: unknown
206
217
  [Unify.unifySymbol]?: ResultUnify<this>
207
218
  [Unify.ignoreSymbol]?: ResultUnifyIgnore
package/src/Schedule.ts CHANGED
@@ -2734,7 +2734,7 @@ export const cron: {
2734
2734
  (expression: string, tz?: string | DateTime.TimeZone): Schedule<Duration.Duration, unknown, Cron.CronParseError>
2735
2735
  } = (expression: string | Cron.Cron, tz?: string | DateTime.TimeZone) => {
2736
2736
  const parsed = Cron.isCron(expression) ? Result.succeed(expression) : Cron.parse(expression, tz)
2737
- return fromStep(effect.map(parsed.asEffect(), (cron) => (now, _) =>
2737
+ return fromStep(effect.map(effect.fromResult(parsed), (cron) => (now, _) =>
2738
2738
  effect.sync(() => {
2739
2739
  const next = Cron.next(cron, now).getTime()
2740
2740
  const duration = Duration.millis(next - now)
package/src/Schema.ts CHANGED
@@ -2298,10 +2298,10 @@ export declare namespace Struct {
2298
2298
  O extends keyof F = TypeOptionalKeys<F>,
2299
2299
  M extends keyof F = TypeMutableKeys<F>
2300
2300
  > =
2301
- & { readonly [K in Exclude<keyof F, M | O>]: F[K]["Type"] }
2302
- & { readonly [K in Exclude<O, M>]?: F[K]["Type"] }
2303
- & { [K in Exclude<M, O>]: F[K]["Type"] }
2304
- & { [K in M & O]?: F[K]["Type"] }
2301
+ & { readonly [K in keyof F as K extends M | O ? never : K]: F[K]["Type"] }
2302
+ & { readonly [K in keyof F as K extends O ? K extends M ? never : K : never]?: F[K]["Type"] }
2303
+ & { -readonly [K in keyof F as K extends M ? K extends O ? never : K : never]: F[K]["Type"] }
2304
+ & { -readonly [K in keyof F as K extends M & O ? K : never]?: F[K]["Type"] }
2305
2305
 
2306
2306
  /**
2307
2307
  * @since 4.0.0
@@ -2313,10 +2313,10 @@ export declare namespace Struct {
2313
2313
  O extends keyof F = TypeOptionalKeys<F>,
2314
2314
  M extends keyof F = TypeMutableKeys<F>
2315
2315
  > =
2316
- & { readonly [K in Exclude<keyof F, M | O>]: F[K]["Iso"] }
2317
- & { readonly [K in Exclude<O, M>]?: F[K]["Iso"] }
2318
- & { [K in Exclude<M, O>]: F[K]["Iso"] }
2319
- & { [K in M & O]?: F[K]["Iso"] }
2316
+ & { readonly [K in keyof F as K extends M | O ? never : K]: F[K]["Iso"] }
2317
+ & { readonly [K in keyof F as K extends O ? K extends M ? never : K : never]?: F[K]["Iso"] }
2318
+ & { -readonly [K in keyof F as K extends M ? K extends O ? never : K : never]: F[K]["Iso"] }
2319
+ & { -readonly [K in keyof F as K extends M & O ? K : never]?: F[K]["Iso"] }
2320
2320
 
2321
2321
  /**
2322
2322
  * @since 4.0.0
@@ -2338,10 +2338,10 @@ export declare namespace Struct {
2338
2338
  O extends keyof F = EncodedOptionalKeys<F>,
2339
2339
  M extends keyof F = EncodedMutableKeys<F>
2340
2340
  > =
2341
- & { readonly [K in Exclude<keyof F, M | O>]: F[K]["Encoded"] }
2342
- & { readonly [K in Exclude<O, M>]?: F[K]["Encoded"] }
2343
- & { [K in Exclude<M, O>]: F[K]["Encoded"] }
2344
- & { [K in M & O]?: F[K]["Encoded"] }
2341
+ & { readonly [K in keyof F as K extends M | O ? never : K]: F[K]["Encoded"] }
2342
+ & { readonly [K in keyof F as K extends O ? K extends M ? never : K : never]?: F[K]["Encoded"] }
2343
+ & { -readonly [K in keyof F as K extends M ? K extends O ? never : K : never]: F[K]["Encoded"] }
2344
+ & { -readonly [K in keyof F as K extends M & O ? K : never]?: F[K]["Encoded"] }
2345
2345
 
2346
2346
  /**
2347
2347
  * @since 4.0.0
@@ -10942,13 +10942,14 @@ export const TaggedClass: {
10942
10942
  schema: Struct.Fields | Struct<Struct.Fields>,
10943
10943
  annotations?: Annotations.Declaration<any, readonly [Struct<Struct.Fields>]>
10944
10944
  ): any => {
10945
+ const struct = isStruct(schema) ?
10946
+ schema.mapFields((fields) => ({ _tag: tag(tagValue), ...fields }), {
10947
+ unsafePreserveChecks: true
10948
+ }) :
10949
+ TaggedStruct(tagValue, schema)
10945
10950
  return Class<any, {}>(identifier ?? tagValue)(
10946
- isStruct(schema) ?
10947
- schema.mapFields((fields) => ({ _tag: tag(tagValue), ...fields }), {
10948
- unsafePreserveChecks: true
10949
- }) :
10950
- TaggedStruct(tagValue, schema),
10951
- annotations
10951
+ struct,
10952
+ annotations as Annotations.Declaration<any, readonly [typeof struct]>
10952
10953
  )
10953
10954
  }
10954
10955
  }
@@ -11186,13 +11187,14 @@ export const TaggedErrorClass: {
11186
11187
  schema: Struct.Fields | Struct<Struct.Fields>,
11187
11188
  annotations?: Annotations.Declaration<any, readonly [Struct<Struct.Fields>]>
11188
11189
  ): any => {
11190
+ const struct = isStruct(schema) ?
11191
+ schema.mapFields((fields) => ({ _tag: tag(tagValue), ...fields }), {
11192
+ unsafePreserveChecks: true
11193
+ }) :
11194
+ TaggedStruct(tagValue, schema)
11189
11195
  return ErrorClass<any, {}>(identifier ?? tagValue)(
11190
- isStruct(schema) ?
11191
- schema.mapFields((fields) => ({ _tag: tag(tagValue), ...fields }), {
11192
- unsafePreserveChecks: true
11193
- }) :
11194
- TaggedStruct(tagValue, schema),
11195
- annotations
11196
+ struct,
11197
+ annotations as Annotations.Declaration<any, readonly [typeof struct]>
11196
11198
  )
11197
11199
  }
11198
11200
  }
@@ -1291,10 +1291,10 @@ export function encodeHex<E extends Uint8Array | string>(): Getter<string, E> {
1291
1291
  */
1292
1292
  export function decodeBase64<E extends string>(): Getter<Uint8Array, E> {
1293
1293
  return transformOrFail((input) =>
1294
- Result.mapError(
1295
- Encoding.decodeBase64(input),
1294
+ Effect.mapErrorEager(
1295
+ Effect.fromResult(Encoding.decodeBase64(input)),
1296
1296
  (e) => new Issue.InvalidValue(Option.some(input), { message: e.message })
1297
- ).asEffect()
1297
+ )
1298
1298
  )
1299
1299
  }
1300
1300
 
package/src/Stream.ts CHANGED
@@ -9172,7 +9172,7 @@ export const retry: {
9172
9172
  * { provide: Service.Good }
9173
9173
  * )
9174
9174
  *
9175
- * const stream = Stream.unwrap(Effect.map(Service.asEffect(), (_) => _.stream))
9175
+ * const stream = Stream.unwrap(Effect.map(Service, (_) => _.stream))
9176
9176
  *
9177
9177
  * const program = Effect.gen(function*() {
9178
9178
  * const items = yield* stream.pipe(Stream.withExecutionPlan(plan), Stream.runCollect)
@@ -9214,7 +9214,7 @@ export const withExecutionPlan: {
9214
9214
  * { provide: Service.Good }
9215
9215
  * )
9216
9216
  *
9217
- * const stream = Stream.unwrap(Effect.map(Service.asEffect(), (_) => _.stream))
9217
+ * const stream = Stream.unwrap(Effect.map(Service, (_) => _.stream))
9218
9218
  *
9219
9219
  * const program = Effect.gen(function*() {
9220
9220
  * const items = yield* stream.pipe(Stream.withExecutionPlan(plan), Stream.runCollect)
@@ -9259,7 +9259,7 @@ export const withExecutionPlan: {
9259
9259
  * { provide: Service.Good }
9260
9260
  * )
9261
9261
  *
9262
- * const stream = Stream.unwrap(Effect.map(Service.asEffect(), (_) => _.stream))
9262
+ * const stream = Stream.unwrap(Effect.map(Service, (_) => _.stream))
9263
9263
  *
9264
9264
  * const program = Effect.gen(function*() {
9265
9265
  * const items = yield* stream.pipe(Stream.withExecutionPlan(plan), Stream.runCollect)
@@ -9334,7 +9334,7 @@ export const withExecutionPlan: {
9334
9334
  * { provide: Service.Good }
9335
9335
  * )
9336
9336
  *
9337
- * const stream = Stream.unwrap(Effect.map(Service.asEffect(), (_) => _.stream))
9337
+ * const stream = Stream.unwrap(Effect.map(Service, (_) => _.stream))
9338
9338
  *
9339
9339
  * const program = Effect.gen(function*() {
9340
9340
  * const items = yield* stream.pipe(Stream.withExecutionPlan(plan), Stream.runCollect)
package/src/TxRef.ts CHANGED
@@ -175,7 +175,7 @@ export const modify: {
175
175
  self: TxRef<A>,
176
176
  f: (current: A) => [returnValue: R, newValue: A]
177
177
  ): Effect.Effect<R> =>
178
- Effect.Transaction.asEffect().pipe(
178
+ Effect.Transaction.pipe(
179
179
  Effect.flatMap((state) =>
180
180
  Effect.sync(() => {
181
181
  if (!state.journal.has(self)) {
@@ -16,7 +16,7 @@ export const match = <A, E, R>(
16
16
  case "unbounded":
17
17
  return unbounded()
18
18
  case "inherit":
19
- return effect.flatMap(CurrentConcurrency.asEffect(), (concurrency) =>
19
+ return effect.flatMap(CurrentConcurrency, (concurrency) =>
20
20
  concurrency === "unbounded"
21
21
  ? unbounded()
22
22
  : concurrency > 1
@@ -40,7 +40,7 @@ export const matchSimple = <A, E, R>(
40
40
  return concurrent()
41
41
  case "inherit":
42
42
  return effect.flatMap(
43
- CurrentConcurrency.asEffect(),
43
+ CurrentConcurrency,
44
44
  (concurrency) =>
45
45
  concurrency === "unbounded" || concurrency > 1
46
46
  ? concurrent()
@@ -95,21 +95,6 @@ export const StructuralProto = {
95
95
  }
96
96
  }
97
97
 
98
- /** @internal */
99
- export const YieldableProto = {
100
- [Symbol.iterator]() {
101
- return new SingleShotGen(this) as any
102
- }
103
- }
104
-
105
- /** @internal */
106
- export const YieldableErrorProto = {
107
- ...YieldableProto,
108
- pipe() {
109
- return pipeArguments(this, arguments)
110
- }
111
- }
112
-
113
98
  /** @internal */
114
99
  export const EffectProto = {
115
100
  [EffectTypeId]: effectVariance,
@@ -117,9 +102,6 @@ export const EffectProto = {
117
102
  [Symbol.iterator]() {
118
103
  return new SingleShotGen(this) as any
119
104
  },
120
- asEffect(): any {
121
- return this
122
- },
123
105
  toJSON(this: Primitive) {
124
106
  return {
125
107
  _id: "Effect",
@@ -584,12 +566,18 @@ export const YieldableError: new(
584
566
  message?: string,
585
567
  options?: ErrorOptions
586
568
  ) => Cause.YieldableError = (function() {
587
- class YieldableError extends globalThis.Error {
588
- asEffect() {
569
+ class YieldableError extends globalThis.Error {}
570
+ const proto = makePrimitiveProto({
571
+ op: "YieldableError",
572
+ [evaluate]() {
589
573
  return exitFail(this)
590
574
  }
591
- }
592
- Object.assign(YieldableError.prototype, YieldableErrorProto)
575
+ })
576
+ delete (proto as any).toString
577
+ Object.assign(
578
+ YieldableError.prototype,
579
+ proto
580
+ )
593
581
  return YieldableError as any
594
582
  })()
595
583
 
@@ -603,13 +591,14 @@ export const Error: new<A extends Record<string, any> = {}>(
603
591
  super(args?.message, args?.cause ? { cause: args.cause } : undefined)
604
592
  if (args) {
605
593
  Object.assign(this, args)
594
+ // @effect-diagnostics-next-line floatingEffect:off
606
595
  Object.defineProperty(this, plainArgsSymbol, {
607
596
  value: args,
608
597
  enumerable: false
609
598
  })
610
599
  }
611
600
  }
612
- toJSON() {
601
+ override toJSON() {
613
602
  return { ...(this as any)[plainArgsSymbol], ...this }
614
603
  }
615
604
  } as any
@@ -892,15 +892,16 @@ export const suspend: <A, E, R>(
892
892
  })
893
893
 
894
894
  /** @internal */
895
- export const fromYieldable = <Self extends Effect.Yieldable.Any, A, E, R>(
896
- yieldable: Effect.Yieldable<Self, A, E, R>
897
- ): Effect.Effect<A, E, R> => yieldable.asEffect()
898
-
899
- /** @internal */
900
- export const fromOption: <A>(option: Option.Option<A>) => Effect.Effect<A, Cause.NoSuchElementError> = fromYieldable
895
+ export const fromOption: <A>(option: Option.Option<A>) => Effect.Effect<A, Cause.NoSuchElementError> = Option.match({
896
+ onNone: () => fail(new NoSuchElementError("Effect.fromOption: Option.none")),
897
+ onSome: succeed
898
+ })
901
899
 
902
900
  /** @internal */
903
- export const fromResult: <A, E>(result: Result.Result<A, E>) => Effect.Effect<A, E> = fromYieldable
901
+ export const fromResult: <A, E>(result: Result.Result<A, E>) => Effect.Effect<A, E> = Result.match({
902
+ onFailure: fail,
903
+ onSuccess: succeed
904
+ })
904
905
 
905
906
  /** @internal */
906
907
  export const fromNullishOr = <A>(value: A): Effect.Effect<NonNullable<A>, Cause.NoSuchElementError> =>
@@ -1083,7 +1084,7 @@ export const never: Effect.Effect<never> = callback<never>(constVoid)
1083
1084
  /** @internal */
1084
1085
  export const gen = <
1085
1086
  Self,
1086
- Eff extends Effect.Yieldable<any, any, any, any>,
1087
+ Eff extends Effect.Effect<any, any, any>,
1087
1088
  AEff
1088
1089
  >(
1089
1090
  ...args:
@@ -1092,10 +1093,10 @@ export const gen = <
1092
1093
  ): Effect.Effect<
1093
1094
  AEff,
1094
1095
  [Eff] extends [never] ? never
1095
- : [Eff] extends [Effect.Yieldable<infer _A, infer E, infer _R>] ? E
1096
+ : [Eff] extends [Effect.Effect<infer _A, infer E, infer _R>] ? E
1096
1097
  : never,
1097
1098
  [Eff] extends [never] ? never
1098
- : [Eff] extends [Effect.Yieldable<infer _A, infer _E, infer R>] ? R
1099
+ : [Eff] extends [Effect.Effect<infer _A, infer _E, infer R>] ? R
1099
1100
  : never
1100
1101
  > =>
1101
1102
  suspend(() =>
@@ -1223,7 +1224,7 @@ export const fnUntracedEager: Effect.fn.Untraced = (
1223
1224
  )
1224
1225
 
1225
1226
  const fromIteratorEagerUnsafe = (
1226
- evaluate: () => Iterator<Effect.Yieldable<any, any, any, any>>
1227
+ evaluate: () => Iterator<Effect.Effect<any, any, any>>
1227
1228
  ): Effect.Effect<any, any, any> => {
1228
1229
  try {
1229
1230
  const iterator = evaluate()
@@ -1237,22 +1238,20 @@ const fromIteratorEagerUnsafe = (
1237
1238
  return succeed(state.value)
1238
1239
  }
1239
1240
 
1240
- const yieldable = state.value
1241
- const effect = yieldable.asEffect()
1242
- const primitive = effect as any
1241
+ const primitive = state.value as any
1243
1242
 
1244
1243
  if (primitive && primitive._tag === "Success") {
1245
1244
  value = primitive.value
1246
1245
  continue
1247
1246
  } else if (primitive && primitive._tag === "Failure") {
1248
- return effect
1247
+ return state.value
1249
1248
  } else {
1250
1249
  let isFirstExecution = true
1251
1250
 
1252
1251
  return suspend(() => {
1253
1252
  if (isFirstExecution) {
1254
1253
  isFirstExecution = false
1255
- return flatMap(effect, (value) => fromIteratorUnsafe(iterator, value))
1254
+ return flatMap(state.value, (value) => fromIteratorUnsafe(iterator, value))
1256
1255
  } else {
1257
1256
  return suspend(() => fromIteratorUnsafe(evaluate()))
1258
1257
  }
@@ -1265,7 +1264,7 @@ const fromIteratorEagerUnsafe = (
1265
1264
  }
1266
1265
 
1267
1266
  const fromIteratorUnsafe: (
1268
- iterator: Iterator<Effect.Yieldable<any, any, any, any>>,
1267
+ iterator: Iterator<Effect.Effect<any, any, any>>,
1269
1268
  initial?: undefined
1270
1269
  ) => Effect.Effect<any, any, any> = makePrimitive({
1271
1270
  op: "Iterator",
@@ -1275,14 +1274,13 @@ const fromIteratorUnsafe: (
1275
1274
  while (true) {
1276
1275
  const state = iter.next(value)
1277
1276
  if (state.done) return succeed(state.value)
1278
- const eff = state.value.asEffect()
1279
- if (!effectIsExit(eff)) {
1277
+ if (!effectIsExit(state.value)) {
1280
1278
  fiber._stack.push(this)
1281
- return eff
1282
- } else if (eff._tag === "Failure") {
1283
- return eff
1279
+ return state.value
1280
+ } else if (state.value._tag === "Failure") {
1281
+ return state.value
1284
1282
  }
1285
- value = eff.value
1283
+ value = state.value.value
1286
1284
  }
1287
1285
  },
1288
1286
  [evaluate](this: any, fiber: FiberImpl) {
@@ -1968,9 +1966,7 @@ export const exitFindErrorOption = <A, E>(self: Exit.Exit<A, E>): Option.Option<
1968
1966
  // ----------------------------------------------------------------------------
1969
1967
 
1970
1968
  /** @internal */
1971
- export const service: {
1972
- <I, S>(service: Context.Key<I, S>): Effect.Effect<S, never, I>
1973
- } = fromYieldable as any
1969
+ export const service = <I, S>(service: Context.Key<I, S>): Effect.Effect<S, never, I> => service
1974
1970
 
1975
1971
  /** @internal */
1976
1972
  export const serviceOption = <I, S>(
@@ -3767,7 +3763,7 @@ export const scopeMake = (finalizerStrategy?: "sequential" | "parallel"): Effect
3767
3763
  sync(() => scopeMakeUnsafe(finalizerStrategy))
3768
3764
 
3769
3765
  /** @internal */
3770
- export const scope: Effect.Effect<Scope.Scope, never, Scope.Scope> = scopeTag.asEffect()
3766
+ export const scope: Effect.Effect<Scope.Scope, never, Scope.Scope> = scopeTag
3771
3767
 
3772
3768
  /** @internal */
3773
3769
  export const provideScope: {
@@ -5570,10 +5566,10 @@ const provideSpanStackFrame = (name: string, stack: (() => string | undefined) |
5570
5566
  }
5571
5567
 
5572
5568
  /** @internal */
5573
- export const spanAnnotations: Effect.Effect<Readonly<Record<string, unknown>>> = TracerSpanAnnotations.asEffect()
5569
+ export const spanAnnotations: Effect.Effect<Readonly<Record<string, unknown>>> = TracerSpanAnnotations
5574
5570
 
5575
5571
  /** @internal */
5576
- export const spanLinks: Effect.Effect<ReadonlyArray<Tracer.SpanLink>> = TracerSpanLinks.asEffect()
5572
+ export const spanLinks: Effect.Effect<ReadonlyArray<Tracer.SpanLink>> = TracerSpanLinks
5577
5573
 
5578
5574
  /** @internal */
5579
5575
  export const linkSpans: {
@@ -73,7 +73,7 @@ export const withExecutionPlan: {
73
73
  nextEffect = effect.suspend(() => {
74
74
  if (attempted) return wrapped
75
75
  attempted = true
76
- return result!.asEffect()
76
+ return effect.fromResult(result!)
77
77
  })
78
78
  nextEffect = internalSchedule.retry(nextEffect, scheduleFromStep(step, false)!)
79
79
  } else {
@@ -87,7 +87,7 @@ export const withExecutionPlan: {
87
87
  i++
88
88
  }
89
89
  }),
90
- () => result!.asEffect()
90
+ () => effect.fromResult(result!)
91
91
  )
92
92
  }))
93
93