effect-app 2.19.4 → 2.20.0

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 (109) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/_cjs/Chunk.cjs +0 -31
  3. package/_cjs/Chunk.cjs.map +1 -1
  4. package/_cjs/Config/SecretURL.cjs +0 -9
  5. package/_cjs/Config/SecretURL.cjs.map +1 -1
  6. package/_cjs/Context.cjs +0 -6
  7. package/_cjs/Context.cjs.map +1 -1
  8. package/_cjs/Effect.cjs +0 -41
  9. package/_cjs/Effect.cjs.map +1 -1
  10. package/_cjs/NonEmptySetBase.cjs.map +1 -1
  11. package/_cjs/Option.cjs +0 -13
  12. package/_cjs/Option.cjs.map +1 -1
  13. package/_cjs/Pure.cjs +17 -85
  14. package/_cjs/Pure.cjs.map +1 -1
  15. package/_cjs/Schema/Class.cjs.map +1 -1
  16. package/_cjs/Schema/ext.cjs +0 -3
  17. package/_cjs/Schema/ext.cjs.map +1 -1
  18. package/_cjs/Set.cjs +0 -4
  19. package/_cjs/Set.cjs.map +1 -1
  20. package/_cjs/Tag.cjs +0 -9
  21. package/_cjs/Tag.cjs.map +1 -1
  22. package/_cjs/Unify.cjs +0 -16
  23. package/_cjs/Unify.cjs.map +1 -1
  24. package/_cjs/_ext/date.cjs +0 -42
  25. package/_cjs/_ext/date.cjs.map +1 -1
  26. package/_cjs/_ext/misc.cjs +0 -33
  27. package/_cjs/_ext/misc.cjs.map +1 -1
  28. package/_cjs/_ext/ord.ext.cjs +0 -9
  29. package/_cjs/_ext/ord.ext.cjs.map +1 -1
  30. package/_cjs/client/errors.cjs +6 -0
  31. package/_cjs/client/errors.cjs.map +1 -1
  32. package/_cjs/ids.cjs.map +1 -1
  33. package/_cjs/utils.cjs +0 -16
  34. package/_cjs/utils.cjs.map +1 -1
  35. package/dist/Chunk.d.ts +0 -31
  36. package/dist/Chunk.d.ts.map +1 -1
  37. package/dist/Chunk.js +1 -32
  38. package/dist/Config/SecretURL.d.ts +0 -13
  39. package/dist/Config/SecretURL.d.ts.map +1 -1
  40. package/dist/Config/SecretURL.js +1 -10
  41. package/dist/Context.d.ts +1 -7
  42. package/dist/Context.d.ts.map +1 -1
  43. package/dist/Context.js +1 -7
  44. package/dist/Effect.d.ts +0 -41
  45. package/dist/Effect.d.ts.map +1 -1
  46. package/dist/Effect.js +1 -42
  47. package/dist/NonEmptySetBase.d.ts +1 -4
  48. package/dist/NonEmptySetBase.d.ts.map +1 -1
  49. package/dist/NonEmptySetBase.js +1 -1
  50. package/dist/Option.d.ts +0 -13
  51. package/dist/Option.d.ts.map +1 -1
  52. package/dist/Option.js +1 -14
  53. package/dist/Pure.d.ts +0 -77
  54. package/dist/Pure.d.ts.map +1 -1
  55. package/dist/Pure.js +17 -85
  56. package/dist/Schema/Class.d.ts +18 -13
  57. package/dist/Schema/Class.d.ts.map +1 -1
  58. package/dist/Schema/Class.js +1 -1
  59. package/dist/Schema/ext.d.ts +2 -4
  60. package/dist/Schema/ext.d.ts.map +1 -1
  61. package/dist/Schema/ext.js +1 -4
  62. package/dist/Set.d.ts +0 -11
  63. package/dist/Set.d.ts.map +1 -1
  64. package/dist/Set.js +1 -5
  65. package/dist/Tag.d.ts +0 -3
  66. package/dist/Tag.d.ts.map +1 -1
  67. package/dist/Tag.js +1 -10
  68. package/dist/Unify.d.ts +0 -16
  69. package/dist/Unify.d.ts.map +1 -1
  70. package/dist/Unify.js +1 -17
  71. package/dist/_ext/date.d.ts +0 -42
  72. package/dist/_ext/date.d.ts.map +1 -1
  73. package/dist/_ext/date.js +1 -43
  74. package/dist/_ext/misc.d.ts +0 -15
  75. package/dist/_ext/misc.d.ts.map +1 -1
  76. package/dist/_ext/misc.js +1 -34
  77. package/dist/_ext/ord.ext.d.ts +0 -9
  78. package/dist/_ext/ord.ext.d.ts.map +1 -1
  79. package/dist/_ext/ord.ext.js +1 -10
  80. package/dist/client/errors.d.ts +14 -3
  81. package/dist/client/errors.d.ts.map +1 -1
  82. package/dist/client/errors.js +7 -1
  83. package/dist/ids.d.ts +0 -6
  84. package/dist/ids.d.ts.map +1 -1
  85. package/dist/ids.js +1 -1
  86. package/dist/internal/Prelude.d.ts +0 -33
  87. package/dist/utils.d.ts +0 -20
  88. package/dist/utils.d.ts.map +1 -1
  89. package/dist/utils.js +1 -17
  90. package/package.json +7 -7
  91. package/src/Chunk.ts +0 -31
  92. package/src/Config/SecretURL.ts +0 -13
  93. package/src/Context.ts +0 -6
  94. package/src/Effect.ts +0 -41
  95. package/src/NonEmptySetBase.ts +0 -3
  96. package/src/Option.ts +0 -13
  97. package/src/Pure.ts +0 -109
  98. package/src/Schema/Class.ts +35 -27
  99. package/src/Schema/ext.ts +2 -4
  100. package/src/Set.ts +0 -11
  101. package/src/Tag.ts +0 -9
  102. package/src/Unify.ts +0 -16
  103. package/src/_ext/date.ts +0 -42
  104. package/src/_ext/misc.ts +0 -35
  105. package/src/_ext/ord.ext.ts +0 -9
  106. package/src/client/errors.ts +20 -6
  107. package/src/ids.ts +0 -6
  108. package/src/internal/Prelude.d.ts +0 -33
  109. package/src/utils.ts +0 -20
