Merge commit '36c66dd290d3ce6eb1ccd310d0c658d4a32bb8eb' as 'repos/effect'

This commit is contained in:
-Puter
2026-07-19 03:25:10 +05:30
parent dd1071cc10
commit 2daf979036
2214 changed files with 673090 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
# Scope
## `Scope.extend` → `Scope.provide`
`Scope.extend` has been renamed to `Scope.provide` in v4. The behavior is
identical: it provides a `Scope` to an effect that requires one, removing
`Scope` from the effect's requirements without closing the scope when the
effect completes.
The new name better reflects the operation — you are providing a service (the
`Scope`) to an effect, consistent with how other services are provided in
Effect.
**v3**
```ts
import { Effect, Scope } from "effect"
const program = Effect.gen(function*() {
const scope = yield* Scope.make()
yield* Scope.extend(myEffect, scope)
})
```
**v4**
```ts
import { Effect, Scope } from "effect"
const program = Effect.gen(function*() {
const scope = yield* Scope.make()
yield* Scope.provide(scope)(myEffect)
})
```
Both data-first and data-last (curried) forms are supported:
```ts
// data-first
Scope.provide(myEffect, scope)
// data-last (curried)
myEffect.pipe(Scope.provide(scope))
```
## Quick Reference
| v3 | v4 |
| -------------- | --------------- |
| `Scope.extend` | `Scope.provide` |