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/dist/LayerMap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerMap.d.ts","sourceRoot":"","sources":["../src/LayerMap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,KAAK,QAAQ,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"LayerMap.d.ts","sourceRoot":"","sources":["../src/LayerMap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,KAAK,QAAQ,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAGrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAW,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE7D,QAAA,MAAM,MAAM,qBAAqB,CAAA;AAEjC,KAAK,mBAAmB,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAA;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,WAAW,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;IAC5D,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAA;IAEhC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EA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AE,GAAG,CAAC,GACrF,OAAO,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAA;KAAE,GAAG,MAAM,MAAM,GAChE,KAAK,CAAA;IAET;;;;;OAKG;IACH,KAAY,MAAM,CAAC,OAAO,IAAI,OAAO,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,MAAM,MAAM,CAAA;KAAE,GAAG,MAAM,GACvG,OAAO,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,MAAM,CAAC,GACxE,KAAK,CAAA;IAET;;;;;;OAMG;IACH,KAAY,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,CAAA;IAE7G;;;;;OAKG;IACH,KAAY,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,CAAA;IAE3G;;;;;;OAMG;IACH,KAAY,QAAQ,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,CAAA;CAC/G"}
|
package/dist/LayerMap.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import * as Context from "./Context.js";
|
|
13
13
|
import * as Effect from "./Effect.js";
|
|
14
14
|
import { identity } from "./Function.js";
|
|
15
|
+
import { getStackTraceLimit, setStackTraceLimit } from "./internal/stackTraceLimit.js";
|
|
15
16
|
import * as Layer from "./Layer.js";
|
|
16
17
|
import * as RcMap from "./RcMap.js";
|
|
17
18
|
import * as Scope from "./Scope.js";
|
|
@@ -171,10 +172,10 @@ export const fromRecord = (layers, options) => make(key => layers[key], {
|
|
|
171
172
|
*/
|
|
172
173
|
export const Service = () => (id, options) => {
|
|
173
174
|
const Err = globalThis.Error;
|
|
174
|
-
const limit =
|
|
175
|
-
|
|
175
|
+
const limit = getStackTraceLimit();
|
|
176
|
+
setStackTraceLimit(2);
|
|
176
177
|
const creationError = new Err();
|
|
177
|
-
|
|
178
|
+
setStackTraceLimit(limit);
|
|
178
179
|
function TagClass() {}
|
|
179
180
|
const TagClass_ = TagClass;
|
|
180
181
|
Object.setPrototypeOf(TagClass, Object.getPrototypeOf(Context.Service(id)));
|
package/dist/LayerMap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerMap.js","names":["Context","Effect","identity","Layer","RcMap","Scope","TypeId","make","fnUntraced","lookup","options","context","memoMap","CurrentMemoMap","getOrCreate","rcMap","key","contextWith","_","buildWithMemoMap","get","idleTimeToLive","effectContext","contextEffect","invalidate","fromRecord","layers","preloadKeys","preload","Object","keys","undefined","Service","id","Err","globalThis","Error","limit","
|
|
1
|
+
{"version":3,"file":"LayerMap.js","names":["Context","Effect","identity","getStackTraceLimit","setStackTraceLimit","Layer","RcMap","Scope","TypeId","make","fnUntraced","lookup","options","context","memoMap","CurrentMemoMap","getOrCreate","rcMap","key","contextWith","_","buildWithMemoMap","get","idleTimeToLive","effectContext","contextEffect","invalidate","fromRecord","layers","preloadKeys","preload","Object","keys","undefined","Service","id","Err","globalThis","Error","limit","creationError","TagClass","TagClass_","setPrototypeOf","getPrototypeOf","defineProperty","stack","layerNoDeps","effect","layer","dependencies","length","provide","unwrap","map","layerMap","flatMap"],"sources":["../src/LayerMap.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,OAAO,KAAKA,OAAO,MAAM,cAAc;AAEvC,OAAO,KAAKC,MAAM,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AO,CAAQ,CACtD;EACD8B,SAAS,CAACO,KAAK,GAAGrC,OAAO,CAACsC,YAAY,IAAItC,OAAO,CAACsC,YAAY,CAACC,MAAM,GAAG,CAAC,GACvE9C,KAAK,CAAC+C,OAAO,CAACV,SAAS,CAACK,WAAW,EAAEnC,OAAO,CAACsC,YAAmB,CAAC,GACjER,SAAS,CAACK,WAAW;EAEvBL,SAAS,CAACpB,GAAG,GAAIJ,GAAW,IAAKb,KAAK,CAACgD,MAAM,CAACpD,MAAM,CAACqD,GAAG,CAACZ,SAAS,EAAGa,QAAQ,IAAKA,QAAQ,CAACjC,GAAG,CAACJ,GAAG,CAAC,CAAC,CAAC;EACrGwB,SAAS,CAACjB,aAAa,GAAIP,GAAW,IAAKjB,MAAM,CAACuD,OAAO,CAACd,SAAS,EAAGa,QAAQ,IAAKA,QAAQ,CAAC9B,aAAa,CAACP,GAAG,CAAC,CAAC;EAC/GwB,SAAS,CAAChB,UAAU,GAAIR,GAAW,IAAKjB,MAAM,CAACuD,OAAO,CAACd,SAAS,EAAGa,QAAQ,IAAKA,QAAQ,CAAC7B,UAAU,CAACR,GAAG,CAAC,CAAC;EAEzG,OAAOuB,QAAe;AACxB,CAAC","ignoreList":[]}
|
package/dist/Logger.d.ts
CHANGED
|
@@ -347,7 +347,7 @@ export declare const make: <Message, Output>(log: (options: Options<Message>) =>
|
|
|
347
347
|
/**
|
|
348
348
|
* The default logging implementation used by the Effect runtime.
|
|
349
349
|
*
|
|
350
|
-
* **Example** (
|
|
350
|
+
* **Example** (Referencing the default logger)
|
|
351
351
|
*
|
|
352
352
|
* ```ts
|
|
353
353
|
* import { Effect, Logger } from "effect"
|
package/dist/Logger.js
CHANGED
|
@@ -357,7 +357,7 @@ export const make = effect.loggerMake;
|
|
|
357
357
|
/**
|
|
358
358
|
* The default logging implementation used by the Effect runtime.
|
|
359
359
|
*
|
|
360
|
-
* **Example** (
|
|
360
|
+
* **Example** (Referencing the default logger)
|
|
361
361
|
*
|
|
362
362
|
* ```ts
|
|
363
363
|
* import { Effect, Logger } from "effect"
|
package/dist/Match.d.ts
CHANGED
|
@@ -568,7 +568,7 @@ export declare const typeTags: {
|
|
|
568
568
|
* **Important:** This function must be the first step in the matcher pipeline.
|
|
569
569
|
* If used later, TypeScript will not enforce type consistency correctly.
|
|
570
570
|
*
|
|
571
|
-
* **Example** (Validating
|
|
571
|
+
* **Example** (Validating return type consistency)
|
|
572
572
|
*
|
|
573
573
|
* ```ts
|
|
574
574
|
* import { Match } from "effect"
|
|
@@ -604,7 +604,7 @@ export declare const withReturnType: <Ret>() => <I, F, R, A, Pr, _>(self: Matche
|
|
|
604
604
|
* pattern matches, the associated function is executed and the matched input is
|
|
605
605
|
* removed from the remaining cases tracked by the matcher.
|
|
606
606
|
*
|
|
607
|
-
* **Example** (Matching with
|
|
607
|
+
* **Example** (Matching with values and predicates)
|
|
608
608
|
*
|
|
609
609
|
* ```ts
|
|
610
610
|
* import { Match } from "effect"
|
|
@@ -912,7 +912,7 @@ export declare const discriminatorsExhaustive: <D extends string>(field: D) => <
|
|
|
912
912
|
* `"_tag"` as their discriminator field. Use {@link discriminator} for a
|
|
913
913
|
* different discriminator field.
|
|
914
914
|
*
|
|
915
|
-
* **Example** (Matching a
|
|
915
|
+
* **Example** (Matching a discriminated union by tag)
|
|
916
916
|
*
|
|
917
917
|
* ```ts
|
|
918
918
|
* import { Match } from "effect"
|
|
@@ -1068,7 +1068,7 @@ export declare const tagsExhaustive: <R, Ret, P extends {
|
|
|
1068
1068
|
* Any excluded value bypasses the provided function and continues matching
|
|
1069
1069
|
* through later cases.
|
|
1070
1070
|
*
|
|
1071
|
-
* **Example** (Ignoring a
|
|
1071
|
+
* **Example** (Ignoring a specific value)
|
|
1072
1072
|
*
|
|
1073
1073
|
* ```ts
|
|
1074
1074
|
* import { Match } from "effect"
|
|
@@ -1706,7 +1706,7 @@ export declare const instanceOfUnsafe: <A extends abstract new (...args: any) =>
|
|
|
1706
1706
|
* `default` clause in a `switch` statement or the final `else` in an `if-else`
|
|
1707
1707
|
* chain.
|
|
1708
1708
|
*
|
|
1709
|
-
* **Example** (Providing a
|
|
1709
|
+
* **Example** (Providing a default value when no patterns match)
|
|
1710
1710
|
*
|
|
1711
1711
|
* ```ts
|
|
1712
1712
|
* import { Match } from "effect"
|
|
@@ -1793,7 +1793,7 @@ export declare const orElseAbsurd: <I, R, RA, A, Pr, Ret>(self: Matcher<I, R, RA
|
|
|
1793
1793
|
* unmatched case should be explicitly handled rather than returning a default
|
|
1794
1794
|
* value or throwing an error.
|
|
1795
1795
|
*
|
|
1796
|
-
* **Example** (Extracting a
|
|
1796
|
+
* **Example** (Extracting a user role with `Match.result`)
|
|
1797
1797
|
*
|
|
1798
1798
|
* ```ts
|
|
1799
1799
|
* import { Match } from "effect"
|
|
@@ -1836,7 +1836,7 @@ export declare const result: <I, F, R, A, Pr, Ret>(self: Matcher<I, F, R, A, Pr,
|
|
|
1836
1836
|
* handled explicitly rather than throwing an error or returning a default
|
|
1837
1837
|
* value.
|
|
1838
1838
|
*
|
|
1839
|
-
* **Example** (Extracting a
|
|
1839
|
+
* **Example** (Extracting a user role with `Match.option`)
|
|
1840
1840
|
*
|
|
1841
1841
|
* ```ts
|
|
1842
1842
|
* import { Match } from "effect"
|
|
@@ -1877,7 +1877,7 @@ export declare const option: <I, F, R, A, Pr, Ret>(self: Matcher<I, F, R, A, Pr,
|
|
|
1877
1877
|
* If any case is still unmatched, the matcher does not type-check as
|
|
1878
1878
|
* exhaustive.
|
|
1879
1879
|
*
|
|
1880
|
-
* **Example** (Ensuring
|
|
1880
|
+
* **Example** (Ensuring all cases are covered)
|
|
1881
1881
|
*
|
|
1882
1882
|
* ```ts
|
|
1883
1883
|
* import { Match } from "effect"
|
package/dist/Match.js
CHANGED
|
@@ -192,7 +192,7 @@ export const typeTags = internal.typeTags;
|
|
|
192
192
|
* **Important:** This function must be the first step in the matcher pipeline.
|
|
193
193
|
* If used later, TypeScript will not enforce type consistency correctly.
|
|
194
194
|
*
|
|
195
|
-
* **Example** (Validating
|
|
195
|
+
* **Example** (Validating return type consistency)
|
|
196
196
|
*
|
|
197
197
|
* ```ts
|
|
198
198
|
* import { Match } from "effect"
|
|
@@ -228,7 +228,7 @@ export const withReturnType = internal.withReturnType;
|
|
|
228
228
|
* pattern matches, the associated function is executed and the matched input is
|
|
229
229
|
* removed from the remaining cases tracked by the matcher.
|
|
230
230
|
*
|
|
231
|
-
* **Example** (Matching with
|
|
231
|
+
* **Example** (Matching with values and predicates)
|
|
232
232
|
*
|
|
233
233
|
* ```ts
|
|
234
234
|
* import { Match } from "effect"
|
|
@@ -528,7 +528,7 @@ export const discriminatorsExhaustive = internal.discriminatorsExhaustive;
|
|
|
528
528
|
* `"_tag"` as their discriminator field. Use {@link discriminator} for a
|
|
529
529
|
* different discriminator field.
|
|
530
530
|
*
|
|
531
|
-
* **Example** (Matching a
|
|
531
|
+
* **Example** (Matching a discriminated union by tag)
|
|
532
532
|
*
|
|
533
533
|
* ```ts
|
|
534
534
|
* import { Match } from "effect"
|
|
@@ -676,7 +676,7 @@ export const tagsExhaustive = internal.tagsExhaustive;
|
|
|
676
676
|
* Any excluded value bypasses the provided function and continues matching
|
|
677
677
|
* through later cases.
|
|
678
678
|
*
|
|
679
|
-
* **Example** (Ignoring a
|
|
679
|
+
* **Example** (Ignoring a specific value)
|
|
680
680
|
*
|
|
681
681
|
* ```ts
|
|
682
682
|
* import { Match } from "effect"
|
|
@@ -1312,7 +1312,7 @@ export const instanceOfUnsafe = internal.instanceOf;
|
|
|
1312
1312
|
* `default` clause in a `switch` statement or the final `else` in an `if-else`
|
|
1313
1313
|
* chain.
|
|
1314
1314
|
*
|
|
1315
|
-
* **Example** (Providing a
|
|
1315
|
+
* **Example** (Providing a default value when no patterns match)
|
|
1316
1316
|
*
|
|
1317
1317
|
* ```ts
|
|
1318
1318
|
* import { Match } from "effect"
|
|
@@ -1400,7 +1400,7 @@ export const orElseAbsurd = internal.orElseAbsurd;
|
|
|
1400
1400
|
* unmatched case should be explicitly handled rather than returning a default
|
|
1401
1401
|
* value or throwing an error.
|
|
1402
1402
|
*
|
|
1403
|
-
* **Example** (Extracting a
|
|
1403
|
+
* **Example** (Extracting a user role with `Match.result`)
|
|
1404
1404
|
*
|
|
1405
1405
|
* ```ts
|
|
1406
1406
|
* import { Match } from "effect"
|
|
@@ -1443,7 +1443,7 @@ export const result = internal.result;
|
|
|
1443
1443
|
* handled explicitly rather than throwing an error or returning a default
|
|
1444
1444
|
* value.
|
|
1445
1445
|
*
|
|
1446
|
-
* **Example** (Extracting a
|
|
1446
|
+
* **Example** (Extracting a user role with `Match.option`)
|
|
1447
1447
|
*
|
|
1448
1448
|
* ```ts
|
|
1449
1449
|
* import { Match } from "effect"
|
|
@@ -1484,7 +1484,7 @@ export const option = internal.option;
|
|
|
1484
1484
|
* If any case is still unmatched, the matcher does not type-check as
|
|
1485
1485
|
* exhaustive.
|
|
1486
1486
|
*
|
|
1487
|
-
* **Example** (Ensuring
|
|
1487
|
+
* **Example** (Ensuring all cases are covered)
|
|
1488
1488
|
*
|
|
1489
1489
|
* ```ts
|
|
1490
1490
|
* import { Match } from "effect"
|
package/dist/Metric.d.ts
CHANGED
|
@@ -1554,7 +1554,7 @@ export declare namespace Metric {
|
|
|
1554
1554
|
/**
|
|
1555
1555
|
* Service key for the current metric attributes context.
|
|
1556
1556
|
*
|
|
1557
|
-
* **Example** (
|
|
1557
|
+
* **Example** (Accessing the current metric attributes key)
|
|
1558
1558
|
*
|
|
1559
1559
|
* ```ts
|
|
1560
1560
|
* import { Data, Effect, Metric } from "effect"
|
|
@@ -3551,7 +3551,7 @@ export declare const exponentialBoundaries: (options: {
|
|
|
3551
3551
|
/**
|
|
3552
3552
|
* Service key for the fiber runtime metrics service.
|
|
3553
3553
|
*
|
|
3554
|
-
* **Example** (
|
|
3554
|
+
* **Example** (Accessing the fiber runtime metrics key)
|
|
3555
3555
|
*
|
|
3556
3556
|
* ```ts
|
|
3557
3557
|
* import { Data, Effect, Layer, Metric } from "effect"
|
|
@@ -3691,7 +3691,7 @@ export declare const FiberRuntimeMetrics: Context.Reference<FiberRuntimeMetricsS
|
|
|
3691
3691
|
/**
|
|
3692
3692
|
* Default implementation of the fiber runtime metrics service.
|
|
3693
3693
|
*
|
|
3694
|
-
* **Example** (
|
|
3694
|
+
* **Example** (Accessing the default fiber metrics implementation)
|
|
3695
3695
|
*
|
|
3696
3696
|
* ```ts
|
|
3697
3697
|
* import { Data, Effect, Layer, Metric } from "effect"
|
package/dist/Metric.js
CHANGED
|
@@ -24,7 +24,7 @@ import * as _String from "./String.js";
|
|
|
24
24
|
/**
|
|
25
25
|
* Service key for the current metric attributes context.
|
|
26
26
|
*
|
|
27
|
-
* **Example** (
|
|
27
|
+
* **Example** (Accessing the current metric attributes key)
|
|
28
28
|
*
|
|
29
29
|
* ```ts
|
|
30
30
|
* import { Data, Effect, Metric } from "effect"
|
|
@@ -1675,7 +1675,7 @@ const fiberFailures = /*#__PURE__*/counter("child_fiber_failures", {
|
|
|
1675
1675
|
/**
|
|
1676
1676
|
* Service key for the fiber runtime metrics service.
|
|
1677
1677
|
*
|
|
1678
|
-
* **Example** (
|
|
1678
|
+
* **Example** (Accessing the fiber runtime metrics key)
|
|
1679
1679
|
*
|
|
1680
1680
|
* ```ts
|
|
1681
1681
|
* import { Data, Effect, Layer, Metric } from "effect"
|
|
@@ -1774,7 +1774,7 @@ export const FiberRuntimeMetrics = /*#__PURE__*/Context.Reference(InternalMetric
|
|
|
1774
1774
|
/**
|
|
1775
1775
|
* Default implementation of the fiber runtime metrics service.
|
|
1776
1776
|
*
|
|
1777
|
-
* **Example** (
|
|
1777
|
+
* **Example** (Accessing the default fiber metrics implementation)
|
|
1778
1778
|
*
|
|
1779
1779
|
* ```ts
|
|
1780
1780
|
* import { Data, Effect, Layer, Metric } from "effect"
|
package/dist/Optic.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ import type { IsUnion } from "./Types.ts";
|
|
|
32
32
|
* - `get(set(a)) === a` and `set(get(s))` equals `s` (round-trip laws).
|
|
33
33
|
* - Extends both {@link Lens} and {@link Prism}.
|
|
34
34
|
*
|
|
35
|
-
* **Example** (Celsius
|
|
35
|
+
* **Example** (Converting between Celsius and Fahrenheit)
|
|
36
36
|
*
|
|
37
37
|
* ```ts
|
|
38
38
|
* import { Optic } from "effect"
|
|
@@ -70,7 +70,7 @@ export interface Iso<in out S, in out A> extends Lens<S, A>, Prism<S, A> {
|
|
|
70
70
|
*
|
|
71
71
|
* The returned optic can be composed with any other optic.
|
|
72
72
|
*
|
|
73
|
-
* **Example** (
|
|
73
|
+
* **Example** (Wrapping and unwrapping a branded type)
|
|
74
74
|
*
|
|
75
75
|
* ```ts
|
|
76
76
|
* import { Optic } from "effect"
|
|
@@ -111,7 +111,7 @@ export declare function makeIso<S, A>(get: (s: S) => A, set: (a: A) => S): Iso<S
|
|
|
111
111
|
* - Composing a Lens with a {@link Prism} or {@link Optional} produces an
|
|
112
112
|
* {@link Optional}.
|
|
113
113
|
*
|
|
114
|
-
* **Example** (
|
|
114
|
+
* **Example** (Focusing on a struct field)
|
|
115
115
|
*
|
|
116
116
|
* ```ts
|
|
117
117
|
* import { Optic } from "effect"
|
|
@@ -147,7 +147,7 @@ export interface Lens<in out S, in out A> extends Optional<S, A> {
|
|
|
147
147
|
* - `replace(a, s)` should return a structurally new `S` with `a` in place
|
|
148
148
|
* of the old focus.
|
|
149
149
|
*
|
|
150
|
-
* **Example** (
|
|
150
|
+
* **Example** (Focusing on the first element of a pair)
|
|
151
151
|
*
|
|
152
152
|
* ```ts
|
|
153
153
|
* import { Optic } from "effect"
|
|
@@ -190,7 +190,7 @@ export declare function makeLens<S, A>(get: (s: S) => A, replace: (a: A, s: S) =
|
|
|
190
190
|
* - Composing two Prisms produces a Prism; composing a Prism with a
|
|
191
191
|
* {@link Lens} produces an {@link Optional}.
|
|
192
192
|
*
|
|
193
|
-
* **Example** (
|
|
193
|
+
* **Example** (Narrowing a tagged union)
|
|
194
194
|
*
|
|
195
195
|
* ```ts
|
|
196
196
|
* import { Optic, Result } from "effect"
|
|
@@ -230,7 +230,7 @@ export interface Prism<in out S, in out A> extends Optional<S, A> {
|
|
|
230
230
|
*
|
|
231
231
|
* - `getResult` should return `Result.fail(message)` on mismatch.
|
|
232
232
|
*
|
|
233
|
-
* **Example** (
|
|
233
|
+
* **Example** (Parsing a string to a number)
|
|
234
234
|
*
|
|
235
235
|
* ```ts
|
|
236
236
|
* import { Optic, Result } from "effect"
|
|
@@ -272,7 +272,7 @@ export declare function makePrism<S, A>(getResult: (s: S) => Result.Result<A, st
|
|
|
272
272
|
* any check fails.
|
|
273
273
|
* - `set` is identity — the value passes through unchanged.
|
|
274
274
|
*
|
|
275
|
-
* **Example** (positive integer prism)
|
|
275
|
+
* **Example** (Creating a positive integer prism)
|
|
276
276
|
*
|
|
277
277
|
* ```ts
|
|
278
278
|
* import { Optic, Result, Schema } from "effect"
|
|
@@ -359,7 +359,7 @@ type ForbidUnion<A, Message extends string> = IsUnion<A> extends true ? [Message
|
|
|
359
359
|
* - `modify(f)` returns the original `s` on failure (never throws).
|
|
360
360
|
* - All operations are pure; inputs are never mutated.
|
|
361
361
|
*
|
|
362
|
-
* **Example** (
|
|
362
|
+
* **Example** (Focusing on an optional record key)
|
|
363
363
|
*
|
|
364
364
|
* ```ts
|
|
365
365
|
* import { Optic, Result } from "effect"
|
|
@@ -407,7 +407,7 @@ export interface Optional<in out S, in out A> {
|
|
|
407
407
|
* Composes this optic with another. The result type is the weakest of
|
|
408
408
|
* the two: Iso + Iso = Iso, Lens + Prism = Optional, etc.
|
|
409
409
|
*
|
|
410
|
-
* **Example** (
|
|
410
|
+
* **Example** (Composing a lens with a prism)
|
|
411
411
|
*
|
|
412
412
|
* ```ts
|
|
413
413
|
* import { Optic, Option } from "effect"
|
|
@@ -428,7 +428,7 @@ export interface Optional<in out S, in out A> {
|
|
|
428
428
|
* Returns a function `(s: S) => S` that applies `f` to the focused value.
|
|
429
429
|
* If the optic cannot focus, the original `s` is returned unchanged.
|
|
430
430
|
*
|
|
431
|
-
* **Example** (
|
|
431
|
+
* **Example** (Incrementing a nested field)
|
|
432
432
|
*
|
|
433
433
|
* ```ts
|
|
434
434
|
* import { Optic } from "effect"
|
|
@@ -451,7 +451,7 @@ export interface Optional<in out S, in out A> {
|
|
|
451
451
|
* - On an {@link Optional}, returns an Optional.
|
|
452
452
|
* - Does **not** work on union types (compile error).
|
|
453
453
|
*
|
|
454
|
-
* **Example** (
|
|
454
|
+
* **Example** (Drilling into nested structs)
|
|
455
455
|
*
|
|
456
456
|
* ```ts
|
|
457
457
|
* import { Optic } from "effect"
|
|
@@ -474,7 +474,7 @@ export interface Optional<in out S, in out A> {
|
|
|
474
474
|
* - The focus type becomes `A[Key] | undefined`.
|
|
475
475
|
* - Does **not** work on union types (compile error).
|
|
476
476
|
*
|
|
477
|
-
* **Example** (
|
|
477
|
+
* **Example** (Deleting an optional key)
|
|
478
478
|
*
|
|
479
479
|
* ```ts
|
|
480
480
|
* import { Optic } from "effect"
|
|
@@ -500,7 +500,7 @@ export interface Optional<in out S, in out A> {
|
|
|
500
500
|
* - On a {@link Prism}, returns a Prism.
|
|
501
501
|
* - On an {@link Optional}, returns an Optional.
|
|
502
502
|
*
|
|
503
|
-
* **Example** (only
|
|
503
|
+
* **Example** (Focusing only on positive numbers)
|
|
504
504
|
*
|
|
505
505
|
* ```ts
|
|
506
506
|
* import { Optic, Result, Schema } from "effect"
|
|
@@ -527,7 +527,7 @@ export interface Optional<in out S, in out A> {
|
|
|
527
527
|
* - On an {@link Optional}, returns an Optional.
|
|
528
528
|
* - Pass optional `annotations` to customize the error message.
|
|
529
529
|
*
|
|
530
|
-
* **Example** (
|
|
530
|
+
* **Example** (Narrowing a union)
|
|
531
531
|
*
|
|
532
532
|
* ```ts
|
|
533
533
|
* import { Optic, Result } from "effect"
|
|
@@ -558,7 +558,7 @@ export interface Optional<in out S, in out A> {
|
|
|
558
558
|
* - On an {@link Optional}, returns an Optional.
|
|
559
559
|
* - Shorthand for `.refine(s => s._tag === tag)`.
|
|
560
560
|
*
|
|
561
|
-
* **Example** (
|
|
561
|
+
* **Example** (Focusing a tagged variant)
|
|
562
562
|
*
|
|
563
563
|
* ```ts
|
|
564
564
|
* import { Optic, Result } from "effect"
|
|
@@ -600,7 +600,7 @@ export interface Optional<in out S, in out A> {
|
|
|
600
600
|
* - Always returns an {@link Optional}.
|
|
601
601
|
* - Does **not** work on union types (compile error).
|
|
602
602
|
*
|
|
603
|
-
* **Example** (
|
|
603
|
+
* **Example** (Accessing records safely)
|
|
604
604
|
*
|
|
605
605
|
* ```ts
|
|
606
606
|
* import { Optic, Result } from "effect"
|
|
@@ -627,7 +627,7 @@ export interface Optional<in out S, in out A> {
|
|
|
627
627
|
* - On an {@link Optional}, returns an Optional.
|
|
628
628
|
* - Does **not** work on union types (compile error).
|
|
629
629
|
*
|
|
630
|
-
* **Example** (
|
|
630
|
+
* **Example** (Picking keys)
|
|
631
631
|
*
|
|
632
632
|
* ```ts
|
|
633
633
|
* import { Optic } from "effect"
|
|
@@ -653,7 +653,7 @@ export interface Optional<in out S, in out A> {
|
|
|
653
653
|
* - On an {@link Optional}, returns an Optional.
|
|
654
654
|
* - Does **not** work on union types (compile error).
|
|
655
655
|
*
|
|
656
|
-
* **Example** (
|
|
656
|
+
* **Example** (Omitting keys)
|
|
657
657
|
*
|
|
658
658
|
* ```ts
|
|
659
659
|
* import { Optic } from "effect"
|
|
@@ -676,7 +676,7 @@ export interface Optional<in out S, in out A> {
|
|
|
676
676
|
* Filters out `undefined` from the focus, producing a {@link Prism}.
|
|
677
677
|
* `getResult` fails when the focus is `undefined`.
|
|
678
678
|
*
|
|
679
|
-
* **Example** (
|
|
679
|
+
* **Example** (Filtering undefined values)
|
|
680
680
|
*
|
|
681
681
|
* ```ts
|
|
682
682
|
* import { Optic, Result } from "effect"
|
|
@@ -709,7 +709,7 @@ export interface Optional<in out S, in out A> {
|
|
|
709
709
|
* `getResult` and writes them back in order. Fails with a
|
|
710
710
|
* length-mismatch error if counts differ.
|
|
711
711
|
*
|
|
712
|
-
* **Example** (
|
|
712
|
+
* **Example** (Incrementing liked posts)
|
|
713
713
|
*
|
|
714
714
|
* ```ts
|
|
715
715
|
* import { Optic, Schema } from "effect"
|
|
@@ -747,7 +747,7 @@ export interface Optional<in out S, in out A> {
|
|
|
747
747
|
* Unlike `.modify()`, which operates on the whole array, `modifyAll`
|
|
748
748
|
* maps `f` over each individual element.
|
|
749
749
|
*
|
|
750
|
-
* **Example** (
|
|
750
|
+
* **Example** (Doubling all focused values)
|
|
751
751
|
*
|
|
752
752
|
* ```ts
|
|
753
753
|
* import { Optic, Schema } from "effect"
|
|
@@ -783,7 +783,7 @@ export interface Optional<in out S, in out A> {
|
|
|
783
783
|
* - `set` should return `Result.fail(message)` when the update cannot be
|
|
784
784
|
* applied.
|
|
785
785
|
*
|
|
786
|
-
* **Example** (
|
|
786
|
+
* **Example** (Accessing record keys safely)
|
|
787
787
|
*
|
|
788
788
|
* ```ts
|
|
789
789
|
* import { Optic, Result } from "effect"
|
|
@@ -829,7 +829,7 @@ export declare function makeOptional<S, A>(getResult: (s: S) => Result.Result<A,
|
|
|
829
829
|
* - Use `.modifyAll(f)` to map a function over every focused element.
|
|
830
830
|
* - Use {@link getAll} to extract all focused elements as a plain array.
|
|
831
831
|
*
|
|
832
|
-
* **Example** (
|
|
832
|
+
* **Example** (Traversing array elements with a filter)
|
|
833
833
|
*
|
|
834
834
|
* ```ts
|
|
835
835
|
* import { Optic, Schema } from "effect"
|
|
@@ -868,7 +868,7 @@ export interface Traversal<in out S, in out A> extends Optional<S, ReadonlyArray
|
|
|
868
868
|
* - Returns an empty array when the traversal cannot focus.
|
|
869
869
|
* - Always returns a fresh array (safe to mutate).
|
|
870
870
|
*
|
|
871
|
-
* **Example** (
|
|
871
|
+
* **Example** (Collecting positive numbers)
|
|
872
872
|
*
|
|
873
873
|
* ```ts
|
|
874
874
|
* import { Optic, Schema } from "effect"
|
|
@@ -907,7 +907,7 @@ export declare function getAll<S, A>(traversal: Traversal<S, A>): (s: S) => Arra
|
|
|
907
907
|
* - `set(a)` returns `a`.
|
|
908
908
|
* - Singleton — every call returns the same instance.
|
|
909
909
|
*
|
|
910
|
-
* **Example** (
|
|
910
|
+
* **Example** (Starting an optic chain)
|
|
911
911
|
*
|
|
912
912
|
* ```ts
|
|
913
913
|
* import { Optic } from "effect"
|
|
@@ -941,7 +941,7 @@ export declare function id<S>(): Iso<S, S>;
|
|
|
941
941
|
* - `set` uses `Object.fromEntries`.
|
|
942
942
|
* - Round-trip is lossless for `Record<string, A>`.
|
|
943
943
|
*
|
|
944
|
-
* **Example** (
|
|
944
|
+
* **Example** (Traversing record values)
|
|
945
945
|
*
|
|
946
946
|
* ```ts
|
|
947
947
|
* import { Optic, Schema } from "effect"
|
|
@@ -975,7 +975,7 @@ export declare function entries<A>(): Iso<Record<string, A>, ReadonlyArray<reado
|
|
|
975
975
|
* - `getResult` fails with an error message when the option is `None`.
|
|
976
976
|
* - `set(a)` wraps `a` in `Option.some(a)`.
|
|
977
977
|
*
|
|
978
|
-
* **Example** (
|
|
978
|
+
* **Example** (Accessing Some value)
|
|
979
979
|
*
|
|
980
980
|
* ```ts
|
|
981
981
|
* import { Optic, Option, Result } from "effect"
|
|
@@ -1012,7 +1012,7 @@ export declare function some<A>(): Prism<Option.Option<A>, A>;
|
|
|
1012
1012
|
* - `getResult` fails when the option is `Some`.
|
|
1013
1013
|
* - `set(undefined)` produces `Option.none()`.
|
|
1014
1014
|
*
|
|
1015
|
-
* **Example** (
|
|
1015
|
+
* **Example** (Matching None)
|
|
1016
1016
|
*
|
|
1017
1017
|
* ```ts
|
|
1018
1018
|
* import { Optic, Option, Result } from "effect"
|
|
@@ -1046,7 +1046,7 @@ export declare function none<A>(): Prism<Option.Option<A>, undefined>;
|
|
|
1046
1046
|
* - `getResult` fails when the result is a `Failure`.
|
|
1047
1047
|
* - `set(a)` produces `Result.succeed(a)`.
|
|
1048
1048
|
*
|
|
1049
|
-
* **Example** (
|
|
1049
|
+
* **Example** (Accessing success)
|
|
1050
1050
|
*
|
|
1051
1051
|
* ```ts
|
|
1052
1052
|
* import { Optic, Result } from "effect"
|
|
@@ -1080,7 +1080,7 @@ export declare function success<A, E>(): Prism<Result.Result<A, E>, A>;
|
|
|
1080
1080
|
* - `getResult` fails when the result is a `Success`.
|
|
1081
1081
|
* - `set(e)` produces `Result.fail(e)`.
|
|
1082
1082
|
*
|
|
1083
|
-
* **Example** (
|
|
1083
|
+
* **Example** (Accessing failure)
|
|
1084
1084
|
*
|
|
1085
1085
|
* ```ts
|
|
1086
1086
|
* import { Optic, Result } from "effect"
|
package/dist/Optic.js
CHANGED
|
@@ -30,7 +30,7 @@ import * as Struct from "./Struct.js";
|
|
|
30
30
|
*
|
|
31
31
|
* The returned optic can be composed with any other optic.
|
|
32
32
|
*
|
|
33
|
-
* **Example** (
|
|
33
|
+
* **Example** (Wrapping and unwrapping a branded type)
|
|
34
34
|
*
|
|
35
35
|
* ```ts
|
|
36
36
|
* import { Optic } from "effect"
|
|
@@ -70,7 +70,7 @@ export function makeIso(get, set) {
|
|
|
70
70
|
* - `replace(a, s)` should return a structurally new `S` with `a` in place
|
|
71
71
|
* of the old focus.
|
|
72
72
|
*
|
|
73
|
-
* **Example** (
|
|
73
|
+
* **Example** (Focusing on the first element of a pair)
|
|
74
74
|
*
|
|
75
75
|
* ```ts
|
|
76
76
|
* import { Optic } from "effect"
|
|
@@ -108,7 +108,7 @@ export function makeLens(get, replace) {
|
|
|
108
108
|
*
|
|
109
109
|
* - `getResult` should return `Result.fail(message)` on mismatch.
|
|
110
110
|
*
|
|
111
|
-
* **Example** (
|
|
111
|
+
* **Example** (Parsing a string to a number)
|
|
112
112
|
*
|
|
113
113
|
* ```ts
|
|
114
114
|
* import { Optic, Result } from "effect"
|
|
@@ -152,7 +152,7 @@ export function makePrism(getResult, set) {
|
|
|
152
152
|
* any check fails.
|
|
153
153
|
* - `set` is identity — the value passes through unchanged.
|
|
154
154
|
*
|
|
155
|
-
* **Example** (positive integer prism)
|
|
155
|
+
* **Example** (Creating a positive integer prism)
|
|
156
156
|
*
|
|
157
157
|
* ```ts
|
|
158
158
|
* import { Optic, Result, Schema } from "effect"
|
|
@@ -294,7 +294,7 @@ function compose(a, b) {
|
|
|
294
294
|
* - `set` should return `Result.fail(message)` when the update cannot be
|
|
295
295
|
* applied.
|
|
296
296
|
*
|
|
297
|
-
* **Example** (
|
|
297
|
+
* **Example** (Accessing record keys safely)
|
|
298
298
|
*
|
|
299
299
|
* ```ts
|
|
300
300
|
* import { Optic, Result } from "effect"
|
|
@@ -649,7 +649,7 @@ function getCompositionTag(a, b) {
|
|
|
649
649
|
* - Returns an empty array when the traversal cannot focus.
|
|
650
650
|
* - Always returns a fresh array (safe to mutate).
|
|
651
651
|
*
|
|
652
|
-
* **Example** (
|
|
652
|
+
* **Example** (Collecting positive numbers)
|
|
653
653
|
*
|
|
654
654
|
* ```ts
|
|
655
655
|
* import { Optic, Schema } from "effect"
|
|
@@ -697,7 +697,7 @@ const identityIso = /*#__PURE__*/make(identityNode);
|
|
|
697
697
|
* - `set(a)` returns `a`.
|
|
698
698
|
* - Singleton — every call returns the same instance.
|
|
699
699
|
*
|
|
700
|
-
* **Example** (
|
|
700
|
+
* **Example** (Starting an optic chain)
|
|
701
701
|
*
|
|
702
702
|
* ```ts
|
|
703
703
|
* import { Optic } from "effect"
|
|
@@ -733,7 +733,7 @@ export function id() {
|
|
|
733
733
|
* - `set` uses `Object.fromEntries`.
|
|
734
734
|
* - Round-trip is lossless for `Record<string, A>`.
|
|
735
735
|
*
|
|
736
|
-
* **Example** (
|
|
736
|
+
* **Example** (Traversing record values)
|
|
737
737
|
*
|
|
738
738
|
* ```ts
|
|
739
739
|
* import { Optic, Schema } from "effect"
|
|
@@ -769,7 +769,7 @@ export function entries() {
|
|
|
769
769
|
* - `getResult` fails with an error message when the option is `None`.
|
|
770
770
|
* - `set(a)` wraps `a` in `Option.some(a)`.
|
|
771
771
|
*
|
|
772
|
-
* **Example** (
|
|
772
|
+
* **Example** (Accessing Some value)
|
|
773
773
|
*
|
|
774
774
|
* ```ts
|
|
775
775
|
* import { Optic, Option, Result } from "effect"
|
|
@@ -814,7 +814,7 @@ export function some() {
|
|
|
814
814
|
* - `getResult` fails when the option is `Some`.
|
|
815
815
|
* - `set(undefined)` produces `Option.none()`.
|
|
816
816
|
*
|
|
817
|
-
* **Example** (
|
|
817
|
+
* **Example** (Matching None)
|
|
818
818
|
*
|
|
819
819
|
* ```ts
|
|
820
820
|
* import { Optic, Option, Result } from "effect"
|
|
@@ -856,7 +856,7 @@ export function none() {
|
|
|
856
856
|
* - `getResult` fails when the result is a `Failure`.
|
|
857
857
|
* - `set(a)` produces `Result.succeed(a)`.
|
|
858
858
|
*
|
|
859
|
-
* **Example** (
|
|
859
|
+
* **Example** (Accessing success)
|
|
860
860
|
*
|
|
861
861
|
* ```ts
|
|
862
862
|
* import { Optic, Result } from "effect"
|
|
@@ -898,7 +898,7 @@ export function success() {
|
|
|
898
898
|
* - `getResult` fails when the result is a `Success`.
|
|
899
899
|
* - `set(e)` produces `Result.fail(e)`.
|
|
900
900
|
*
|
|
901
|
-
* **Example** (
|
|
901
|
+
* **Example** (Accessing failure)
|
|
902
902
|
*
|
|
903
903
|
* ```ts
|
|
904
904
|
* import { Optic, Result } from "effect"
|