package/src/Effect.ts CHANGED
@@ -15,10 +15,6 @@ export { ServiceStrict as Service } from "effect/Effect"
15
15
 
16
16
  export * from "effect/Effect"
17
17
 
18
- /**
19
- * @macro traced
20
- * @tsplus fluent effect/io/Effect flatMapOpt
21
- */
22
18
  export function flatMapOption<R, E, A, R2, E2, A2>(
23
19
  self: Effect.Effect<Option.Option<A>, E, R>,
24
20
  fm: (a: A) => Effect.Effect<A2, E2, R2>
@@ -30,10 +26,6 @@ export function flatMapOption<R, E, A, R2, E2, A2>(
30
26
  }))
31
27
  }
32
28
 
33
- /**
34
- * @macro traced
35
- * @tsplus fluent effect/io/Effect tapOpt
36
- */
37
29
  export function tapOption<R, E, A, R2, E2, A2>(
38
30
  self: Effect.Effect<Option.Option<A>, E, R>,
39
31
  fm: (a: A) => Effect.Effect<A2, E2, R2>
@@ -45,10 +37,6 @@ export function tapOption<R, E, A, R2, E2, A2>(
45
37
  }))
46
38
  }
47
39
 
48
- /**
49
- * @macro traced
50
- * @tsplus fluent effect/io/Effect zipRightOpt
51
- */
52
40
  export function zipRightOption<R, E, A, R2, E2, A2>(
53
41
  self: Effect.Effect<Option.Option<A>, E, R>,
54
42
  fm: Effect.Effect<A2, E2, R2>
@@ -60,10 +48,6 @@ export function zipRightOption<R, E, A, R2, E2, A2>(
60
48
  }))
61
49
  }
62
50
 
63
- /**
64
- * @macro traced
65
- * @tsplus fluent effect/io/Effect mapOpt
66
- */
67
51
  export function mapOption<R, E, A, A2>(
68
52
  self: Effect.Effect<Option.Option<A>, E, R>,
69
53
  fm: (a: A) => A2
@@ -110,15 +94,10 @@ export function ifDiff<I, R, E, A>(n: I, orig: I) {
110
94
  }
111
95
 
112
96
  // NOTE: await extension doesnt work via tsplus somehow
113
- /**
114
- * @tsplus static effect/io/Deferred.Ops await
115
- * @tsplus getter effect/io/Deferred await
116
- */
117
97
  export const await_ = Def.await
118
98
 
119
99
  /**
120
100
  * Ref has atomic modify support if synchronous, for Effect we need a Semaphore.
121
- * @tsplus fluent effect/io/Ref modifyWithEffect
122
101
  */
123
102
  export function modifyWithPermitWithEffect<A>(ref: Ref.Ref<A>, semaphore: Semaphore) {
124
103
  const withPermit = semaphore.withPermits(1)
@@ -133,10 +112,6 @@ export function modifyWithPermitWithEffect<A>(ref: Ref.Ref<A>, semaphore: Semaph
133
112
  )
134
113
  }
135
114
 
136
- /**
137
- * @tsplus getter Iterable joinAll
138
- * @tsplus static effect/io/Effect.Ops joinAll
139
- */
140
115
  export function joinAll<E, A>(fibers: Iterable<Fiber.Fiber<A, E>>): Effect.Effect<readonly A[], E> {
141
116
  return Fiber.join(Fiber.all(fibers))
142
117
  }
@@ -174,9 +149,6 @@ export type LowerServices<T extends Record<string, Context.Tag<any, any> | Effec
174
149
  [key in keyof T as LowerFirst<key>]: ServiceA<T[key]>
175
150
  }
176
151
 
177
- /**
178
- * @tsplus static effect/io/Effect.Ops allLower
179
- */
180
152
  export function allLower<T extends Record<string, Context.Tag<any, any> | Effect.Effect<any, any, any>>>(
181
153
  services: T
182
154
  ) {
@@ -190,9 +162,6 @@ export function allLower<T extends Record<string, Context.Tag<any, any> | Effect
190
162
  ) as any as Effect.Effect<LowerServices<T>, ValuesE<T>, ValuesR<T>>
