effect 4.0.0-beta.83 → 4.0.0-beta.85
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.
- package/dist/Array.d.ts +64 -64
- package/dist/Array.js +26 -26
- package/dist/Cache.d.ts +1 -1
- package/dist/Cache.js +1 -1
- package/dist/Cause.d.ts +68 -68
- package/dist/Cause.js +47 -47
- package/dist/Channel.d.ts +5 -5
- package/dist/Channel.js +3 -3
- package/dist/Clock.d.ts +1 -1
- package/dist/Clock.js +1 -1
- package/dist/Combiner.d.ts +9 -9
- package/dist/Combiner.js +8 -8
- package/dist/Config.d.ts +15 -94
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +22 -70
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +58 -74
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +66 -41
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +1 -1
- package/dist/Console.js +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +4 -3
- package/dist/Context.js.map +1 -1
- package/dist/Data.d.ts +15 -15
- package/dist/Data.js +3 -3
- package/dist/DateTime.d.ts +6 -6
- package/dist/DateTime.js +2 -2
- package/dist/Duration.d.ts +3 -3
- package/dist/Duration.js +3 -3
- package/dist/Effect.d.ts +84 -45
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +72 -33
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts +7 -7
- package/dist/Equal.js +5 -5
- package/dist/Equivalence.d.ts +17 -17
- package/dist/Equivalence.js +13 -13
- package/dist/Exit.d.ts +3 -3
- package/dist/Exit.js +3 -3
- package/dist/Formatter.d.ts +5 -5
- package/dist/Formatter.js +4 -4
- package/dist/Function.d.ts +10 -10
- package/dist/Function.js +3 -3
- package/dist/HashMap.d.ts +3 -3
- package/dist/HashMap.js +1 -1
- package/dist/Iterable.d.ts +6 -6
- package/dist/Iterable.js +2 -2
- package/dist/JsonPatch.d.ts +2 -2
- package/dist/Layer.d.ts +1 -1
- package/dist/Layer.js +5 -4
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -3
- package/dist/LayerMap.js.map +1 -1
- package/dist/Logger.d.ts +1 -1
- package/dist/Logger.js +1 -1
- package/dist/Match.d.ts +8 -8
- package/dist/Match.js +8 -8
- package/dist/Metric.d.ts +3 -3
- package/dist/Metric.js +3 -3
- package/dist/Optic.d.ts +30 -30
- package/dist/Optic.js +12 -12
- package/dist/Option.d.ts +7 -7
- package/dist/Option.js +7 -7
- package/dist/Order.d.ts +23 -23
- package/dist/Order.js +20 -20
- package/dist/Pool.d.ts +1 -1
- package/dist/Pool.js +1 -1
- package/dist/Predicate.d.ts +88 -88
- package/dist/Predicate.js +47 -47
- package/dist/PubSub.d.ts +3 -3
- package/dist/PubSub.js +3 -3
- package/dist/Random.d.ts +31 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +32 -0
- package/dist/Random.js.map +1 -1
- package/dist/Reducer.d.ts +1 -1
- package/dist/Reducer.js +1 -1
- package/dist/Result.d.ts +18 -18
- package/dist/Result.js +8 -8
- package/dist/Runtime.d.ts +1 -1
- package/dist/Runtime.js +1 -1
- package/dist/Schema.d.ts +313 -126
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +316 -127
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +9 -8
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +203 -140
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +48 -48
- package/dist/SchemaGetter.js +44 -44
- package/dist/SchemaIssue.d.ts +3 -3
- package/dist/SchemaIssue.js +3 -3
- package/dist/SchemaParser.d.ts +122 -22
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +186 -50
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +1 -1
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +96 -2
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +20 -20
- package/dist/SchemaTransformation.js +18 -18
- package/dist/Stream.d.ts +3 -3
- package/dist/Stream.js +2 -2
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +1 -1
- package/dist/String.js +1 -1
- package/dist/Struct.d.ts +1 -1
- package/dist/Struct.js +1 -1
- package/dist/Types.d.ts +13 -13
- package/dist/internal/effect.js +33 -20
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +17 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/cause.d.ts +2 -0
- package/dist/internal/schema/cause.d.ts.map +1 -0
- package/dist/internal/schema/cause.js +24 -0
- package/dist/internal/schema/cause.js.map +1 -0
- package/dist/internal/schema/schema.d.ts +8 -4
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +21 -8
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/stackTraceLimit.d.ts +2 -0
- package/dist/internal/stackTraceLimit.d.ts.map +1 -0
- package/dist/internal/stackTraceLimit.js +40 -0
- package/dist/internal/stackTraceLimit.js.map +1 -0
- package/dist/internal/tracer.d.ts.map +1 -1
- package/dist/internal/tracer.js +4 -3
- package/dist/internal/tracer.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +3 -3
- package/dist/testing/TestSchema.js +1 -1
- package/dist/unstable/ai/AiError.d.ts +1 -1
- package/dist/unstable/ai/AiError.js +1 -1
- package/dist/unstable/ai/Chat.d.ts +1 -1
- package/dist/unstable/ai/Chat.js +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +4 -5
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +4 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/persistence/PersistedQueue.js +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.js +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -4
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +4 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +15 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -0
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +1 -0
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +65 -65
- package/src/Cache.ts +1 -1
- package/src/Cause.ts +68 -68
- package/src/Channel.ts +5 -5
- package/src/Clock.ts +1 -1
- package/src/Combiner.ts +9 -9
- package/src/Config.ts +40 -108
- package/src/ConfigProvider.ts +139 -100
- package/src/Console.ts +1 -1
- package/src/Context.ts +4 -5
- package/src/Data.ts +15 -15
- package/src/DateTime.ts +6 -6
- package/src/Duration.ts +3 -3
- package/src/Effect.ts +89 -45
- package/src/Equal.ts +7 -7
- package/src/Equivalence.ts +17 -17
- package/src/Exit.ts +3 -3
- package/src/Formatter.ts +5 -5
- package/src/Function.ts +10 -10
- package/src/HashMap.ts +3 -3
- package/src/Iterable.ts +6 -6
- package/src/JsonPatch.ts +2 -2
- package/src/Layer.ts +5 -5
- package/src/LayerMap.ts +4 -3
- package/src/Logger.ts +1 -1
- package/src/Match.ts +8 -8
- package/src/Metric.ts +3 -3
- package/src/Optic.ts +30 -30
- package/src/Option.ts +7 -7
- package/src/Order.ts +23 -23
- package/src/Pool.ts +1 -1
- package/src/Predicate.ts +88 -88
- package/src/PubSub.ts +3 -3
- package/src/Random.ts +42 -0
- package/src/Reducer.ts +1 -1
- package/src/Result.ts +20 -20
- package/src/Runtime.ts +1 -1
- package/src/Schema.ts +389 -153
- package/src/SchemaAST.ts +237 -148
- package/src/SchemaGetter.ts +48 -48
- package/src/SchemaIssue.ts +3 -3
- package/src/SchemaParser.ts +197 -58
- package/src/SchemaRepresentation.ts +73 -3
- package/src/SchemaTransformation.ts +20 -20
- package/src/Stream.ts +4 -4
- package/src/String.ts +1 -1
- package/src/Struct.ts +1 -1
- package/src/Types.ts +13 -13
- package/src/internal/effect.ts +40 -21
- package/src/internal/schema/arbitrary.ts +23 -2
- package/src/internal/schema/cause.ts +26 -0
- package/src/internal/schema/schema.ts +36 -10
- package/src/internal/stackTraceLimit.ts +63 -0
- package/src/internal/tracer.ts +4 -3
- package/src/testing/TestSchema.ts +3 -3
- package/src/unstable/ai/AiError.ts +1 -1
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/Tool.ts +4 -3
- package/src/unstable/cli/Prompt.ts +1 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -3
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +1 -1
- package/src/unstable/rpc/RpcGroup.ts +3 -4
- package/src/unstable/rpc/RpcMiddleware.ts +4 -3
- package/src/unstable/sql/SqlResolver.ts +15 -2
- package/src/unstable/workflow/Activity.ts +2 -0
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/src/Effect.ts
CHANGED
|
@@ -1305,8 +1305,8 @@ export const promise: <A>(
|
|
|
1305
1305
|
) => Effect<A> = internal.promise
|
|
1306
1306
|
|
|
1307
1307
|
/**
|
|
1308
|
-
* Creates an `Effect`
|
|
1309
|
-
*
|
|
1308
|
+
* Creates an `Effect` from an asynchronous computation that may throw or
|
|
1309
|
+
* reject, mapping failures into the error channel.
|
|
1310
1310
|
*
|
|
1311
1311
|
* **When to use**
|
|
1312
1312
|
*
|
|
@@ -1316,19 +1316,24 @@ export const promise: <A>(
|
|
|
1316
1316
|
*
|
|
1317
1317
|
* **Details**
|
|
1318
1318
|
*
|
|
1319
|
-
*
|
|
1319
|
+
* The promise thunk is evaluated when the effect runs. If it returns a promise
|
|
1320
|
+
* that resolves, the resolved value becomes the success value. If the thunk
|
|
1321
|
+
* throws before returning a promise, or if the returned promise rejects, the
|
|
1322
|
+
* thrown or rejected value is mapped into the error channel.
|
|
1320
1323
|
*
|
|
1321
|
-
*
|
|
1324
|
+
* Passing the thunk directly maps failures to {@link Cause.UnknownError}.
|
|
1325
|
+
* Passing `{ try, catch }` uses `catch` to map failures to an error of type
|
|
1326
|
+
* `E`.
|
|
1322
1327
|
*
|
|
1323
|
-
*
|
|
1324
|
-
*
|
|
1325
|
-
*
|
|
1326
|
-
* function maps it to an error of type `E`.
|
|
1328
|
+
* The thunk receives an `AbortSignal` that is aborted if the effect is
|
|
1329
|
+
* interrupted. The underlying asynchronous operation only stops if it observes
|
|
1330
|
+
* that signal.
|
|
1327
1331
|
*
|
|
1328
|
-
*
|
|
1332
|
+
* **Gotchas**
|
|
1329
1333
|
*
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1334
|
+
* If `catch` throws while mapping the error, that thrown value is treated as a
|
|
1335
|
+
* defect. Return the error value you want in the error channel instead of
|
|
1336
|
+
* throwing it.
|
|
1332
1337
|
*
|
|
1333
1338
|
* **Example** (Wrapping a fetch request that may fail)
|
|
1334
1339
|
*
|
|
@@ -2190,7 +2195,7 @@ export const failCauseSync: <E>(
|
|
|
2190
2195
|
* The error channel of the resulting effect is of type `never`, indicating that
|
|
2191
2196
|
* it cannot recover from this failure.
|
|
2192
2197
|
*
|
|
2193
|
-
* **Example** (Failing
|
|
2198
|
+
* **Example** (Failing on division by zero)
|
|
2194
2199
|
*
|
|
2195
2200
|
* ```ts
|
|
2196
2201
|
* import { Effect } from "effect"
|
|
@@ -2215,53 +2220,56 @@ export const failCauseSync: <E>(
|
|
|
2215
2220
|
*/
|
|
2216
2221
|
export const die: (defect: unknown) => Effect<never> = internal.die
|
|
2217
2222
|
|
|
2218
|
-
const try_: <A, E>(
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2223
|
+
const try_: <A, E = Cause.UnknownError>(
|
|
2224
|
+
options: {
|
|
2225
|
+
readonly try: LazyArg<A>
|
|
2226
|
+
readonly catch: (error: unknown) => E
|
|
2227
|
+
} | LazyArg<A>
|
|
2228
|
+
) => Effect<A, E> = internal.try
|
|
2222
2229
|
|
|
2223
2230
|
export {
|
|
2224
2231
|
/**
|
|
2225
|
-
* Creates an `Effect`
|
|
2226
|
-
*
|
|
2232
|
+
* Creates an `Effect` from a synchronous computation that may throw, mapping
|
|
2233
|
+
* thrown values into the error channel.
|
|
2227
2234
|
*
|
|
2228
2235
|
* **When to use**
|
|
2229
2236
|
*
|
|
2230
2237
|
* Use when you need to perform synchronous operations that might throw, such
|
|
2231
|
-
* as parsing JSON, and
|
|
2238
|
+
* as parsing JSON, and want thrown exceptions captured as Effect errors.
|
|
2232
2239
|
*
|
|
2233
2240
|
* **Details**
|
|
2234
2241
|
*
|
|
2235
|
-
*
|
|
2242
|
+
* The thunk is evaluated when the effect runs. If it returns normally, the
|
|
2243
|
+
* returned value becomes the success value. If it throws, the thrown value is
|
|
2244
|
+
* mapped into the error channel.
|
|
2236
2245
|
*
|
|
2237
|
-
*
|
|
2246
|
+
* Passing the thunk directly maps failures to {@link Cause.UnknownError}.
|
|
2247
|
+
* Passing `{ try, catch }` uses `catch` to map failures to an error of type
|
|
2248
|
+
* `E`.
|
|
2238
2249
|
*
|
|
2239
|
-
*
|
|
2240
|
-
*
|
|
2241
|
-
*
|
|
2242
|
-
*
|
|
2250
|
+
* **Gotchas**
|
|
2251
|
+
*
|
|
2252
|
+
* If `catch` throws while mapping the error, that thrown value is treated as
|
|
2253
|
+
* a defect. Return the error value you want in the error channel instead of
|
|
2254
|
+
* throwing it.
|
|
2243
2255
|
*
|
|
2244
|
-
* **Example** (Parsing JSON
|
|
2256
|
+
* **Example** (Parsing JSON)
|
|
2245
2257
|
*
|
|
2246
2258
|
* ```ts
|
|
2247
2259
|
* import { Effect } from "effect"
|
|
2248
2260
|
*
|
|
2249
2261
|
* const parseJSON = (input: string) =>
|
|
2250
|
-
* Effect.try(
|
|
2251
|
-
* try: () => JSON.parse(input),
|
|
2252
|
-
* catch: (error) => error as Error
|
|
2253
|
-
* })
|
|
2262
|
+
* Effect.try(() => JSON.parse(input))
|
|
2254
2263
|
*
|
|
2255
2264
|
* // Success case
|
|
2256
2265
|
* Effect.runPromise(parseJSON("{\"name\": \"Alice\"}")).then(console.log)
|
|
2257
2266
|
* // Output: { name: "Alice" }
|
|
2258
2267
|
*
|
|
2259
|
-
* // Failure case
|
|
2268
|
+
* // Failure case maps the thrown value to UnknownError
|
|
2260
2269
|
* Effect.runPromiseExit(parseJSON("invalid json")).then(console.log)
|
|
2261
|
-
* // Output: Exit.failure with Error
|
|
2262
2270
|
* ```
|
|
2263
2271
|
*
|
|
2264
|
-
* **Example** (Mapping
|
|
2272
|
+
* **Example** (Mapping exceptions to a tagged error)
|
|
2265
2273
|
*
|
|
2266
2274
|
* ```ts
|
|
2267
2275
|
* import { Data, Effect } from "effect"
|
|
@@ -2417,6 +2425,42 @@ export const fromOption: <A>(
|
|
|
2417
2425
|
option: Option<A>
|
|
2418
2426
|
) => Effect<A, Cause.NoSuchElementError> = internal.fromOption
|
|
2419
2427
|
|
|
2428
|
+
/**
|
|
2429
|
+
* Converts an `Option` of an `Effect` into an `Effect` of an `Option`.
|
|
2430
|
+
*
|
|
2431
|
+
* **When to use**
|
|
2432
|
+
*
|
|
2433
|
+
* Use when an effect should run only when an optional value is present, while
|
|
2434
|
+
* preserving absence as a successful `None`.
|
|
2435
|
+
*
|
|
2436
|
+
* **Details**
|
|
2437
|
+
*
|
|
2438
|
+
* - `None` becomes an effect that succeeds with `None`
|
|
2439
|
+
* - `Some(effect)` runs the inner effect and wraps its success value in `Some`
|
|
2440
|
+
* - Inner failures are preserved in the resulting effect
|
|
2441
|
+
*
|
|
2442
|
+
* **Example** (Transposing an Option of an Effect)
|
|
2443
|
+
*
|
|
2444
|
+
* ```ts
|
|
2445
|
+
* import { Effect, Option } from "effect"
|
|
2446
|
+
*
|
|
2447
|
+
* const some = Option.some(Effect.succeed(42))
|
|
2448
|
+
*
|
|
2449
|
+
* // ┌─── Effect<Option<number>, never, never>
|
|
2450
|
+
* // ▼
|
|
2451
|
+
* const program = Effect.transposeOption(some)
|
|
2452
|
+
*
|
|
2453
|
+
* Effect.runPromise(program).then(console.log)
|
|
2454
|
+
* // Output: { _id: 'Option', _tag: 'Some', value: 42 }
|
|
2455
|
+
* ```
|
|
2456
|
+
*
|
|
2457
|
+
* @category converting
|
|
2458
|
+
* @since 3.13.0
|
|
2459
|
+
*/
|
|
2460
|
+
export const transposeOption: <A = never, E = never, R = never>(
|
|
2461
|
+
self: Option<Effect<A, E, R>>
|
|
2462
|
+
) => Effect<Option<A>, E, R> = internal.transposeOption
|
|
2463
|
+
|
|
2420
2464
|
/**
|
|
2421
2465
|
* Converts a nullable value to an `Effect`, failing with a `NoSuchElementError`
|
|
2422
2466
|
* when the value is `null` or `undefined`.
|
|
@@ -2468,7 +2512,7 @@ export const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Cause.NoSuch
|
|
|
2468
2512
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2469
2513
|
* changing the original one.
|
|
2470
2514
|
*
|
|
2471
|
-
* **Example** (
|
|
2515
|
+
* **Example** (Choosing flatMap syntax variants)
|
|
2472
2516
|
*
|
|
2473
2517
|
* ```ts
|
|
2474
2518
|
* import { Effect, pipe } from "effect"
|
|
@@ -2539,7 +2583,7 @@ export const flatMap: {
|
|
|
2539
2583
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2540
2584
|
* changing the original one.
|
|
2541
2585
|
*
|
|
2542
|
-
* **Example** (
|
|
2586
|
+
* **Example** (Choosing flatMap syntax variants)
|
|
2543
2587
|
*
|
|
2544
2588
|
* ```ts
|
|
2545
2589
|
* import { Effect, pipe } from "effect"
|
|
@@ -2610,7 +2654,7 @@ export const flatMap: {
|
|
|
2610
2654
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2611
2655
|
* changing the original one.
|
|
2612
2656
|
*
|
|
2613
|
-
* **Example** (
|
|
2657
|
+
* **Example** (Choosing flatMap syntax variants)
|
|
2614
2658
|
*
|
|
2615
2659
|
* ```ts
|
|
2616
2660
|
* import { Effect, pipe } from "effect"
|
|
@@ -2701,7 +2745,7 @@ export const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2, R2>) =
|
|
|
2701
2745
|
* Failures or requirements from either effect are preserved in the returned
|
|
2702
2746
|
* effect.
|
|
2703
2747
|
*
|
|
2704
|
-
* **Example** (
|
|
2748
|
+
* **Example** (Choosing andThen syntax variants)
|
|
2705
2749
|
*
|
|
2706
2750
|
* ```ts
|
|
2707
2751
|
* import { Effect, pipe } from "effect"
|
|
@@ -2777,7 +2821,7 @@ export const andThen: {
|
|
|
2777
2821
|
* Failures or requirements from either effect are preserved in the returned
|
|
2778
2822
|
* effect.
|
|
2779
2823
|
*
|
|
2780
|
-
* **Example** (
|
|
2824
|
+
* **Example** (Choosing andThen syntax variants)
|
|
2781
2825
|
*
|
|
2782
2826
|
* ```ts
|
|
2783
2827
|
* import { Effect, pipe } from "effect"
|
|
@@ -2853,7 +2897,7 @@ export const andThen: {
|
|
|
2853
2897
|
* Failures or requirements from either effect are preserved in the returned
|
|
2854
2898
|
* effect.
|
|
2855
2899
|
*
|
|
2856
|
-
* **Example** (
|
|
2900
|
+
* **Example** (Choosing andThen syntax variants)
|
|
2857
2901
|
*
|
|
2858
2902
|
* ```ts
|
|
2859
2903
|
* import { Effect, pipe } from "effect"
|
|
@@ -2929,7 +2973,7 @@ export const andThen: {
|
|
|
2929
2973
|
* Failures or requirements from either effect are preserved in the returned
|
|
2930
2974
|
* effect.
|
|
2931
2975
|
*
|
|
2932
|
-
* **Example** (
|
|
2976
|
+
* **Example** (Choosing andThen syntax variants)
|
|
2933
2977
|
*
|
|
2934
2978
|
* ```ts
|
|
2935
2979
|
* import { Effect, pipe } from "effect"
|
|
@@ -3005,7 +3049,7 @@ export const andThen: {
|
|
|
3005
3049
|
* Failures or requirements from either effect are preserved in the returned
|
|
3006
3050
|
* effect.
|
|
3007
3051
|
*
|
|
3008
|
-
* **Example** (
|
|
3052
|
+
* **Example** (Choosing andThen syntax variants)
|
|
3009
3053
|
*
|
|
3010
3054
|
* ```ts
|
|
3011
3055
|
* import { Effect, pipe } from "effect"
|
|
@@ -3498,7 +3542,7 @@ export const exit: <A, E, R>(
|
|
|
3498
3542
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3499
3543
|
* value.
|
|
3500
3544
|
*
|
|
3501
|
-
* **Example** (
|
|
3545
|
+
* **Example** (Choosing map syntax variants)
|
|
3502
3546
|
*
|
|
3503
3547
|
* ```ts
|
|
3504
3548
|
* import { Effect, pipe } from "effect"
|
|
@@ -3554,7 +3598,7 @@ export const map: {
|
|
|
3554
3598
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3555
3599
|
* value.
|
|
3556
3600
|
*
|
|
3557
|
-
* **Example** (
|
|
3601
|
+
* **Example** (Choosing map syntax variants)
|
|
3558
3602
|
*
|
|
3559
3603
|
* ```ts
|
|
3560
3604
|
* import { Effect, pipe } from "effect"
|
|
@@ -3610,7 +3654,7 @@ export const map: {
|
|
|
3610
3654
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3611
3655
|
* value.
|
|
3612
3656
|
*
|
|
3613
|
-
* **Example** (
|
|
3657
|
+
* **Example** (Choosing map syntax variants)
|
|
3614
3658
|
*
|
|
3615
3659
|
* ```ts
|
|
3616
3660
|
* import { Effect, pipe } from "effect"
|
|
@@ -12879,7 +12923,7 @@ export const acquireDisposable: <A extends AsyncDisposable | Disposable, E, R>(
|
|
|
12879
12923
|
* is not desired, errors produced by the `release` `Effect` value can be caught
|
|
12880
12924
|
* and ignored.
|
|
12881
12925
|
*
|
|
12882
|
-
* **Example** (
|
|
12926
|
+
* **Example** (Acquiring resources with cleanup)
|
|
12883
12927
|
*
|
|
12884
12928
|
* ```ts
|
|
12885
12929
|
* import { Console, Effect, Exit } from "effect"
|
package/src/Equal.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { hasProperty } from "./Predicate.ts"
|
|
|
26
26
|
*
|
|
27
27
|
* This is a pure constant with no allocation or side effects.
|
|
28
28
|
*
|
|
29
|
-
* **Example** (Implementing Equal on a
|
|
29
|
+
* **Example** (Implementing Equal on a class)
|
|
30
30
|
*
|
|
31
31
|
* ```ts
|
|
32
32
|
* import { Equal, Hash } from "effect"
|
|
@@ -74,7 +74,7 @@ export const symbol = "~effect/interfaces/Equal"
|
|
|
74
74
|
* - {@link equals} delegates to this method when both operands implement it.
|
|
75
75
|
* If only one operand implements `Equal`, they are considered unequal.
|
|
76
76
|
*
|
|
77
|
-
* **Example** (
|
|
77
|
+
* **Example** (Comparing coordinates by value)
|
|
78
78
|
*
|
|
79
79
|
* ```ts
|
|
80
80
|
* import { Equal, Hash } from "effect"
|
|
@@ -137,7 +137,7 @@ export interface Equal extends Hash.Hash {
|
|
|
137
137
|
* mutated after their first comparison.**
|
|
138
138
|
* - Map and Set comparisons are O(n²) in size.
|
|
139
139
|
*
|
|
140
|
-
* **Example** (Comparing
|
|
140
|
+
* **Example** (Comparing values)
|
|
141
141
|
*
|
|
142
142
|
* ```ts
|
|
143
143
|
* import { Equal } from "effect"
|
|
@@ -404,7 +404,7 @@ const compareSets = makeCompareSet(compareBoth)
|
|
|
404
404
|
* {@link symbol}.
|
|
405
405
|
* - Acts as a TypeScript type guard, narrowing the input to {@link Equal}.
|
|
406
406
|
*
|
|
407
|
-
* **Example** (
|
|
407
|
+
* **Example** (Checking Equal values)
|
|
408
408
|
*
|
|
409
409
|
* ```ts
|
|
410
410
|
* import { Equal, Hash } from "effect"
|
|
@@ -445,7 +445,7 @@ export const isEqual = (u: unknown): u is Equal => hasProperty(u, symbol)
|
|
|
445
445
|
* {@link equals}.
|
|
446
446
|
* - Pure; allocates a thin wrapper on each call.
|
|
447
447
|
*
|
|
448
|
-
* **Example** (Deduplicating with Equal
|
|
448
|
+
* **Example** (Deduplicating with Equal semantics)
|
|
449
449
|
*
|
|
450
450
|
* ```ts
|
|
451
451
|
* import { Array, Equal } from "effect"
|
|
@@ -479,7 +479,7 @@ export const asEquivalence: <A>() => Equivalence<A> = () => equals
|
|
|
479
479
|
* - Each call creates a **new** proxy, so `byReference(x) !== byReference(x)`.
|
|
480
480
|
* - Does **not** mutate the original object (unlike {@link byReferenceUnsafe}).
|
|
481
481
|
*
|
|
482
|
-
* **Example** (Opting
|
|
482
|
+
* **Example** (Opting out of structural equality)
|
|
483
483
|
*
|
|
484
484
|
* ```ts
|
|
485
485
|
* import { Equal } from "effect"
|
|
@@ -524,7 +524,7 @@ export const byReference = <T extends object>(obj: T): T => byReferenceUnsafe(ne
|
|
|
524
524
|
*
|
|
525
525
|
* The marking is irreversible for the lifetime of the object.
|
|
526
526
|
*
|
|
527
|
-
* **Example** (Marking an
|
|
527
|
+
* **Example** (Marking an object for reference equality)
|
|
528
528
|
*
|
|
529
529
|
* ```ts
|
|
530
530
|
* import { Equal } from "effect"
|
package/src/Equivalence.ts
CHANGED
|
@@ -25,7 +25,7 @@ import * as Reducer from "./Reducer.ts"
|
|
|
25
25
|
* - Returns `boolean`: `true` if values are equivalent, `false` otherwise
|
|
26
26
|
* - Must satisfy reflexive, symmetric, and transitive properties
|
|
27
27
|
*
|
|
28
|
-
* **Example** (
|
|
28
|
+
* **Example** (Defining simple number equivalence)
|
|
29
29
|
*
|
|
30
30
|
* ```ts
|
|
31
31
|
* import type { Equivalence } from "effect"
|
|
@@ -36,7 +36,7 @@ import * as Reducer from "./Reducer.ts"
|
|
|
36
36
|
* console.log(numberEq(1, 2)) // false
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
39
|
-
* **Example** (
|
|
39
|
+
* **Example** (Defining custom object equivalence)
|
|
40
40
|
*
|
|
41
41
|
* ```ts
|
|
42
42
|
* import type { Equivalence } from "effect"
|
|
@@ -128,7 +128,7 @@ export interface EquivalenceTypeLambda extends TypeLambda {
|
|
|
128
128
|
* console.log(caseInsensitive(str, str)) // true (fast path)
|
|
129
129
|
* ```
|
|
130
130
|
*
|
|
131
|
-
* **Example** (
|
|
131
|
+
* **Example** (Comparing numbers with tolerance)
|
|
132
132
|
*
|
|
133
133
|
* ```ts
|
|
134
134
|
* import { Equivalence } from "effect"
|
|
@@ -167,7 +167,7 @@ const isStrictEquivalent = (x: unknown, y: unknown) => x === y
|
|
|
167
167
|
*
|
|
168
168
|
* `NaN !== NaN`, so `NaN` values are never considered equivalent.
|
|
169
169
|
*
|
|
170
|
-
* **Example** (
|
|
170
|
+
* **Example** (Comparing primitive types)
|
|
171
171
|
*
|
|
172
172
|
* ```ts
|
|
173
173
|
* import { Equivalence } from "effect"
|
|
@@ -179,7 +179,7 @@ const isStrictEquivalent = (x: unknown, y: unknown) => x === y
|
|
|
179
179
|
* console.log(strictEq(NaN, NaN)) // false (NaN !== NaN)
|
|
180
180
|
* ```
|
|
181
181
|
*
|
|
182
|
-
* **Example** (
|
|
182
|
+
* **Example** (Comparing objects by reference)
|
|
183
183
|
*
|
|
184
184
|
* ```ts
|
|
185
185
|
* import { Equivalence } from "effect"
|
|
@@ -486,7 +486,7 @@ export const combine: {
|
|
|
486
486
|
* console.log(point3DEq(point1, point3)) // false (different z)
|
|
487
487
|
* ```
|
|
488
488
|
*
|
|
489
|
-
* **Example** (
|
|
489
|
+
* **Example** (Handling empty collections)
|
|
490
490
|
*
|
|
491
491
|
* ```ts
|
|
492
492
|
* import { Equivalence } from "effect"
|
|
@@ -527,7 +527,7 @@ export const combineAll = <A>(collection: Iterable<Equivalence<A>>): Equivalence
|
|
|
527
527
|
* - Useful for comparing by one property or normalizing values before
|
|
528
528
|
* comparison, such as case-insensitive strings
|
|
529
529
|
*
|
|
530
|
-
* **Example** (
|
|
530
|
+
* **Example** (Deriving equivalence from an object property)
|
|
531
531
|
*
|
|
532
532
|
* ```ts
|
|
533
533
|
* import { Equivalence } from "effect"
|
|
@@ -588,7 +588,7 @@ export const mapInput: {
|
|
|
588
588
|
* - Useful for comparing by one property or normalizing values before
|
|
589
589
|
* comparison, such as case-insensitive strings
|
|
590
590
|
*
|
|
591
|
-
* **Example** (
|
|
591
|
+
* **Example** (Deriving equivalence from an object property)
|
|
592
592
|
*
|
|
593
593
|
* ```ts
|
|
594
594
|
* import { Equivalence } from "effect"
|
|
@@ -649,7 +649,7 @@ export const mapInput: {
|
|
|
649
649
|
* - Useful for comparing by one property or normalizing values before
|
|
650
650
|
* comparison, such as case-insensitive strings
|
|
651
651
|
*
|
|
652
|
-
* **Example** (
|
|
652
|
+
* **Example** (Deriving equivalence from an object property)
|
|
653
653
|
*
|
|
654
654
|
* ```ts
|
|
655
655
|
* import { Equivalence } from "effect"
|
|
@@ -715,7 +715,7 @@ export const mapInput: {
|
|
|
715
715
|
* respective equivalences, and it also satisfies reflexive, symmetric, and
|
|
716
716
|
* transitive properties.
|
|
717
717
|
*
|
|
718
|
-
* **Example** (
|
|
718
|
+
* **Example** (Comparing homogeneous tuples)
|
|
719
719
|
*
|
|
720
720
|
* ```ts
|
|
721
721
|
* import { Equivalence } from "effect"
|
|
@@ -734,7 +734,7 @@ export const mapInput: {
|
|
|
734
734
|
* console.log(stringTupleEq(tuple1, tuple3)) // false (different third element)
|
|
735
735
|
* ```
|
|
736
736
|
*
|
|
737
|
-
* **Example** (
|
|
737
|
+
* **Example** (Comparing tuples with custom equivalences)
|
|
738
738
|
*
|
|
739
739
|
* ```ts
|
|
740
740
|
* import { Equivalence } from "effect"
|
|
@@ -804,7 +804,7 @@ export {
|
|
|
804
804
|
* - Empty arrays are considered equivalent
|
|
805
805
|
* - The result is also an equivalence that satisfies reflexive, symmetric, and transitive properties
|
|
806
806
|
*
|
|
807
|
-
* **Example** (
|
|
807
|
+
* **Example** (Comparing number arrays)
|
|
808
808
|
*
|
|
809
809
|
* ```ts
|
|
810
810
|
* import { Equivalence } from "effect"
|
|
@@ -856,7 +856,7 @@ export {
|
|
|
856
856
|
* are equivalent according to their equivalences, and it also satisfies
|
|
857
857
|
* reflexive, symmetric, and transitive properties.
|
|
858
858
|
*
|
|
859
|
-
* **Example** (
|
|
859
|
+
* **Example** (Comparing structs with different equivalences per field)
|
|
860
860
|
*
|
|
861
861
|
* ```ts
|
|
862
862
|
* import { Equivalence } from "effect"
|
|
@@ -886,7 +886,7 @@ export {
|
|
|
886
886
|
* console.log(personEq(person1, person3)) // false (different age)
|
|
887
887
|
* ```
|
|
888
888
|
*
|
|
889
|
-
* **Example** (
|
|
889
|
+
* **Example** (Comparing specific fields)
|
|
890
890
|
*
|
|
891
891
|
* ```ts
|
|
892
892
|
* import { Equivalence } from "effect"
|
|
@@ -937,7 +937,7 @@ export function Struct<R extends Record<string, Equivalence<any>>>(
|
|
|
937
937
|
* - Empty objects are considered equivalent
|
|
938
938
|
* - The result is also an equivalence that satisfies reflexive, symmetric, and transitive properties
|
|
939
939
|
*
|
|
940
|
-
* **Example** (
|
|
940
|
+
* **Example** (Defining records with string values)
|
|
941
941
|
*
|
|
942
942
|
* ```ts
|
|
943
943
|
* import { Equivalence } from "effect"
|
|
@@ -954,7 +954,7 @@ export function Struct<R extends Record<string, Equivalence<any>>>(
|
|
|
954
954
|
* console.log(stringRecordEq(record1, record4)) // false (different keys)
|
|
955
955
|
* ```
|
|
956
956
|
*
|
|
957
|
-
* **Example** (
|
|
957
|
+
* **Example** (Defining records with number values)
|
|
958
958
|
*
|
|
959
959
|
* ```ts
|
|
960
960
|
* import { Equivalence } from "effect"
|
|
@@ -1064,7 +1064,7 @@ export function makeReducer<A>() {
|
|
|
1064
1064
|
* console.log(Equivalence.Date(invalidDate1, d1)) // false
|
|
1065
1065
|
* ```
|
|
1066
1066
|
*
|
|
1067
|
-
* **Example** (
|
|
1067
|
+
* **Example** (Comparing reference and value equality)
|
|
1068
1068
|
*
|
|
1069
1069
|
* ```ts
|
|
1070
1070
|
* import { Equivalence } from "effect"
|
package/src/Exit.ts
CHANGED
|
@@ -356,7 +356,7 @@ export {
|
|
|
356
356
|
* Equivalent to `Exit.succeed(undefined)` but shared as a single instance,
|
|
357
357
|
* avoiding allocation for a common case.
|
|
358
358
|
*
|
|
359
|
-
* **Example** (
|
|
359
|
+
* **Example** (Referencing the void Exit)
|
|
360
360
|
*
|
|
361
361
|
* ```ts
|
|
362
362
|
* import { Exit } from "effect"
|
|
@@ -382,7 +382,7 @@ export {
|
|
|
382
382
|
* Use as a type guard to narrow `Exit<A, E>` to `Success<A, E>` and access the
|
|
383
383
|
* `value` property.
|
|
384
384
|
*
|
|
385
|
-
* **Example** (Narrowing to
|
|
385
|
+
* **Example** (Narrowing to success)
|
|
386
386
|
*
|
|
387
387
|
* ```ts
|
|
388
388
|
* import { Exit } from "effect"
|
|
@@ -410,7 +410,7 @@ export const isSuccess: <A, E>(self: Exit<A, E>) => self is Success<A, E> = effe
|
|
|
410
410
|
* Use as a type guard to narrow `Exit<A, E>` to `Failure<A, E>` and access the
|
|
411
411
|
* `cause` property.
|
|
412
412
|
*
|
|
413
|
-
* **Example** (Narrowing to
|
|
413
|
+
* **Example** (Narrowing to failure)
|
|
414
414
|
*
|
|
415
415
|
* ```ts
|
|
416
416
|
* import { Exit } from "effect"
|
package/src/Formatter.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { getRedacted, redact, symbolRedactable } from "./Redactable.ts"
|
|
|
23
23
|
*
|
|
24
24
|
* This is a pure callable type and carries no runtime implementation. It is contravariant in `Value` and covariant in `Format`.
|
|
25
25
|
*
|
|
26
|
-
* **Example** (
|
|
26
|
+
* **Example** (Defining a custom formatter)
|
|
27
27
|
*
|
|
28
28
|
* ```ts
|
|
29
29
|
* import type { Formatter } from "effect"
|
|
@@ -73,7 +73,7 @@ export interface Formatter<in Value, out Format = string> {
|
|
|
73
73
|
* `"\t"`). Defaults to `0` (compact).
|
|
74
74
|
* - `ignoreToString` — skip calling `toString()`. Defaults to `false`.
|
|
75
75
|
*
|
|
76
|
-
* **Example** (
|
|
76
|
+
* **Example** (Formatting compact output)
|
|
77
77
|
*
|
|
78
78
|
* ```ts
|
|
79
79
|
* import { Formatter } from "effect"
|
|
@@ -97,7 +97,7 @@ export interface Formatter<in Value, out Format = string> {
|
|
|
97
97
|
* // }
|
|
98
98
|
* ```
|
|
99
99
|
*
|
|
100
|
-
* **Example** (
|
|
100
|
+
* **Example** (Handling circular references)
|
|
101
101
|
*
|
|
102
102
|
* ```ts
|
|
103
103
|
* import { Formatter } from "effect"
|
|
@@ -257,7 +257,7 @@ function safeToString(input: any): string {
|
|
|
257
257
|
* `Symbol`, `undefined`, and functions, follow standard `JSON.stringify`
|
|
258
258
|
* behavior. The `space` parameter controls indentation and defaults to `0`.
|
|
259
259
|
*
|
|
260
|
-
* **Example** (
|
|
260
|
+
* **Example** (Formatting compact JSON)
|
|
261
261
|
*
|
|
262
262
|
* ```ts
|
|
263
263
|
* import { Formatter } from "effect"
|
|
@@ -266,7 +266,7 @@ function safeToString(input: any): string {
|
|
|
266
266
|
* // {"name":"Alice","age":30}
|
|
267
267
|
* ```
|
|
268
268
|
*
|
|
269
|
-
* **Example** (
|
|
269
|
+
* **Example** (Handling circular references)
|
|
270
270
|
*
|
|
271
271
|
* ```ts
|
|
272
272
|
* import { Formatter } from "effect"
|
package/src/Function.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface FunctionTypeLambda extends TypeLambda {
|
|
|
51
51
|
* whether the current call is data-first. Arity is the common case. Use a
|
|
52
52
|
* predicate when optional arguments make arity ambiguous.
|
|
53
53
|
*
|
|
54
|
-
* **Example** (
|
|
54
|
+
* **Example** (Selecting data-first or data-last style by arity)
|
|
55
55
|
*
|
|
56
56
|
* ```ts
|
|
57
57
|
* import { Function, pipe } from "effect"
|
|
@@ -65,7 +65,7 @@ export interface FunctionTypeLambda extends TypeLambda {
|
|
|
65
65
|
* console.log(pipe(2, sum(3))) // 5
|
|
66
66
|
* ```
|
|
67
67
|
*
|
|
68
|
-
* **Example** (
|
|
68
|
+
* **Example** (Defining overloads with call signatures)
|
|
69
69
|
*
|
|
70
70
|
* ```ts
|
|
71
71
|
* import { Function, pipe } from "effect"
|
|
@@ -79,7 +79,7 @@ export interface FunctionTypeLambda extends TypeLambda {
|
|
|
79
79
|
* console.log(pipe(2, sum(3))) // 5
|
|
80
80
|
* ```
|
|
81
81
|
*
|
|
82
|
-
* **Example** (
|
|
82
|
+
* **Example** (Selecting data-first or data-last style with a predicate)
|
|
83
83
|
*
|
|
84
84
|
* ```ts
|
|
85
85
|
* import { Function, pipe } from "effect"
|
|
@@ -115,7 +115,7 @@ export const dual: {
|
|
|
115
115
|
* whether the current call is data-first. Arity is the common case. Use a
|
|
116
116
|
* predicate when optional arguments make arity ambiguous.
|
|
117
117
|
*
|
|
118
|
-
* **Example** (
|
|
118
|
+
* **Example** (Selecting data-first or data-last style by arity)
|
|
119
119
|
*
|
|
120
120
|
* ```ts
|
|
121
121
|
* import { Function, pipe } from "effect"
|
|
@@ -129,7 +129,7 @@ export const dual: {
|
|
|
129
129
|
* console.log(pipe(2, sum(3))) // 5
|
|
130
130
|
* ```
|
|
131
131
|
*
|
|
132
|
-
* **Example** (
|
|
132
|
+
* **Example** (Defining overloads with call signatures)
|
|
133
133
|
*
|
|
134
134
|
* ```ts
|
|
135
135
|
* import { Function, pipe } from "effect"
|
|
@@ -143,7 +143,7 @@ export const dual: {
|
|
|
143
143
|
* console.log(pipe(2, sum(3))) // 5
|
|
144
144
|
* ```
|
|
145
145
|
*
|
|
146
|
-
* **Example** (
|
|
146
|
+
* **Example** (Selecting data-first or data-last style with a predicate)
|
|
147
147
|
*
|
|
148
148
|
* ```ts
|
|
149
149
|
* import { Function, pipe } from "effect"
|
|
@@ -179,7 +179,7 @@ export const dual: {
|
|
|
179
179
|
* whether the current call is data-first. Arity is the common case. Use a
|
|
180
180
|
* predicate when optional arguments make arity ambiguous.
|
|
181
181
|
*
|
|
182
|
-
* **Example** (
|
|
182
|
+
* **Example** (Selecting data-first or data-last style by arity)
|
|
183
183
|
*
|
|
184
184
|
* ```ts
|
|
185
185
|
* import { Function, pipe } from "effect"
|
|
@@ -193,7 +193,7 @@ export const dual: {
|
|
|
193
193
|
* console.log(pipe(2, sum(3))) // 5
|
|
194
194
|
* ```
|
|
195
195
|
*
|
|
196
|
-
* **Example** (
|
|
196
|
+
* **Example** (Defining overloads with call signatures)
|
|
197
197
|
*
|
|
198
198
|
* ```ts
|
|
199
199
|
* import { Function, pipe } from "effect"
|
|
@@ -207,7 +207,7 @@ export const dual: {
|
|
|
207
207
|
* console.log(pipe(2, sum(3))) // 5
|
|
208
208
|
* ```
|
|
209
209
|
*
|
|
210
|
-
* **Example** (
|
|
210
|
+
* **Example** (Selecting data-first or data-last style with a predicate)
|
|
211
211
|
*
|
|
212
212
|
* ```ts
|
|
213
213
|
* import { Function, pipe } from "effect"
|
|
@@ -760,7 +760,7 @@ export const untupled = <A extends ReadonlyArray<unknown>, B>(f: (a: A) => B): (
|
|
|
760
760
|
* Each function passed after the initial value must accept a single argument,
|
|
761
761
|
* because `pipe` calls each step with only the previous result.
|
|
762
762
|
*
|
|
763
|
-
* **Example** (
|
|
763
|
+
* **Example** (Piping values through functions)
|
|
764
764
|
*
|
|
765
765
|
* In this example, `1` is passed to the first function, and each result becomes
|
|
766
766
|
* the input for the next function.
|
package/src/HashMap.ts
CHANGED
|
@@ -1867,7 +1867,7 @@ export const map: {
|
|
|
1867
1867
|
*
|
|
1868
1868
|
* The hash and equality behavior of both maps have to be the same.
|
|
1869
1869
|
*
|
|
1870
|
-
* **Example** (
|
|
1870
|
+
* **Example** (Flat mapping values)
|
|
1871
1871
|
*
|
|
1872
1872
|
* ```ts
|
|
1873
1873
|
* import { HashMap } from "effect"
|
|
@@ -1894,7 +1894,7 @@ export const flatMap: {
|
|
|
1894
1894
|
*
|
|
1895
1895
|
* The hash and equality behavior of both maps have to be the same.
|
|
1896
1896
|
*
|
|
1897
|
-
* **Example** (
|
|
1897
|
+
* **Example** (Flat mapping values)
|
|
1898
1898
|
*
|
|
1899
1899
|
* ```ts
|
|
1900
1900
|
* import { HashMap } from "effect"
|
|
@@ -1921,7 +1921,7 @@ export const flatMap: {
|
|
|
1921
1921
|
*
|
|
1922
1922
|
* The hash and equality behavior of both maps have to be the same.
|
|
1923
1923
|
*
|
|
1924
|
-
* **Example** (
|
|
1924
|
+
* **Example** (Flat mapping values)
|
|
1925
1925
|
*
|
|
1926
1926
|
* ```ts
|
|
1927
1927
|
* import { HashMap } from "effect"
|