effect 4.0.0-beta.82 → 4.0.0-beta.84

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 (199) hide show
  1. package/dist/Array.d.ts +64 -64
  2. package/dist/Array.js +26 -26
  3. package/dist/Cache.d.ts +1 -1
  4. package/dist/Cache.js +1 -1
  5. package/dist/Cause.d.ts +68 -68
  6. package/dist/Cause.js +47 -47
  7. package/dist/Channel.d.ts +5 -5
  8. package/dist/Channel.js +3 -3
  9. package/dist/Clock.d.ts +1 -1
  10. package/dist/Clock.js +1 -1
  11. package/dist/Combiner.d.ts +9 -9
  12. package/dist/Combiner.js +8 -8
  13. package/dist/Config.d.ts +15 -94
  14. package/dist/Config.d.ts.map +1 -1
  15. package/dist/Config.js +22 -70
  16. package/dist/Config.js.map +1 -1
  17. package/dist/ConfigProvider.d.ts +58 -74
  18. package/dist/ConfigProvider.d.ts.map +1 -1
  19. package/dist/ConfigProvider.js +66 -41
  20. package/dist/ConfigProvider.js.map +1 -1
  21. package/dist/Console.d.ts +1 -1
  22. package/dist/Console.js +1 -1
  23. package/dist/Data.d.ts +15 -15
  24. package/dist/Data.js +3 -3
  25. package/dist/DateTime.d.ts +6 -6
  26. package/dist/DateTime.js +2 -2
  27. package/dist/Duration.d.ts +3 -3
  28. package/dist/Duration.js +3 -3
  29. package/dist/Effect.d.ts +84 -45
  30. package/dist/Effect.d.ts.map +1 -1
  31. package/dist/Effect.js +72 -33
  32. package/dist/Effect.js.map +1 -1
  33. package/dist/Equal.d.ts +7 -7
  34. package/dist/Equal.js +5 -5
  35. package/dist/Equivalence.d.ts +17 -17
  36. package/dist/Equivalence.js +13 -13
  37. package/dist/Exit.d.ts +3 -3
  38. package/dist/Exit.js +3 -3
  39. package/dist/Formatter.d.ts +5 -5
  40. package/dist/Formatter.js +4 -4
  41. package/dist/Function.d.ts +10 -10
  42. package/dist/Function.js +3 -3
  43. package/dist/HashMap.d.ts +3 -3
  44. package/dist/HashMap.js +1 -1
  45. package/dist/Iterable.d.ts +6 -6
  46. package/dist/Iterable.js +2 -2
  47. package/dist/JsonPatch.d.ts +2 -2
  48. package/dist/Layer.d.ts +1 -1
  49. package/dist/Layer.js +1 -1
  50. package/dist/Logger.d.ts +1 -1
  51. package/dist/Logger.js +1 -1
  52. package/dist/Match.d.ts +8 -8
  53. package/dist/Match.js +8 -8
  54. package/dist/Metric.d.ts +3 -3
  55. package/dist/Metric.js +3 -3
  56. package/dist/Optic.d.ts +30 -30
  57. package/dist/Optic.js +12 -12
  58. package/dist/Option.d.ts +7 -7
  59. package/dist/Option.js +7 -7
  60. package/dist/Order.d.ts +23 -23
  61. package/dist/Order.js +20 -20
  62. package/dist/Pool.d.ts +1 -1
  63. package/dist/Pool.js +1 -1
  64. package/dist/Predicate.d.ts +88 -88
  65. package/dist/Predicate.js +47 -47
  66. package/dist/PubSub.d.ts +3 -3
  67. package/dist/PubSub.js +3 -3
  68. package/dist/Reducer.d.ts +1 -1
  69. package/dist/Reducer.js +1 -1
  70. package/dist/Result.d.ts +18 -18
  71. package/dist/Result.js +8 -8
  72. package/dist/Runtime.d.ts +1 -1
  73. package/dist/Runtime.js +1 -1
  74. package/dist/Schema.d.ts +265 -120
  75. package/dist/Schema.d.ts.map +1 -1
  76. package/dist/Schema.js +285 -116
  77. package/dist/Schema.js.map +1 -1
  78. package/dist/SchemaAST.d.ts +1 -1
  79. package/dist/SchemaAST.d.ts.map +1 -1
  80. package/dist/SchemaAST.js +13 -9
  81. package/dist/SchemaAST.js.map +1 -1
  82. package/dist/SchemaGetter.d.ts +48 -48
  83. package/dist/SchemaGetter.js +44 -44
  84. package/dist/SchemaIssue.d.ts +3 -3
  85. package/dist/SchemaIssue.js +3 -3
  86. package/dist/SchemaParser.d.ts +122 -22
  87. package/dist/SchemaParser.d.ts.map +1 -1
  88. package/dist/SchemaParser.js +186 -50
  89. package/dist/SchemaParser.js.map +1 -1
  90. package/dist/SchemaRepresentation.d.ts +1 -1
  91. package/dist/SchemaRepresentation.d.ts.map +1 -1
  92. package/dist/SchemaRepresentation.js +96 -2
  93. package/dist/SchemaRepresentation.js.map +1 -1
  94. package/dist/SchemaTransformation.d.ts +20 -20
  95. package/dist/SchemaTransformation.js +18 -18
  96. package/dist/Stream.d.ts +3 -3
  97. package/dist/Stream.js +2 -2
  98. package/dist/Stream.js.map +1 -1
  99. package/dist/String.d.ts +1 -1
  100. package/dist/String.js +1 -1
  101. package/dist/Struct.d.ts +1 -1
  102. package/dist/Struct.js +1 -1
  103. package/dist/Types.d.ts +13 -13
  104. package/dist/internal/effect.js +23 -10
  105. package/dist/internal/effect.js.map +1 -1
  106. package/dist/internal/schema/cause.d.ts +2 -0
  107. package/dist/internal/schema/cause.d.ts.map +1 -0
  108. package/dist/internal/schema/cause.js +24 -0
  109. package/dist/internal/schema/cause.js.map +1 -0
  110. package/dist/internal/schema/schema.d.ts +8 -4
  111. package/dist/internal/schema/schema.d.ts.map +1 -1
  112. package/dist/internal/schema/schema.js +21 -8
  113. package/dist/internal/schema/schema.js.map +1 -1
  114. package/dist/testing/TestSchema.d.ts +3 -3
  115. package/dist/testing/TestSchema.js +1 -1
  116. package/dist/unstable/ai/AiError.d.ts +1 -1
  117. package/dist/unstable/ai/AiError.js +1 -1
  118. package/dist/unstable/ai/Chat.d.ts +1 -1
  119. package/dist/unstable/ai/Chat.js +1 -1
  120. package/dist/unstable/cli/Prompt.js +2 -2
  121. package/dist/unstable/cli/Prompt.js.map +1 -1
  122. package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
  123. package/dist/unstable/httpapi/HttpApiSchema.d.ts +39 -0
  124. package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
  125. package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
  126. package/dist/unstable/rpc/Rpc.d.ts +1 -1
  127. package/dist/unstable/rpc/Rpc.js +1 -1
  128. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  129. package/dist/unstable/rpc/RpcGroup.js +3 -4
  130. package/dist/unstable/rpc/RpcGroup.js.map +1 -1
  131. package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
  132. package/dist/unstable/sql/SqlResolver.js +15 -2
  133. package/dist/unstable/sql/SqlResolver.js.map +1 -1
  134. package/dist/unstable/workflow/Activity.d.ts +1 -0
  135. package/dist/unstable/workflow/Activity.d.ts.map +1 -1
  136. package/dist/unstable/workflow/Activity.js +1 -0
  137. package/dist/unstable/workflow/Activity.js.map +1 -1
  138. package/dist/unstable/workflow/WorkflowEngine.js +1 -1
  139. package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
  140. package/package.json +1 -1
  141. package/src/Array.ts +65 -65
  142. package/src/Cache.ts +1 -1
  143. package/src/Cause.ts +68 -68
  144. package/src/Channel.ts +5 -5
  145. package/src/Clock.ts +1 -1
  146. package/src/Combiner.ts +9 -9
  147. package/src/Config.ts +40 -108
  148. package/src/ConfigProvider.ts +139 -100
  149. package/src/Console.ts +1 -1
  150. package/src/Data.ts +15 -15
  151. package/src/DateTime.ts +6 -6
  152. package/src/Duration.ts +3 -3
  153. package/src/Effect.ts +89 -45
  154. package/src/Equal.ts +7 -7
  155. package/src/Equivalence.ts +17 -17
  156. package/src/Exit.ts +3 -3
  157. package/src/Formatter.ts +5 -5
  158. package/src/Function.ts +10 -10
  159. package/src/HashMap.ts +3 -3
  160. package/src/Iterable.ts +6 -6
  161. package/src/JsonPatch.ts +2 -2
  162. package/src/Layer.ts +1 -1
  163. package/src/Logger.ts +1 -1
  164. package/src/Match.ts +8 -8
  165. package/src/Metric.ts +3 -3
  166. package/src/Optic.ts +30 -30
  167. package/src/Option.ts +7 -7
  168. package/src/Order.ts +23 -23
  169. package/src/Pool.ts +1 -1
  170. package/src/Predicate.ts +88 -88
  171. package/src/PubSub.ts +3 -3
  172. package/src/Reducer.ts +1 -1
  173. package/src/Result.ts +20 -20
  174. package/src/Runtime.ts +1 -1
  175. package/src/Schema.ts +314 -131
  176. package/src/SchemaAST.ts +20 -11
  177. package/src/SchemaGetter.ts +48 -48
  178. package/src/SchemaIssue.ts +3 -3
  179. package/src/SchemaParser.ts +197 -58
  180. package/src/SchemaRepresentation.ts +73 -3
  181. package/src/SchemaTransformation.ts +20 -20
  182. package/src/Stream.ts +4 -4
  183. package/src/String.ts +1 -1
  184. package/src/Struct.ts +1 -1
  185. package/src/Types.ts +13 -13
  186. package/src/internal/effect.ts +29 -10
  187. package/src/internal/schema/cause.ts +26 -0
  188. package/src/internal/schema/schema.ts +36 -10
  189. package/src/testing/TestSchema.ts +3 -3
  190. package/src/unstable/ai/AiError.ts +1 -1
  191. package/src/unstable/ai/Chat.ts +1 -1
  192. package/src/unstable/cli/Prompt.ts +1 -1
  193. package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
  194. package/src/unstable/httpapi/HttpApiSchema.ts +18 -6
  195. package/src/unstable/rpc/Rpc.ts +1 -1
  196. package/src/unstable/rpc/RpcGroup.ts +3 -4
  197. package/src/unstable/sql/SqlResolver.ts +15 -2
  198. package/src/unstable/workflow/Activity.ts +2 -0
  199. package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/src/SchemaAST.ts CHANGED