191
163
  }
192
164
 
193
- /**
194
- * @tsplus static effect/io/Effect.Ops allLowerWith
195
- */
196
165
  export function allLowerWith<T extends Record<string, Context.Tag<any, any> | Effect.Effect<any, any, any>>, A>(
197
166
  services: T,
198
167
  fn: (services: LowerServices<T>) => A
@@ -200,9 +169,6 @@ export function allLowerWith<T extends Record<string, Context.Tag<any, any> | Ef
200
169
  return Effect.map(allLower(services), fn)
201
170
  }
202
171
 
203
- /**
204
- * @tsplus static effect/io/Effect.Ops allLowerWithEffect
205
- */
206
172
  export function allLowerWithEffect<
207
173
  T extends Record<string, Context.Tag<any, any> | Effect.Effect<any, any, any>>,
208
174
  R,
@@ -217,9 +183,6 @@ export function allLowerWithEffect<
217
183
 
218
184
  /**
219
185
  * Recovers from all errors.
220
- *
221
- * @tsplus static effect/io/Effect.Ops catchAllMap
222
- * @tsplus pipeable effect/io/Effect catchAllMap
223
186
  */
224
187
  export function catchAllMap<E, A2>(f: (e: E) => A2) {
225
188
  return <R, A>(self: Effect.Effect<A, E, R>): Effect.Effect<A2 | A, never, R> =>
@@ -228,8 +191,6 @@ export function catchAllMap<E, A2>(f: (e: E) => A2) {
228
191
 
229
192
  /**
230
193
  * Annotates each log in this scope with the specified log annotation.
231
- *
232
- * @tsplus static effect/io/Effect.Ops annotateLogscoped
233
194
  */
234
195
  export function annotateLogscoped(key: string, value: string) {
235
196
  return FiberRef
@@ -247,8 +208,6 @@ export function annotateLogscoped(key: string, value: string) {
247
208
 
248
209
  /**
249
210
  * Annotates each log in this scope with the specified log annotations.
250
- *
251
- * @tsplus static effect/io/Effect.Ops annotateLogsScoped
252
211
  */
253
212
  export function annotateLogsScoped(kvps: Record<string, string>) {
254
213
  return FiberRef
@@ -23,9 +23,6 @@ export interface NonEmptyBrand {
23
23
  readonly NonEmpty: unique symbol
24
24
  }
25
25
 
26
- /**
27
- * @tsplus type ets/NESet
28
- */
29
26
  export type NonEmptySet<A> = Set<A> & NonEmptyBrand
30
27
 
31
28
  function make_<A>(ord: Order.Order<A>, eq_?: Equivalence.Equivalence<A>) {
package/src/Option.ts CHANGED
@@ -8,29 +8,17 @@ import * as Option from "effect/Option"
8
8
 
9
9
  export * from "effect/Option"
10
10
 
11
- /**
12
- * @tsplus getter effect/data/Option value
13
- */
14
11
  export const getOrUndefined = value
15
12
 
16
- /**
17
- * @tsplus static effect/data/Option.Ops omitableToNullable
18
- */
19
13
  export function omitableToNullable<T>(om: Option.Option<T> | undefined) {
20
14
  return om ?? Option.fromNullable(om)
21
15
  }
22
16
 
23
- /**
24
- * @tsplus static effect/data/Option.Ops toBool
25
- */
26
17
  export const toBool = Option.match({
27
18
  onNone: () => false,
28
19
  onSome: () => true
29
20
  })
30
21
 
31
- /**
32
- * @tsplus static effect/data/Option.Ops fromBool
33
- */
34
22
  export const fromBool = (b: boolean) => (b ? Option.some(true) : Option.none())
35
23
 
36
24
  /**
@@ -64,7 +52,6 @@ function raisePartial<X>(): X {
64
52
 
65
53
  /**
66
54
  * Simulates a partial function
67
- * @tsplus static effect/data/Option.Ops partial
68
55
  */
69
56
  export function partial<ARGS extends any[], A>(
70
57
  f: (miss: <X>() => X) => (...args: ARGS) => A
package/src/Pure.ts CHANGED
@@ -7,9 +7,6 @@ const S1 = Symbol()
7
7
  const S2 = Symbol()
8
8
  const W = Symbol()
9
9
 
10
- /**
11
- * @tsplus type PureEnv
12
- */
13
10
  export interface PureState<S, S2 = S> {
14
11
  readonly [S1]: (_: S) => void
15
12
  readonly [S2]: () => S2
@@ -17,17 +14,11 @@ export interface PureState<S, S2 = S> {
17
14
  state: S2
18
15
  }
19
16
 
20
- /**
21
- * @tsplus type PureEnv
22
- */
23
17
  export interface PureLog<W> {
24
18
  readonly [W]: () => W
25
19
  log: Chunk.Chunk<W>
26
20
  }
27
21
 
28
- /**
29
- * @tsplus type PureEnv
30
- */
31
22
  export interface PureEnv<W, S, S2 = S> extends PureState<S, S2>, PureLog<W> {}
32
23
 
33
24
  export interface PureEnvTest extends PureState<any>, PureLog<any> {}
@@ -49,9 +40,6 @@ export function makePureEnv<W, S, S2 = S>(s: S2): PureEnv<W, S, S2> {
49
40
  return new PureEnvBase<W, S, S2>(s)
50
41
  }
51
42
 
52
- /**
53
- * @tsplus unify PureEnv
54
- */
55
43
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
44
  export function unifyPureEnv<X extends PureEnv<any, any, any>>(
57
45
  self: X
@@ -64,16 +52,10 @@ export function unifyPureEnv<X extends PureEnv<any, any, any>>(
64
52
  return self
65
53
  }
66
54
 
67
- /**
68
- * @tsplus type Pure
69
- */
70
55
  export type Pure<W, S, S2, R, E, A> = Effect.Effect<A, E, PureEnvEnv<W, S, S2> | R>
71
56
 
72
57
  // type dsl<W, S, S2> = ProgramDSL<W, S, S2>
73
58
 
74
- /**
75
- * @tsplus static Pure.Ops GMUA_
76
- */
77
59
  export function GMUA_<W, S, S2, GR, GE, GA, MR, ME, MA, UR, UE, UA>(
78
60
  get: Pure<W, S, S2, GR, GE, GA>,
79
61
  modify: (i: GA) => Pure<W, S, S2, MR, ME, readonly [GA, MA]>,
@@ -82,9 +64,6 @@ export function GMUA_<W, S, S2, GR, GE, GA, MR, ME, MA, UR, UE, UA>(
82
64
  return Effect.flatMap(get, modify).pipe(Effect.flatMap(([s, a]) => Effect.map(update(s), () => a)))
83
65
  }
84
66
 
85
- /**
86
- * @tsplus static Pure.Ops GMUA
87
- */
88
67
  export function GMUA<W, S, S2, GA, MR, ME, MA>(modify: (i: GA) => Pure<W, S, S2, MR, ME, readonly [GA, MA]>) {
89
68
  return <GR, GE, UR, UE, UA>(
90
69
  get: Pure<W, S, S2, GR, GE, GA>,
@@ -92,10 +71,6 @@ export function GMUA<W, S, S2, GA, MR, ME, MA>(modify: (i: GA) => Pure<W, S, S2,
92
71
  ) => GMUA_(get, modify, update)
93
72
  }
94
73
 
95
- /**
96
- * @tsplus static Pure.Ops GMU_
97
- */
98
-
99
74
  export function GMU_<W, S, S2, GR, GE, GA, MR, ME, UR, UE, UA>(
100
75
  get: Pure<W, S, S2, GR, GE, GA>,
101
76
  modify: (i: GA) => Pure<W, S, S2, MR, ME, GA>,
@@ -104,9 +79,6 @@ export function GMU_<W, S, S2, GR, GE, GA, MR, ME, UR, UE, UA>(
104
79
  return Effect.flatMap(get, modify).pipe(Effect.flatMap(update))
105
80
  }
106
81
 
107
- /**
108
- * @tsplus static Pure.Ops GMU
109
- */
110
82
  export function GMU<W, S, S2, GA, MR, ME>(modify: (i: GA) => Pure<W, S, S2, MR, ME, GA>) {
111
83
  return <GR, GE, UR, UE, UA>(
112
84
  get: Pure<W, S, S2, GR, GE, GA>,
@@ -124,40 +96,24 @@ export interface PureEnvEnv<W, S, S2> extends Context.ServiceTagged<typeof PureE
124
96
  env: PureEnv<W, S, S2>
125
97
  }
126
98
 
127
- /**
128
- * @tsplus static Pure.Ops get
129
- */
130
99
  export function get<S>(): Pure<never, S, S, never, never, S> {
131
100
  return Effect.map(castTag<never, S, S>(), (_) => _.env.state)
132
101
  }
133
102
 
134
- /**
135
- * @tsplus static Pure.Ops set
136
- */
137
103
  export function set<S>(s: S): Pure<never, S, S, never, never, void> {
138
104
  return Effect.map(castTag<never, S, S>(), (_) => _.env.state = s)
139
105
  }
140
106
 
141
107
  export type PureLogT<W> = Pure<W, unknown, never, never, never, void>
142
108
 
143
- /**
144
- * @tsplus static Pure.Ops log
145
- */
146
109
  export function log<W>(w: W): PureLogT<W> {
147
110
  return Effect.map(castTag<W, unknown, never>(), (_) => _.env.log = Chunk.append(_.env.log, w))
148
111
  }
149
112
 
150
- /**
151
- * @tsplus static Pure.Ops logMany
152
- */
153
113
  export function logMany<W>(w: Iterable<W>): PureLogT<W> {
154
114
  return Effect.map(castTag<W, unknown, never>(), (_) => _.env.log = Chunk.appendAll(_.env.log, Chunk.fromIterable(w)))
155
115
  }
156
116
 
157
- /**
158
- * @tsplus static Pure.Ops runAll
159
- * @tsplus fluent effect/io/Effect runAll
160
- */
161
117
  export function runAll<R, E, A, W3, S1, S3, S4 extends S1>(
162
118
  self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
163
119
  s: S4
@@ -181,10 +137,6 @@ export function runAll<R, E, A, W3, S1, S3, S4 extends S1>(
181
137
  return Effect.provide(a, Layer.succeed(tagg, { env: makePureEnv<W3, S3, S4>(s) as any }) as any) as any
182
138
  }
183
139
 
184
- /**
185
- * @tsplus static Pure.Ops runResult
186
- * @tsplus fluent effect/io/Effect runResult
187
- */
188
140
  export function runResult<R, E, A, W3, S1, S3, S4 extends S1>(
189
141
  self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
190
142
  s: S4
@@ -192,10 +144,6 @@ export function runResult<R, E, A, W3, S1, S3, S4 extends S1>(
192
144
  return Effect.map(runAll(self, s), ([log, r]) => tuple(log, Effect.map(r, ([s]) => s)))
193
145
  }
194
146
 
195
- /**
196
- * @tsplus static Pure.Ops runTerm
197
- * @tsplus fluent effect/io/Effect runTerm
198
- */
199
147
  export function runTerm<R, E, A, W3, S1, S3, S4 extends S1>(
200
148
  self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
201
149
  s: S4
@@ -203,10 +151,6 @@ export function runTerm<R, E, A, W3, S1, S3, S4 extends S1>(
203
151
  return Effect.flatMap(runAll(self, s), ([evts, r]) => Effect.map(r, ([s3, a]) => tuple(s3, Chunk.toArray(evts), a)))
204
152
  }
205
153
 
206
- /**
207
- * @tsplus static Pure.Ops runTermDiscard
208
- * @tsplus fluent effect/io/Effect runTermDiscard
209
- */
210
154
  export function runTermDiscard<R, E, A, W3, S1, S3, S4 extends S1>(
211
155
  self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
212
156
  s: S4
@@ -214,10 +158,6 @@ export function runTermDiscard<R, E, A, W3, S1, S3, S4 extends S1>(
214
158
  return Effect.map(runTerm(self, s), ([s3, w3]) => tuple(s3, w3))
215
159
  }
216
160
 
217
- /**
218
- * @tsplus static Pure.Ops runA
219
- * @tsplus fluent effect/io/Effect runA
220
- */
221
161
  export function runA<R, E, A, W3, S1, S3, S4 extends S1>(
222
162
  self: Effect.Effect<A, E, FixEnv<R, W3, S1, S3>>,
223
163
  s: S4
@@ -225,9 +165,6 @@ export function runA<R, E, A, W3, S1, S3, S4 extends S1>(
225
165
  return Effect.map(runAll(self, s), ([log, r]) => tuple(log, Effect.map(r, ([, a]) => a)))
226
166
  }
227
167
 
228
- /**
229
- * @tsplus static Pure.Ops modifyWith
230
- */
231
168
  export function modify<S2, A, S3>(
232
169
  mod: (s: S2) => readonly [S3, A]
233
170
  ): Effect.Effect<A, never, { env: PureEnv<never, S2, S3> }> {
@@ -238,9 +175,6 @@ export function modify<S2, A, S3>(
238
175
  })) as any
239
176
  }
240
177
 
241
- /**
242
- * @tsplus static Pure.Ops modifyWithEffect
243
- */
244
178
  export function modifyM<W, R, E, A, S2, S3>(
245
179
  mod: (s: S2) => Effect.Effect<readonly [S3, A], E, FixEnv<R, W, S2, S3>>
246
180
  ): Effect.Effect<A, E, FixEnv<R, W, S2, S3>> {
@@ -251,9 +185,6 @@ export function modifyM<W, R, E, A, S2, S3>(
251
185
  ) as any
252
186
  }
253
187
 
254
- /**
255
- * @tsplus static Pure.Ops updateWith
256
- */
257
188
  export function updateWith<S2, S3>(upd: (s: S2) => S3) {
258
189
  return modify((_: S2) => {
259
190
  const r = upd(_)
@@ -261,9 +192,6 @@ export function updateWith<S2, S3>(upd: (s: S2) => S3) {
261
192
  })
262
193
  }
263
194
 
264
- /**
265
- * @tsplus static Pure.Ops updateWithEffect
266
- */
267
195
  export function updateWithEffect<W, R, E, S2, S3>(
268
196
  upd: (s: S2, log: (evt: W) => PureLogT<W>) => Effect.Effect<S3, E, FixEnv<R, W, S2, S3>>
269
197
  ): Effect.Effect<S3, E, FixEnv<R, W, S2, S3>> {
@@ -278,9 +206,6 @@ export type FixEnv<R, W, S, S2> =
278
206
  // return Effect.accessM((_: PureState<S>) => Ref.get(_.state).map(self))
279
207
  // }
280
208
 
281
- // /**
282
- // * @tsplus static Pure.Ops getM
283
- // */
284
209
  // export function getM<W, S, R, E, A>(self: (s: S) => Pure<W, S, R, E, A>): Pure<W, S, R, E, A> {
285
210
  // return Effect.accessM((_: PureState<S>) => Ref.get(_.state).flatMap(self))
286
211
  // }
@@ -298,25 +223,6 @@ export type FixEnv<R, W, S, S2> =
298
223
  // return (self: (s: S) => Pure<W, S, R, E, A>) => access(_ => Ref.get(_.state).flatMap(self))
299
224
  // }
300
225
 
301
- /**
302
- * @tsplus type Pure.Ops
303
- */
304
- export interface PureOps {
305
- // $: PureAspects
306
- }
307
-
308
- // /**
309
- // * @tsplus type Pure.Ops
310
- // */
311
-
312
- // export interface PureAspects {}
313
- export const Pure: PureOps = {
314
- // $: {}
315
- }
316
-
317
- // /**
318
- // * @tsplus static Pure.Ops makeDSL
319
- // */
320
226
  // export function makeProgramDSL<W, S, S2 = S>(): ProgramDSL<W, S, S2> {
321
227
  // return makeDSL_<W,S, S2>()
322
228
  // }
@@ -422,35 +328,20 @@ export const Pure: PureOps = {
422
328
 
423
329
  // type dsl_<W,S, S2 = S> = ReturnType<typeof makeDSL_<W, S, S2>>
424
330
 
425
- // /**
426
- // * @tsplus type Pure/DSL
427
- // */
428
331
  // export interface ProgramDSL<W, S, S2 = S> extends dsl_<W, S, S2> { }
429
332
 
430
- // /**
431
- // * @tsplus fluent Pure/DSL modifyWithEffect
432
- // */
433
333
  // export function dslmodifyM<W, S, R, E, A>(dsl: ProgramDSL<W, S>, mod: (s: S, dsl: ProgramDSL<W, S>) => Effect.Effect<R, E, readonly [S, A]>) {
434
334
  // return dsl.modifyM(_ => mod(_, dsl))
435
335
  // }
436
336
 
437
- // /**
438
- // * @tsplus fluent Pure/DSL modifyWith
439
- // */
440
337
  // export function dslmodify<W, S, A>(dsl: ProgramDSL<W, S>, mod: (s: S, dsl: ProgramDSL<W, S>) => readonly [S, A]) {
441
338
  // return dsl.modify(_ => mod(_, dsl))
442
339
  // }
443
340
 
444
- // /**
445
- // * @tsplus fluent Pure/DSL updateWithEffect
446
- // */
447
341
  // export function dslupdateM<W, S, R, E, S2, S3>(dsl: ProgramDSL<W, S, S2>, upd: (s: S2, dsl: ProgramDSL<W, S, S2>) => Effect.Effect<R, E, S3>) {
448
342
  // return dsl.updateM(_ => upd(_, dsl))
449
343
  // }
450
344
 
451
- // /**
452
- // * @tsplus fluent Pure/DSL updateWith
453
- // */
454
345
  // export function dslupdate<W, S>(dsl: ProgramDSL<W, S>, upd: (s: S, dsl: ProgramDSL<W, S>) => S) {
455
346
  // return dsl.update(_ => upd(_, dsl))
456
347
  // }
@@ -13,6 +13,14 @@ type _OptionalKeys<O> = {
13
13
 
14
14
  type FilterOptionalKeys<A> = Omit<A, _OptionalKeys<A>>
15
15
 
16
+ type ClassAnnotations<Self, A> =
17
+ | S.Annotations.Schema<Self>
18
+ | readonly [
19
+ S.Annotations.Schema<Self> | undefined,
20
+ S.Annotations.Schema<Self>?,
21
+ S.Annotations.Schema<A>?
22
+ ]
23
+
16
24
  export interface EnhancedClass<Self, Fields extends Struct.Fields, I, R, C, Inherited, Proto>
17
25
  extends Schema<Self, I, R>, PropsExtensions<Fields>
18
26
  {
@@ -25,76 +33,76 @@ export interface EnhancedClass<Self, Fields extends Struct.Fields, I, R, C, Inhe
25
33
 
26
34
  readonly fields: Simplify<Fields>
27
35
 
28
- readonly extend: <Extended = never>(identifier?: string) => <newFields extends Struct.Fields>(
29
- newFieldsOr: newFields | HasFields<newFields>,
30
- annotations?: S.Annotations.Schema<Extended>
36
+ readonly extend: <Extended = never>(identifier?: string) => <NewFields extends Struct.Fields>(
37
+ newFieldsOr: NewFields | HasFields<NewFields>,
38
+ annotations?: ClassAnnotations<Extended, Struct.Type<Fields & NewFields>>
31
39
  ) => [Extended] extends [never] ? MissingSelfGeneric<"Base.extend">
32
40
  : EnhancedClass<
33
41
  Extended,
34
- Fields & newFields,
35
- Simplify<I & Struct.Encoded<newFields>>,
36
- R | Struct.Context<newFields>,
37
- Simplify<C & S.Struct.Constructor<newFields>>,
42
+ Fields & NewFields,
43
+ Simplify<I & Struct.Encoded<NewFields>>,
44
+ R | Struct.Context<NewFields>,
45
+ Simplify<C & S.Struct.Constructor<NewFields>>,
38
46
  Self,
39
47
  Proto
40
48
  >
41
49
 
42
50
  readonly transformOrFail: <Transformed = never>(identifier?: string) => <
43
- newFields extends Struct.Fields,
51
+ NewFields extends Struct.Fields,
44
52
  R2,
45
53
  R3
46
54
  >(
47
- fields: newFields,
55
+ fields: NewFields,
48
56
  options: {
49
57
  readonly decode: (
50
58
  input: Types.Simplify<Struct.Type<Fields>>,
51
59
  options: ParseOptions,
52
60
  ast: AST.Transformation
53
- ) => Effect.Effect<Types.Simplify<Struct.Type<Fields & newFields>>, ParseResult.ParseIssue, R2>
61
+ ) => Effect.Effect<Types.Simplify<Struct.Type<Fields & NewFields>>, ParseResult.ParseIssue, R2>
54
62
  readonly encode: (
55
- input: Types.Simplify<Struct.Type<Fields & newFields>>,
63
+ input: Types.Simplify<Struct.Type<Fields & NewFields>>,
56
64
  options: ParseOptions,
57
65
  ast: AST.Transformation
58
66
  ) => Effect.Effect<Struct.Type<Fields>, ParseResult.ParseIssue, R3>
59
67
  },
60
- annotations?: S.Annotations.Schema<Transformed>
68
+ annotations?: ClassAnnotations<Transformed, Struct.Type<Fields & NewFields>>
61
69
  ) => [Transformed] extends [never] ? MissingSelfGeneric<"Base.transform">
62
70
  : EnhancedClass<
63
71
  Transformed,
64
- Fields & newFields,
72
+ Fields & NewFields,
65
73
  I,
66
- R | Struct.Context<newFields> | R2 | R3,
67
- C & Struct.Constructor<newFields>,
74
+ R | Struct.Context<NewFields> | R2 | R3,
75
+ C & Struct.Constructor<NewFields>,
68
76
  Self,
69
77
  Proto
70
78
  >
71
79
 
72
80
  readonly transformOrFailFrom: <Transformed = never>(identifier?: string) => <
73
- newFields extends Struct.Fields,
81
+ NewFields extends Struct.Fields,
74
82
  R2,
75
83
  R3
76
84
  >(
77
- fields: newFields,
85
+ fields: NewFields,
78
86
  options: {
79
87
  readonly decode: (
80
88
  input: Types.Simplify<I>,
81
89
  options: ParseOptions,
82
90
  ast: AST.Transformation
83
- ) => Effect.Effect<Types.Simplify<I & Struct.Encoded<newFields>>, ParseResult.ParseIssue, R2>
91
+ ) => Effect.Effect<Types.Simplify<I & Struct.Encoded<NewFields>>, ParseResult.ParseIssue, R2>
84
92
  readonly encode: (
85
- input: Types.Simplify<I & Struct.Encoded<newFields>>,
93
+ input: Types.Simplify<I & Struct.Encoded<NewFields>>,
86
94
  options: ParseOptions,
87
95
  ast: AST.Transformation
88
96
  ) => Effect.Effect<I, ParseResult.ParseIssue, R3>
89
97
  },
90
- annotations?: S.Annotations.Schema<Transformed>
98
+ annotations?: ClassAnnotations<Transformed, Struct.Type<Fields & NewFields>>
91
99
  ) => [Transformed] extends [never] ? MissingSelfGeneric<"Base.transformFrom">
92
100
  : EnhancedClass<
93
101
  Transformed,
94
- Fields & newFields,
102
+ Fields & NewFields,
95
103
  I,
96
- R | Struct.Context<newFields> | R2 | R3,
97
- Simplify<C & S.Struct.Constructor<newFields>>,
104
+ R | Struct.Context<NewFields> | R2 | R3,
105
+ Simplify<C & S.Struct.Constructor<NewFields>>,
98
106
  Self,
99
107
  Proto
100
108
  >
@@ -148,7 +156,7 @@ type HasFields<Fields extends Struct.Fields> = {
148
156
 
149
157
  export const Class: <Self = never>(identifier?: string) => <Fields extends S.Struct.Fields>(
150
158
  fieldsOr: Fields | HasFields<Fields>,
151
- annotations?: S.Annotations.Schema<Self>
159
+ annotations?: ClassAnnotations<Self, Struct.Type<Fields>>
152
160
  ) => [Self] extends [never] ? MissingSelfGeneric<"Class">
153
161
  : EnhancedClass<
154
162
  Self,
@@ -173,7 +181,7 @@ export const Class: <Self = never>(identifier?: string) => <Fields extends S.Str
173
181
  export const TaggedClass: <Self = never>(identifier?: string) => <Tag extends string, Fields extends S.Struct.Fields>(
174
182
  tag: Tag,
175
183
  fieldsOr: Fields | HasFields<Fields>,
176
- annotations?: S.Annotations.Schema<Self>
184
+ annotations?: ClassAnnotations<Self, Struct.Type<Fields>>
177
185
  ) => [Self] extends [never] ? MissingSelfGeneric<"Class">
178
186
  : EnhancedClass<
179
187
  Self,
@@ -197,7 +205,7 @@ export const TaggedClass: <Self = never>(identifier?: string) => <Tag extends st
197
205
 
198
206
  export const ExtendedClass: <Self, SelfFrom>(identifier?: string) => <Fields extends S.Struct.Fields>(
199
207
  fieldsOr: Fields | HasFields<Fields>,
200
- annotations?: S.Annotations.Schema<Self>
208
+ annotations?: ClassAnnotations<Self, Struct.Type<Fields>>
201
209
  ) => EnhancedClass<
202
210
  Self,
203
211
  Fields,
@@ -213,7 +221,7 @@ export const ExtendedTaggedClass: <Self, SelfFrom>(
213
221
  ) => <Tag extends string, Fields extends S.Struct.Fields>(
214
222
  tag: Tag,
215
223
  fieldsOr: Fields | HasFields<Fields>,
216
- annotations?: S.Annotations.Schema<Self>
224
+ annotations?: ClassAnnotations<Self, Struct.Type<Fields>>
217
225
  ) => EnhancedClass<
218
226
  Self,
219
227
  { readonly _tag: S.tag<Tag> } & Fields,
package/src/Schema/ext.ts CHANGED
@@ -41,7 +41,8 @@ export declare namespace Struct {
41
41
  export type Fields = S.Struct.Fields
42
42
  export type Type<F extends Fields> = S.Struct.Type<F>
43
43
  export type Encoded<F extends Fields> = S.Struct.Encoded<F>
44
- export type Context<F extends Fields> = Schema.Context<F[keyof F]>
44
+ export type Context<F extends Fields> = S.Struct.Context<F>
45
+ export type Constructor<F extends Fields> = S.Struct.Constructor<F>
45
46
  }
46
47
 
47
48
  /**
@@ -125,9 +126,6 @@ export const defaultMap = <A, A2, I, R>(s: Schema<ReadonlyMap<A, A2>, I, R>) =>
125
126
  export const defaultSet = <A, I, R>(s: Schema<ReadonlySet<A>, I, R>) =>
126
127
  s.pipe(withDefaultConstructor(() => new Set<A>()))
127
128
 
128
- /**
129
- * @tsplus getter effect/schema/Schema withDefaultMake
130
- */
131
129
  export const withDefaultMake = <Self extends S.Schema<any, any, never>>(s: Self) => {
132
130
  const a = Object.assign(S.decodeSync(s) as WithDefaults<Self>, s)
133
131
  Object.setPrototypeOf(a, s)
package/src/Set.ts CHANGED
@@ -6,9 +6,6 @@ import { not } from "effect/Predicate"
6
6
  import type { Predicate, Refinement } from "./Function.js"
7
7
  import { identity, pipe, tuple } from "./Function.js"
8
8
 
9
- /**
10
- * @tsplus fluent ets/Set find
11
- */
12
9
  export function find_<A, B extends A>(
13
10
  as: ReadonlySet<A>,
14
11
  refinement: Refinement<A, B>
@@ -18,9 +15,6 @@ export function find_<A>(set: ReadonlySet<A>, predicate: Predicate<A>) {
18
15
  return [...set].find(predicate)
19
16
  }
20
17
 
21
- /**
22
- * @tsplus fluent ets/Set findFirst
23
- */
24
18
  export function findFirst_<A, B extends A>(
25
19
  set: ReadonlySet<A>,
26
20
  refinement: Refinement<A, B>
@@ -30,9 +24,6 @@ export function findFirst_<A>(set: ReadonlySet<A>, predicate: Predicate<A>): Opt
30
24
  return Option.fromNullable([...set].find(predicate))
31
25
  }
32
26
 
33
- /**
34
- * @tsplus fluent ets/Set findFirstMap
35
- */
36
27
  export function findFirstMap_<A, B>(
37
28
  set: ReadonlySet<A>,
38
29
  f: (a: A) => Option.Option<B>
@@ -152,7 +143,6 @@ export function some<A>(predicate: Predicate<A>): (set: Set<A>) => boolean {
152
143
 
153
144
  /**
154
145
  * true if one or more elements match predicate
155
- * @tsplus fluent ets/Set some
156
146
  */
157
147
  export function some_<A>(set: Set<A>, predicate: Predicate<A>): boolean {
158
148
  return some(predicate)(set)
@@ -256,7 +246,6 @@ export function filter<A>(predicate: Predicate<A>): (set: Set<A>) => Set<A> {
256
246
 
257
247
  /**
258
248
  * Filter set values using predicate
259
- * @tsplus fluent ets/Set filter
260
249
  */
261
250
  export function filter_<A, B extends A>(
262
251
  set: Set<A>,
package/src/Tag.ts CHANGED
@@ -1,20 +1,11 @@
1
- // /**
2
- // * @tsplus fluent effect/data/Context/Tag withEffect_
3
- // */
4
1
  // export function accessM_<T, I, R, E, A>(self: Tag<T, I>, f: (x: T) => Effect<R, E, A>) {
5
2
  // return Effect.serviceWithEffect(self)(f)
6
3
  // }
7
4
 
8
5
  import { Layer } from "effect"
9
6
 
10
- // /**
11
- // * @tsplus fluent effect/data/Context/Tag with_
12
- // */
13
7
  // export function access_<T, I, B>(self: Tag<T, I>, f: (x: T) => B) {
14
8
  // return Effect.serviceWith(self)(f)
15
9
  // }
16
10
 
17
- /**
18
- * @tsplus fluent effect/data/Context/Tag makeLayer
19
- */
20
11
  export const makeLayer = Layer.succeed