DX improvement: Support `yield*` in even more places: Fibers, Deferreds, ...
What is the problem this feature would solve?
Using the Effect generator syntax is really nice as some data types are "yieldable" however even more data types could be yieldable.
What is the feature you are proposing to solve the problem?
DX improvement: Support yield* in even more places: Fibers, Deferreds, ...
What alternatives have you considered?
No response
clarification: make Fiber, Ref, Deferred, etc subtypes of Effect
@mikearnaldi , What subtype should Fiber be?
| semantics | ||
|---|---|---|
Fiber<A, E> |
Effect<A, E> |
Fiber.join |
Fiber<A, E> |
Effect<Exit<A, E>> |
Fiber.await |
// Fiber.join semantic
const value = yield* joinFiber
// Fiber.await
const exit = yield* awaitFiber
const value = yield* exit
the first case can be expressed by the second one , but not vice versa
@mikearnaldi , What subtype should
Fiberbe?semantics
Fiber<A, E>Effect<A, E>Fiber.joinFiber<A, E>Effect<Exit<A, E>>Fiber.await// Fiber.join semantic const value = yield* joinFiber // Fiber.await const exit = yield* awaitFiber const value = yield* exitthe first case can be expressed by the second one , but not vice versa
they are semantically different, joining also merges fiber references while awaiting doesn't. I think along the lines of the rest I'd expect join to be the semantic of yielding
Are there any other entities that can be affected? Resource, Pool, PubSub? or is there no need for it yet?