@@ -21,6 +21,7 @@ import { memoize } from "./Function.ts"
21
21
  import { effectIsExit, iterateEager } from "./internal/effect.ts"
22
22
  import * as internalRecord from "./internal/record.ts"
23
23
  import * as InternalAnnotations from "./internal/schema/annotations.ts"
24
+ import * as InternalSchemaCause from "./internal/schema/cause.ts"
24
25
  import * as Option from "./Option.ts"
25
26
  import * as Pipeable from "./Pipeable.ts"
26
27
  import * as Predicate from "./Predicate.ts"
@@ -1755,16 +1756,24 @@ const wrapPropertyKeyIssue = (
1755
1756
  key: PropertyKey,
1756
1757
  exit: Exit.Failure<any, SchemaIssue.Issue>
1757
1758
  ) => {
1758
- const issueResult = Cause.findError(exit.cause)
1759
- if (Result.isFailure(issueResult)) {
1759
+ if (exit.cause.reasons.length === 0) {
1760
1760
  return exit
1761
1761
  }
1762
- const issue = new SchemaIssue.Pointer([key], issueResult.success)
1762
+ const issue = InternalSchemaCause.getSchemaIssue(exit.cause)
1763
+ if (issue === undefined) {
1764
+ return Exit.failCause(
1765
+ Cause.map(
1766
+ exit.cause,
1767
+ (issue) => new SchemaIssue.Composite(ast, s.oinput, [new SchemaIssue.Pointer([key], issue)])
1768
+ )
1769
+ )
1770
+ }
1771
+ const pointer = new SchemaIssue.Pointer([key], issue)
1763
1772
  if (s.options.errors === "all") {
1764
- if (s.issues) s.issues.push(issue)
1765
- else s.issues = [issue]
1773
+ if (s.issues) s.issues.push(pointer)
1774
+ else s.issues = [pointer]
1766
1775
  } else {
1767
- return Exit.fail(new SchemaIssue.Composite(ast, s.oinput, [issue]))
1776
+ return Exit.fail(new SchemaIssue.Composite(ast, s.oinput, [pointer]))
1768
1777
  }
1769
1778
  }
1770
1779
 
@@ -2658,12 +2667,12 @@ const parseUnion = iterateEager<{
2658
2667
  },
2659
2668
  step(s, candidate, exit) {
2660
2669
  if (exit._tag === "Failure") {
2661
- const issueResult = Cause.findError(exit.cause)
2662
- if (Result.isFailure(issueResult)) {
2670
+ const issue = InternalSchemaCause.getSchemaIssue(exit.cause)
2671
+ if (issue === undefined) {
2663
2672
  return exit
2664
2673
  }
2665
- if (s.issues) s.issues.push(issueResult.success)
2666
- else s.issues = [issueResult.success]
2674
+ if (s.issues) s.issues.push(issue)
2675
+ else s.issues = [issue]
2667
2676
  } else {
2668
2677
  if (s.out && s.ast.mode === "oneOf") {
2669
2678
  s.successes.push(candidate)
@@ -2723,7 +2732,7 @@ export function memoizeThunk<A>(f: () => A): () => A {
2723
2732
  * define recursive or mutually recursive schemas without infinite loops at
2724
2733
  * construction time.
2725
2734
  *
2726
- * **Example** (Recursive schema AST)
2735
+ * **Example** (Defining recursive schema ASTs)
2727
2736
  *
2728
2737
  * ```ts
2729
2738
  * import { Schema, SchemaAST } from "effect"
@@ -102,7 +102,7 @@ export class Getter<out T, in E, R = never> extends Pipeable.Class {
102
102
  * The getter is pure and always returns `Option.some(t)` regardless of whether
103
103
  * the input is `Some` or `None`.
104
104
  *
105
- * **Example** (Constant getter)
105
+ * **Example** (Returning a constant getter)
106
106
  *
107
107
  * ```ts
108
108
  * import { SchemaGetter } from "effect"
@@ -134,7 +134,7 @@ export function succeed<const T, E>(t: T): Getter<T, E> {
134
134
  * - Always fails with the `Issue` returned by `f`.
135
135
  * - The failure function receives the original `Option<E>` input for error context.
136
136
  *
137
- * **Example** (Always-failing getter)
137
+ * **Example** (Defining an always-failing getter)
138
138
  *
139
139
  * ```ts
140
140
  * import { Option, SchemaGetter, SchemaIssue } from "effect"
@@ -208,7 +208,7 @@ function isPassthrough<T, E, R>(getter: Getter<T, E, R>): getter is typeof passt
208
208
  * - The default overload requires `T === E`. Pass `{ strict: false }` to opt
209
209
  * out of the type constraint.
210
210
  *
211
- * **Example** (Identity transformation)
211
+ * **Example** (Passing through identity transformations)
212
212
  *
213
213
  * ```ts
214
214
  * import { Schema, SchemaGetter } from "effect"
@@ -247,7 +247,7 @@ export function passthrough<T>(): Getter<T, T> {
247
247
  *
248
248
  * - Same singleton as {@link passthrough} — no allocation, optimized in composition.
249
249
  *
250
- * **Example** (Supertype passthrough)
250
+ * **Example** (Passing through supertypes)
251
251
  *
252
252
  * ```ts
253
253
  * import { SchemaGetter } from "effect"
@@ -279,7 +279,7 @@ export function passthroughSupertype<T>(): Getter<T, T> {
279
279
  *
280
280
  * - Same singleton as {@link passthrough} — no allocation, optimized in composition.
281
281
  *
282
- * **Example** (Subtype passthrough)
282
+ * **Example** (Passing through subtypes)
283
283
  *
284
284
  * ```ts
285
285
  * import { SchemaGetter } from "effect"
@@ -314,7 +314,7 @@ export function passthroughSubtype<T>(): Getter<T, T> {
314
314
  * - When input is `Some`, passes it through unchanged.
315
315
  * - `f` receives the parse options and may return `None` to keep the value absent.
316
316
  *
317
- * **Example** (Default timestamp for missing field)
317
+ * **Example** (Providing a default timestamp for a missing field)
318
318
  *
319
319
  * ```ts
320
320
  * import { Effect, Option, SchemaGetter } from "effect"
@@ -351,7 +351,7 @@ export function onNone<T, E extends T = T, R = never>(
351
351
  * - When input is `Some`, passes it through unchanged.
352
352
  * - Optional `annotations` customize the error message for the missing key.
353
353
  *
354
- * **Example** (Required struct field)
354
+ * **Example** (Defining a required struct field)
355
355
  *
356
356
  * ```ts
357
357
  * import { SchemaGetter } from "effect"
@@ -384,7 +384,7 @@ export function required<T, E extends T = T>(annotations?: Schema.Annotations.Ke
384
384
  * - When input is `Some(e)`, calls `f(e, options)` to produce the result.
385
385
  * - `f` may return `None` to omit the value, or fail with an `Issue`.
386
386
  *
387
- * **Example** (Transform only present values)
387
+ * **Example** (Transforming only present values)
388
388
  *
389
389
  * ```ts
390
390
  * import { Effect, Option, SchemaGetter } from "effect"
@@ -427,7 +427,7 @@ export function onSome<T, E, R = never>(
427
427
  * message string or a full {@link SchemaIssue.Issue}).
428
428
  * - Does not transform the value — input and output types are the same.
429
429
  *
430
- * **Example** (Effectful validation)
430
+ * **Example** (Validating effectfully)
431
431
  *
432
432
  * ```ts
433
433
  * import { Effect, SchemaGetter } from "effect"
@@ -476,7 +476,7 @@ export function checkEffect<T, R = never>(
476
476
  * - Skips `None` inputs — only called when a value is present.
477
477
  * - Never fails.
478
478
  *
479
- * **Example** (String to number transformation pair)
479
+ * **Example** (Transforming strings to numbers)
480
480
  *
481
481
  * ```ts
482
482
  * import { Schema, SchemaGetter } from "effect"
@@ -554,7 +554,7 @@ export function transformOrFail<T, E, R = never>(
554
554
  * must return `Option<T>`, so it can turn a present value into absent or an
555
555
  * absent value into present.
556
556
  *
557
- * **Example** (Filter out empty strings)
557
+ * **Example** (Filtering out empty strings)
558
558
  *
559
559
  * ```ts
560
560
  * import { Option, SchemaGetter } from "effect"
@@ -587,7 +587,7 @@ export function transformOptional<T, E>(f: (oe: Option.Option<E>) => Option.Opti
587
587
  * - Always returns `Option.None` regardless of input.
588
588
  * - Never fails.
589
589
  *
590
- * **Example** (Omit a field during encoding)
590
+ * **Example** (Omitting a field during encoding)
591
591
  *
592
592
  * ```ts
593
593
  * import { SchemaGetter } from "effect"
@@ -619,7 +619,7 @@ export function omit<T>(): Getter<never, T> {
619
619
  * - If the input is `Some(value)` where value is not `undefined`, passes it through.
620
620
  * - `defaultValue` is an `Effect` that will be executed each time a default is needed.
621
621
  *
622
- * **Example** (Default value for optional field)
622
+ * **Example** (Providing a default value for an optional field)
623
623
  *
624
624
  * ```ts
625
625
  * import { Effect, SchemaGetter } from "effect"
@@ -655,7 +655,7 @@ export function withDefault<T, R = never>(
655
655
  *
656
656
  * The getter is pure, never fails, and delegates to `globalThis.String`.
657
657
  *
658
- * **Example** (Coerce to string)
658
+ * **Example** (Coercing to a string)
659
659
  *
660
660
  * ```ts
661
661
  * import { SchemaGetter } from "effect"
@@ -686,7 +686,7 @@ export function String<E>(): Getter<string, E> {
686
686
  * The getter is pure, never fails, and delegates to `globalThis.Number`. It may
687
687
  * produce `NaN` for non-numeric inputs.
688
688
  *
689
- * **Example** (Coerce to number)
689
+ * **Example** (Coercing to a number)
690
690
  *
691
691
  * ```ts
692
692
  * import { SchemaGetter } from "effect"
@@ -716,7 +716,7 @@ export function Number<E>(): Getter<number, E> {
716
716
  *
717
717
  * The getter is pure, never fails, and delegates to `globalThis.Boolean`.
718
718
  *
719
- * **Example** (Coerce to boolean)
719
+ * **Example** (Coercing to a boolean)
720
720
  *
721
721
  * ```ts
722
722
  * import { SchemaGetter } from "effect"
@@ -745,7 +745,7 @@ export function Boolean<E>(): Getter<boolean, E> {
745
745
  * - Delegates to `globalThis.BigInt`.
746
746
  * - Throws at runtime if the input cannot be converted (e.g. non-numeric string).
747
747
  *
748
- * **Example** (Coerce to bigint)
748
+ * **Example** (Coercing to a bigint)
749
749
  *
750
750
  * ```ts
751
751
  * import { SchemaGetter } from "effect"
@@ -774,7 +774,7 @@ export function BigInt<E extends string | number | bigint | boolean>(): Getter<b
774
774
  * - Delegates to `new globalThis.Date(input)`.
775
775
  * - Does not validate the result — may produce an invalid Date.
776
776
  *
777
- * **Example** (Coerce to Date)
777
+ * **Example** (Coercing to a Date)
778
778
  *
779
779
  * ```ts
780
780
  * import { SchemaGetter } from "effect"
@@ -799,7 +799,7 @@ export function Date<E extends string | number | Date>(): Getter<Date, E> {
799
799
  *
800
800
  * - Pure, delegates to `String.trim`.
801
801
  *
802
- * **Example** (Trim whitespace)
802
+ * **Example** (Trimming whitespace)
803
803
  *
804
804
  * ```ts
805
805
  * import { SchemaGetter } from "effect"
@@ -821,7 +821,7 @@ export function trim<E extends string>(): Getter<string, E> {
821
821
  *
822
822
  * - Pure, delegates to `String.capitalize`.
823
823
  *
824
- * **Example** (Capitalize string)
824
+ * **Example** (Capitalizing a string)
825
825
  *
826
826
  * ```ts
827
827
  * import { SchemaGetter } from "effect"
@@ -843,7 +843,7 @@ export function capitalize<E extends string>(): Getter<string, E> {
843
843
  *
844
844
  * - Pure, delegates to `String.uncapitalize`.
845
845
  *
846
- * **Example** (Uncapitalize string)
846
+ * **Example** (Uncapitalizing a string)
847
847
  *
848
848
  * ```ts
849
849
  * import { SchemaGetter } from "effect"
@@ -865,7 +865,7 @@ export function uncapitalize<E extends string>(): Getter<string, E> {
865
865
  *
866
866
  * - Pure, delegates to `String.snakeToCamel`.
867
867
  *
868
- * **Example** (Snake to camel)
868
+ * **Example** (Converting snake case to camel case)
869
869
  *
870
870
  * ```ts
871
871
  * import { SchemaGetter } from "effect"
@@ -889,7 +889,7 @@ export function snakeToCamel<E extends string>(): Getter<string, E> {
889
889
  *
890
890
  * - Pure, delegates to `String.camelToSnake`.
891
891
  *
892
- * **Example** (Camel to snake)
892
+ * **Example** (Converting camel case to snake case)
893
893
  *
894
894
  * ```ts
895
895
  * import { SchemaGetter } from "effect"
@@ -913,7 +913,7 @@ export function camelToSnake<E extends string>(): Getter<string, E> {
913
913
  *
914
914
  * - Pure, delegates to `String.toLowerCase`.
915
915
  *
916
- * **Example** (To lowercase)
916
+ * **Example** (Converting to lowercase)
917
917
  *
918
918
  * ```ts
919
919
  * import { SchemaGetter } from "effect"
@@ -937,7 +937,7 @@ export function toLowerCase<E extends string>(): Getter<string, E> {
937
937
  *
938
938
  * - Pure, delegates to `String.toUpperCase`.
939
939
  *
940
- * **Example** (To uppercase)
940
+ * **Example** (Converting to uppercase)
941
941
  *
942
942
  * ```ts
943
943
  * import { SchemaGetter } from "effect"
@@ -973,7 +973,7 @@ type ParseJsonOptions = {
973
973
  * - With `reviver`: returns `unknown` (reviver may produce arbitrary values).
974
974
  * - On parse failure, fails with `SchemaIssue.InvalidValue` containing the error message.
975
975
  *
976
- * **Example** (Parse JSON)
976
+ * **Example** (Parsing JSON)
977
977
  *
978
978
  * ```ts
979
979
  * import { SchemaGetter } from "effect"
@@ -1022,7 +1022,7 @@ type StringifyJsonOptions = {
1022
1022
  * functions, symbols, or a replacer that removes the root value, that
1023
1023
  * `undefined` result is returned rather than converted into an `Issue`.
1024
1024
  *
1025
- * **Example** (Stringify JSON)
1025
+ * **Example** (Stringifying JSON)
1026
1026
  *
1027
1027
  * ```ts
1028
1028
  * import { SchemaGetter } from "effect"
@@ -1059,7 +1059,7 @@ export function stringifyJson(options?: StringifyJsonOptions): Getter<string, un
1059
1059
  * (default `,`) and then each pair by `keyValueSeparator` (default `=`). Pairs
1060
1060
  * missing a key or value are silently skipped.
1061
1061
  *
1062
- * **Example** (Parse key-value string)
1062
+ * **Example** (Parsing a key-value string)
1063
1063
  *
1064
1064
  * ```ts
1065
1065
  * import { SchemaGetter } from "effect"
@@ -1105,7 +1105,7 @@ export function splitKeyValue<E extends string>(options?: {
1105
1105
  * (default `,`) and joins each key and value with `keyValueSeparator` (default
1106
1106
  * `=`).
1107
1107
  *
1108
- * **Example** (Join key-value record)
1108
+ * **Example** (Joining key-value records)
1109
1109
  *
1110
1110
  * ```ts
1111
1111
  * import { SchemaGetter } from "effect"
@@ -1143,7 +1143,7 @@ export function joinKeyValue<E extends Record<PropertyKey, string>>(options?: {
1143
1143
  * The getter is pure and never fails. It splits by `separator` (default `,`).
1144
1144
  * An empty string produces an empty array, not `[""]`.
1145
1145
  *
1146
- * **Example** (Split comma-separated string)
1146
+ * **Example** (Splitting a comma-separated string)
1147
1147
  *
1148
1148
  * ```ts
1149
1149
  * import { SchemaGetter } from "effect"
@@ -1172,7 +1172,7 @@ export function split<E extends string>(options?: {
1172
1172
  *
1173
1173
  * The getter is pure and never fails.
1174
1174
  *
1175
- * **Example** (Encode to Base64)
1175
+ * **Example** (Encoding to Base64)
1176
1176
  *
1177
1177
  * ```ts
1178
1178
  * import { SchemaGetter } from "effect"
@@ -1198,7 +1198,7 @@ export function encodeBase64<E extends Uint8Array | string>(): Getter<string, E>
1198
1198
  *
1199
1199
  * The getter is pure and never fails.
1200
1200
  *
1201
- * **Example** (Encode to Base64Url)
1201
+ * **Example** (Encoding to Base64Url)
1202
1202
  *
1203
1203
  * ```ts
1204
1204
  * import { SchemaGetter } from "effect"
@@ -1224,7 +1224,7 @@ export function encodeBase64Url<E extends Uint8Array | string>(): Getter<string,
1224
1224
  *
1225
1225
  * The getter is pure and never fails.
1226
1226
  *
1227
- * **Example** (Encode to hex)
1227
+ * **Example** (Encoding to hex)
1228
1228
  *
1229
1229
  * ```ts
1230
1230
  * import { SchemaGetter } from "effect"
@@ -1249,7 +1249,7 @@ export function encodeHex<E extends Uint8Array | string>(): Getter<string, E> {
1249
1249
  *
1250
1250
  * - Fails with `SchemaIssue.InvalidValue` if the input is not valid Base64.
1251
1251
  *
1252
- * **Example** (Decode Base64 to bytes)
1252
+ * **Example** (Decoding Base64 to bytes)
1253
1253
  *
1254
1254
  * ```ts
1255
1255
  * import { SchemaGetter } from "effect"
@@ -1280,7 +1280,7 @@ export function decodeBase64<E extends string>(): Getter<Uint8Array, E> {
1280
1280
  *
1281
1281
  * - Fails with `SchemaIssue.InvalidValue` if the input is not valid Base64.
1282
1282
  *
1283
- * **Example** (Decode Base64 to string)
1283
+ * **Example** (Decoding Base64 to string)
1284
1284
  *
1285
1285
  * ```ts
1286
1286
  * import { SchemaGetter } from "effect"
@@ -1311,7 +1311,7 @@ export function decodeBase64String<E extends string>(): Getter<string, E> {
1311
1311
  *
1312
1312
  * - Fails with `SchemaIssue.InvalidValue` if the input is not valid Base64Url.
1313
1313
  *
1314
- * **Example** (Decode Base64Url to bytes)
1314
+ * **Example** (Decoding Base64Url to bytes)
1315
1315
  *
1316
1316
  * ```ts
1317
1317
  * import { SchemaGetter } from "effect"
@@ -1342,7 +1342,7 @@ export function decodeBase64Url<E extends string>(): Getter<Uint8Array, E> {
1342
1342
  *
1343
1343
  * - Fails with `SchemaIssue.InvalidValue` if the input is not valid Base64Url.
1344
1344
  *
1345
- * **Example** (Decode Base64Url to string)
1345
+ * **Example** (Decoding Base64Url to string)
1346
1346
  *
1347
1347
  * ```ts
1348
1348
  * import { SchemaGetter } from "effect"
@@ -1373,7 +1373,7 @@ export function decodeBase64UrlString<E extends string>(): Getter<string, E> {
1373
1373
  *
1374
1374
  * - Fails with `SchemaIssue.InvalidValue` if the input is not valid hex.
1375
1375
  *
1376
- * **Example** (Decode hex to bytes)
1376
+ * **Example** (Decoding hex to bytes)
1377
1377
  *
1378
1378
  * ```ts
1379
1379
  * import { SchemaGetter } from "effect"
@@ -1404,7 +1404,7 @@ export function decodeHex<E extends string>(): Getter<Uint8Array, E> {
1404
1404
  *
1405
1405
  * - Fails with `SchemaIssue.InvalidValue` if the input is not valid hex.
1406
1406
  *
1407
- * **Example** (Decode hex to string)
1407
+ * **Example** (Decoding hex to string)
1408
1408
  *
1409
1409
  * ```ts
1410
1410
  * import { SchemaGetter } from "effect"
@@ -1437,7 +1437,7 @@ export function decodeHexString<E extends string>(): Getter<string, E> {
1437
1437
  * - May throw a `URIError` for malformed surrogate pairs; this exception is not
1438
1438
  * converted into an `Issue`.
1439
1439
  *
1440
- * **Example** (Encode a URI component)
1440
+ * **Example** (Encoding a URI component)
1441
1441
  *
1442
1442
  * ```ts
1443
1443
  * import { SchemaGetter } from "effect"
@@ -1461,7 +1461,7 @@ export function encodeUriComponent<E extends string>(): Getter<string, E> {
1461
1461
  *
1462
1462
  * - Fails with `SchemaIssue.InvalidValue` if the input contains malformed percent-encoding sequences.
1463
1463
  *
1464
- * **Example** (Decode a URI component)
1464
+ * **Example** (Decoding a URI component)
1465
1465
  *
1466
1466
  * ```ts
1467
1467
  * import { SchemaGetter } from "effect"
@@ -1506,7 +1506,7 @@ export function decodeUriComponent<E extends string>(): Getter<string, E> {
1506
1506
  * - Fails with `SchemaIssue.InvalidValue` if the input cannot be parsed as a valid
1507
1507
  * `DateTime`.
1508
1508
  *
1509
- * **Example** (Parse DateTime)
1509
+ * **Example** (Parsing DateTime)
1510
1510
  *
1511
1511
  * ```ts
1512
1512
  * import { SchemaGetter } from "effect"
@@ -1544,7 +1544,7 @@ export function dateTimeUtcFromInput<E extends DateTime.DateTime.Input>(): Gette
1544
1544
  * `user[name]` and `items[0]` to build nested objects or arrays, and each leaf
1545
1545
  * value is a `string` or `Blob`.
1546
1546
  *
1547
- * **Example** (Decode FormData)
1547
+ * **Example** (Decoding FormData)
1548
1548
  *
1549
1549
  * ```ts
1550
1550
  * import { SchemaGetter } from "effect"
@@ -1582,7 +1582,7 @@ const collectFormDataEntries = collectBracketPathEntries((value): value is strin
1582
1582
  * bracket-path keys such as `user[name]` and `items[0]`. Non-object inputs
1583
1583
  * produce an empty `FormData`.
1584
1584
  *
1585
- * **Example** (Encode to FormData)
1585
+ * **Example** (Encoding to FormData)
1586
1586
  *
1587
1587
  * ```ts
1588
1588
  * import { SchemaGetter } from "effect"
@@ -1625,7 +1625,7 @@ export function encodeFormData(): Getter<FormData, unknown> {
1625
1625
  * `user[name]` and `items[0]` to build nested objects or arrays, and each leaf
1626
1626
  * value is a `string`.
1627
1627
  *
1628
- * **Example** (Decode URLSearchParams)
1628
+ * **Example** (Decoding URLSearchParams)
1629
1629
  *
1630
1630
  * ```ts
1631
1631
  * import { SchemaGetter } from "effect"
@@ -1660,7 +1660,7 @@ const collectURLSearchParamsEntries = collectBracketPathEntries(Predicate.isStri
1660
1660
  * The getter is pure and never fails. It flattens nested objects or arrays into
1661
1661
  * bracket-path keys. Non-object inputs produce an empty `URLSearchParams`.
1662
1662
  *
1663
- * **Example** (Encode to URLSearchParams)
1663
+ * **Example** (Encoding to URLSearchParams)
1664
1664
  *
1665
1665
  * ```ts
1666
1666
  * import { SchemaGetter } from "effect"
@@ -1726,7 +1726,7 @@ function bracketPathToTokens(bracketPath: string): Array<string | number> {
1726
1726
  * - `""` → real empty key
1727
1727
  * - Duplicate keys for the same path are merged into arrays.
1728
1728
  *
1729
- * **Example** (Build tree from bracket paths)
1729
+ * **Example** (Building a tree from bracket paths)
1730
1730
  *
1731
1731
  * ```ts
1732
1732
  * import { SchemaGetter } from "effect"
@@ -1818,7 +1818,7 @@ export function makeTreeRecord<A>(
1818
1818
  * (e.g. `tags=a&tags=b`). Otherwise uses indexed bracket paths (e.g. `items[0]`, `items[1]`).
1819
1819
  * - Non-leaf values that aren't objects or arrays are silently skipped.
1820
1820
  *
1821
- * **Example** (Flatten object to bracket paths)
1821
+ * **Example** (Flattening an object to bracket paths)
1822
1822
  *
1823
1823
  * ```ts
1824
1824
  * import { Predicate, SchemaGetter } from "effect"
@@ -455,7 +455,7 @@ export class Composite extends Base {
455
455
  * `Option.none()` when no value was provided.
456
456
  * - The default formatter renders this as `"Expected <type>, got <actual>"`.
457
457
  *
458
- * **Example** (Formatted output)
458
+ * **Example** (Formatting output)
459
459
  *
460
460
  * ```ts
461
461
  * import { Schema } from "effect"
@@ -519,7 +519,7 @@ export class InvalidType extends Base {
519
519
  * - The default formatter renders this as `"Invalid data <actual>"` unless a
520
520
  * custom `message` annotation is provided.
521
521
  *
522
- * **Example** (Custom filter returning InvalidValue)
522
+ * **Example** (Returning InvalidValue from a custom filter)
523
523
  *
524
524
  * ```ts
525
525
  * import { Option, SchemaIssue } from "effect"
@@ -879,7 +879,7 @@ export type LeafHook = (issue: Leaf) => string
879
879
  * - `Forbidden` → `"Forbidden operation"`
880
880
  * - `OneOf` → `"Expected exactly one member to match the input <actual>"`
881
881
  *
882
- * **Example** (Using defaultLeafHook with Standard Schema formatter)
882
+ * **Example** (Formatting Standard Schema issues with defaultLeafHook)
883
883
  *
884
884
  * ```ts
885
885
  * import { SchemaIssue } from "effect"