effect 3.8.5 → 3.9.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 (302) hide show
  1. package/dist/cjs/Array.js +24 -3
  2. package/dist/cjs/Array.js.map +1 -1
  3. package/dist/cjs/BigDecimal.js +3 -0
  4. package/dist/cjs/BigDecimal.js.map +1 -1
  5. package/dist/cjs/Chunk.js +3 -0
  6. package/dist/cjs/Chunk.js.map +1 -1
  7. package/dist/cjs/Context.js.map +1 -1
  8. package/dist/cjs/Cron.js +3 -0
  9. package/dist/cjs/Cron.js.map +1 -1
  10. package/dist/cjs/DateTime.js +6 -0
  11. package/dist/cjs/DateTime.js.map +1 -1
  12. package/dist/cjs/Duration.js +3 -0
  13. package/dist/cjs/Duration.js.map +1 -1
  14. package/dist/cjs/Effect.js +122 -35
  15. package/dist/cjs/Effect.js.map +1 -1
  16. package/dist/cjs/FiberHandle.js +3 -0
  17. package/dist/cjs/FiberHandle.js.map +1 -1
  18. package/dist/cjs/FiberMap.js +3 -0
  19. package/dist/cjs/FiberMap.js.map +1 -1
  20. package/dist/cjs/FiberSet.js +3 -0
  21. package/dist/cjs/FiberSet.js.map +1 -1
  22. package/dist/cjs/HashMap.js.map +1 -1
  23. package/dist/cjs/Inspectable.js +15 -1
  24. package/dist/cjs/Inspectable.js.map +1 -1
  25. package/dist/cjs/Layer.js.map +1 -1
  26. package/dist/cjs/List.js +6 -0
  27. package/dist/cjs/List.js.map +1 -1
  28. package/dist/cjs/ManagedRuntime.js +16 -1
  29. package/dist/cjs/ManagedRuntime.js.map +1 -1
  30. package/dist/cjs/Micro.js +6 -0
  31. package/dist/cjs/Micro.js.map +1 -1
  32. package/dist/cjs/MutableHashMap.js +3 -0
  33. package/dist/cjs/MutableHashMap.js.map +1 -1
  34. package/dist/cjs/MutableHashSet.js +3 -0
  35. package/dist/cjs/MutableHashSet.js.map +1 -1
  36. package/dist/cjs/MutableList.js +3 -0
  37. package/dist/cjs/MutableList.js.map +1 -1
  38. package/dist/cjs/MutableQueue.js +3 -0
  39. package/dist/cjs/MutableQueue.js.map +1 -1
  40. package/dist/cjs/MutableRef.js +3 -0
  41. package/dist/cjs/MutableRef.js.map +1 -1
  42. package/dist/cjs/Pool.js.map +1 -1
  43. package/dist/cjs/Predicate.js +18 -2
  44. package/dist/cjs/Predicate.js.map +1 -1
  45. package/dist/cjs/RegExp.js +20 -1
  46. package/dist/cjs/RegExp.js.map +1 -1
  47. package/dist/cjs/Resource.js.map +1 -1
  48. package/dist/cjs/ScopedRef.js.map +1 -1
  49. package/dist/cjs/SortedMap.js +3 -0
  50. package/dist/cjs/SortedMap.js.map +1 -1
  51. package/dist/cjs/SortedSet.js +3 -0
  52. package/dist/cjs/SortedSet.js.map +1 -1
  53. package/dist/cjs/Tuple.js +21 -2
  54. package/dist/cjs/Tuple.js.map +1 -1
  55. package/dist/cjs/Unify.js.map +1 -1
  56. package/dist/cjs/internal/cause.js +3 -0
  57. package/dist/cjs/internal/cause.js.map +1 -1
  58. package/dist/cjs/internal/context.js +6 -1
  59. package/dist/cjs/internal/context.js.map +1 -1
  60. package/dist/cjs/internal/core-effect.js.map +1 -1
  61. package/dist/cjs/internal/core.js +12 -0
  62. package/dist/cjs/internal/core.js.map +1 -1
  63. package/dist/cjs/internal/effect/circular.js +5 -1
  64. package/dist/cjs/internal/effect/circular.js.map +1 -1
  65. package/dist/cjs/internal/fiberId.js +9 -0
  66. package/dist/cjs/internal/fiberId.js.map +1 -1
  67. package/dist/cjs/internal/hashMap.js +3 -0
  68. package/dist/cjs/internal/hashMap.js.map +1 -1
  69. package/dist/cjs/internal/hashSet.js +3 -0
  70. package/dist/cjs/internal/hashSet.js.map +1 -1
  71. package/dist/cjs/internal/layer.js +33 -19
  72. package/dist/cjs/internal/layer.js.map +1 -1
  73. package/dist/cjs/internal/mailbox.js +3 -0
  74. package/dist/cjs/internal/mailbox.js.map +1 -1
  75. package/dist/cjs/internal/managedRuntime/circular.js +10 -0
  76. package/dist/cjs/internal/managedRuntime/circular.js.map +1 -0
  77. package/dist/cjs/internal/managedRuntime.js +23 -9
  78. package/dist/cjs/internal/managedRuntime.js.map +1 -1
  79. package/dist/cjs/internal/option.js +3 -0
  80. package/dist/cjs/internal/option.js.map +1 -1
  81. package/dist/cjs/internal/pool.js +6 -1
  82. package/dist/cjs/internal/pool.js.map +1 -1
  83. package/dist/cjs/internal/redBlackTree.js +3 -0
  84. package/dist/cjs/internal/redBlackTree.js.map +1 -1
  85. package/dist/cjs/internal/resource.js +15 -5
  86. package/dist/cjs/internal/resource.js.map +1 -1
  87. package/dist/cjs/internal/runtime.js +3 -0
  88. package/dist/cjs/internal/runtime.js.map +1 -1
  89. package/dist/cjs/internal/scopedRef.js +11 -8
  90. package/dist/cjs/internal/scopedRef.js.map +1 -1
  91. package/dist/cjs/internal/stm/core.js +1 -2
  92. package/dist/cjs/internal/stm/core.js.map +1 -1
  93. package/dist/cjs/internal/trie.js +3 -0
  94. package/dist/cjs/internal/trie.js.map +1 -1
  95. package/dist/cjs/internal/version.js +1 -1
  96. package/dist/dts/Array.d.ts +51 -2
  97. package/dist/dts/Array.d.ts.map +1 -1
  98. package/dist/dts/BigDecimal.d.ts.map +1 -1
  99. package/dist/dts/Chunk.d.ts.map +1 -1
  100. package/dist/dts/Context.d.ts +2 -3
  101. package/dist/dts/Context.d.ts.map +1 -1
  102. package/dist/dts/Cron.d.ts.map +1 -1
  103. package/dist/dts/DateTime.d.ts.map +1 -1
  104. package/dist/dts/Deferred.d.ts +1 -1
  105. package/dist/dts/Deferred.d.ts.map +1 -1
  106. package/dist/dts/Duration.d.ts.map +1 -1
  107. package/dist/dts/Effect.d.ts +233 -10
  108. package/dist/dts/Effect.d.ts.map +1 -1
  109. package/dist/dts/FiberHandle.d.ts.map +1 -1
  110. package/dist/dts/FiberMap.d.ts.map +1 -1
  111. package/dist/dts/FiberSet.d.ts.map +1 -1
  112. package/dist/dts/HashMap.d.ts +15 -0
  113. package/dist/dts/HashMap.d.ts.map +1 -1
  114. package/dist/dts/Inspectable.d.ts +15 -0
  115. package/dist/dts/Inspectable.d.ts.map +1 -1
  116. package/dist/dts/Layer.d.ts +46 -5
  117. package/dist/dts/Layer.d.ts.map +1 -1
  118. package/dist/dts/List.d.ts.map +1 -1
  119. package/dist/dts/ManagedRuntime.d.ts +41 -2
  120. package/dist/dts/ManagedRuntime.d.ts.map +1 -1
  121. package/dist/dts/Micro.d.ts.map +1 -1
  122. package/dist/dts/MutableHashMap.d.ts.map +1 -1
  123. package/dist/dts/MutableHashSet.d.ts.map +1 -1
  124. package/dist/dts/MutableList.d.ts.map +1 -1
  125. package/dist/dts/MutableQueue.d.ts.map +1 -1
  126. package/dist/dts/MutableRef.d.ts.map +1 -1
  127. package/dist/dts/Pool.d.ts +21 -1
  128. package/dist/dts/Pool.d.ts.map +1 -1
  129. package/dist/dts/Predicate.d.ts +15 -0
  130. package/dist/dts/Predicate.d.ts.map +1 -1
  131. package/dist/dts/Queue.d.ts +2 -2
  132. package/dist/dts/Queue.d.ts.map +1 -1
  133. package/dist/dts/RegExp.d.ts +12 -2
  134. package/dist/dts/RegExp.d.ts.map +1 -1
  135. package/dist/dts/Resource.d.ts +21 -1
  136. package/dist/dts/Resource.d.ts.map +1 -1
  137. package/dist/dts/ScopedRef.d.ts +21 -1
  138. package/dist/dts/ScopedRef.d.ts.map +1 -1
  139. package/dist/dts/SortedMap.d.ts.map +1 -1
  140. package/dist/dts/SortedSet.d.ts.map +1 -1
  141. package/dist/dts/Tuple.d.ts +59 -0
  142. package/dist/dts/Tuple.d.ts.map +1 -1
  143. package/dist/dts/Types.d.ts +39 -0
  144. package/dist/dts/Types.d.ts.map +1 -1
  145. package/dist/dts/Unify.d.ts +8 -13
  146. package/dist/dts/Unify.d.ts.map +1 -1
  147. package/dist/dts/internal/core.d.ts.map +1 -1
  148. package/dist/dts/internal/hashMap.d.ts.map +1 -1
  149. package/dist/dts/internal/layer.d.ts.map +1 -1
  150. package/dist/dts/internal/managedRuntime/circular.d.ts +2 -0
  151. package/dist/dts/internal/managedRuntime/circular.d.ts.map +1 -0
  152. package/dist/esm/Array.js +21 -0
  153. package/dist/esm/Array.js.map +1 -1
  154. package/dist/esm/BigDecimal.js +4 -1
  155. package/dist/esm/BigDecimal.js.map +1 -1
  156. package/dist/esm/Chunk.js +4 -1
  157. package/dist/esm/Chunk.js.map +1 -1
  158. package/dist/esm/Context.js.map +1 -1
  159. package/dist/esm/Cron.js +4 -1
  160. package/dist/esm/Cron.js.map +1 -1
  161. package/dist/esm/DateTime.js +6 -0
  162. package/dist/esm/DateTime.js.map +1 -1
  163. package/dist/esm/Duration.js +4 -1
  164. package/dist/esm/Duration.js.map +1 -1
  165. package/dist/esm/Effect.js +116 -30
  166. package/dist/esm/Effect.js.map +1 -1
  167. package/dist/esm/FiberHandle.js +3 -0
  168. package/dist/esm/FiberHandle.js.map +1 -1
  169. package/dist/esm/FiberMap.js +3 -0
  170. package/dist/esm/FiberMap.js.map +1 -1
  171. package/dist/esm/FiberSet.js +3 -0
  172. package/dist/esm/FiberSet.js.map +1 -1
  173. package/dist/esm/HashMap.js.map +1 -1
  174. package/dist/esm/Inspectable.js +14 -0
  175. package/dist/esm/Inspectable.js.map +1 -1
  176. package/dist/esm/Layer.js.map +1 -1
  177. package/dist/esm/List.js +7 -1
  178. package/dist/esm/List.js.map +1 -1
  179. package/dist/esm/ManagedRuntime.js +15 -0
  180. package/dist/esm/ManagedRuntime.js.map +1 -1
  181. package/dist/esm/Micro.js +7 -1
  182. package/dist/esm/Micro.js.map +1 -1
  183. package/dist/esm/MutableHashMap.js +4 -1
  184. package/dist/esm/MutableHashMap.js.map +1 -1
  185. package/dist/esm/MutableHashSet.js +4 -1
  186. package/dist/esm/MutableHashSet.js.map +1 -1
  187. package/dist/esm/MutableList.js +4 -1
  188. package/dist/esm/MutableList.js.map +1 -1
  189. package/dist/esm/MutableQueue.js +4 -1
  190. package/dist/esm/MutableQueue.js.map +1 -1
  191. package/dist/esm/MutableRef.js +4 -1
  192. package/dist/esm/MutableRef.js.map +1 -1
  193. package/dist/esm/Pool.js.map +1 -1
  194. package/dist/esm/Predicate.js +15 -0
  195. package/dist/esm/Predicate.js.map +1 -1
  196. package/dist/esm/RegExp.js +16 -0
  197. package/dist/esm/RegExp.js.map +1 -1
  198. package/dist/esm/Resource.js.map +1 -1
  199. package/dist/esm/ScopedRef.js.map +1 -1
  200. package/dist/esm/SortedMap.js +4 -1
  201. package/dist/esm/SortedMap.js.map +1 -1
  202. package/dist/esm/SortedSet.js +4 -1
  203. package/dist/esm/SortedSet.js.map +1 -1
  204. package/dist/esm/Tuple.js +19 -0
  205. package/dist/esm/Tuple.js.map +1 -1
  206. package/dist/esm/Unify.js.map +1 -1
  207. package/dist/esm/internal/cause.js +4 -1
  208. package/dist/esm/internal/cause.js.map +1 -1
  209. package/dist/esm/internal/context.js +7 -2
  210. package/dist/esm/internal/context.js.map +1 -1
  211. package/dist/esm/internal/core-effect.js.map +1 -1
  212. package/dist/esm/internal/core.js +13 -1
  213. package/dist/esm/internal/core.js.map +1 -1
  214. package/dist/esm/internal/effect/circular.js +5 -1
  215. package/dist/esm/internal/effect/circular.js.map +1 -1
  216. package/dist/esm/internal/fiberId.js +10 -1
  217. package/dist/esm/internal/fiberId.js.map +1 -1
  218. package/dist/esm/internal/hashMap.js +4 -1
  219. package/dist/esm/internal/hashMap.js.map +1 -1
  220. package/dist/esm/internal/hashSet.js +4 -1
  221. package/dist/esm/internal/hashSet.js.map +1 -1
  222. package/dist/esm/internal/layer.js +32 -18
  223. package/dist/esm/internal/layer.js.map +1 -1
  224. package/dist/esm/internal/mailbox.js +3 -0
  225. package/dist/esm/internal/mailbox.js.map +1 -1
  226. package/dist/esm/internal/managedRuntime/circular.js +4 -0
  227. package/dist/esm/internal/managedRuntime/circular.js.map +1 -0
  228. package/dist/esm/internal/managedRuntime.js +21 -8
  229. package/dist/esm/internal/managedRuntime.js.map +1 -1
  230. package/dist/esm/internal/option.js +4 -1
  231. package/dist/esm/internal/option.js.map +1 -1
  232. package/dist/esm/internal/pool.js +6 -1
  233. package/dist/esm/internal/pool.js.map +1 -1
  234. package/dist/esm/internal/redBlackTree.js +4 -1
  235. package/dist/esm/internal/redBlackTree.js.map +1 -1
  236. package/dist/esm/internal/resource.js +15 -5
  237. package/dist/esm/internal/resource.js.map +1 -1
  238. package/dist/esm/internal/runtime.js +3 -0
  239. package/dist/esm/internal/runtime.js.map +1 -1
  240. package/dist/esm/internal/scopedRef.js +11 -8
  241. package/dist/esm/internal/scopedRef.js.map +1 -1
  242. package/dist/esm/internal/stm/core.js +1 -2
  243. package/dist/esm/internal/stm/core.js.map +1 -1
  244. package/dist/esm/internal/trie.js +4 -1
  245. package/dist/esm/internal/trie.js.map +1 -1
  246. package/dist/esm/internal/version.js +1 -1
  247. package/package.json +1 -1
  248. package/src/Array.ts +68 -4
  249. package/src/BigDecimal.ts +4 -1
  250. package/src/Chunk.ts +4 -1
  251. package/src/Context.ts +2 -3
  252. package/src/Cron.ts +4 -1
  253. package/src/DateTime.ts +6 -0
  254. package/src/Deferred.ts +1 -1
  255. package/src/Duration.ts +4 -1
  256. package/src/Effect.ts +435 -56
  257. package/src/FiberHandle.ts +3 -0
  258. package/src/FiberMap.ts +3 -0
  259. package/src/FiberSet.ts +3 -0
  260. package/src/HashMap.ts +16 -0
  261. package/src/Inspectable.ts +22 -0
  262. package/src/Layer.ts +49 -8
  263. package/src/List.ts +7 -1
  264. package/src/ManagedRuntime.ts +46 -2
  265. package/src/Micro.ts +7 -1
  266. package/src/MutableHashMap.ts +4 -1
  267. package/src/MutableHashSet.ts +4 -1
  268. package/src/MutableList.ts +4 -1
  269. package/src/MutableQueue.ts +4 -1
  270. package/src/MutableRef.ts +4 -1
  271. package/src/Pool.ts +26 -1
  272. package/src/Predicate.ts +16 -0
  273. package/src/Queue.ts +2 -2
  274. package/src/RegExp.ts +17 -0
  275. package/src/Resource.ts +22 -1
  276. package/src/ScopedRef.ts +22 -1
  277. package/src/SortedMap.ts +4 -1
  278. package/src/SortedSet.ts +4 -1
  279. package/src/Tuple.ts +66 -0
  280. package/src/Types.ts +41 -0
  281. package/src/Unify.ts +9 -14
  282. package/src/internal/cause.ts +4 -1
  283. package/src/internal/context.ts +7 -2
  284. package/src/internal/core-effect.ts +7 -7
  285. package/src/internal/core.ts +13 -1
  286. package/src/internal/effect/circular.ts +8 -2
  287. package/src/internal/fiberId.ts +10 -1
  288. package/src/internal/hashMap.ts +4 -1
  289. package/src/internal/hashSet.ts +4 -1
  290. package/src/internal/layer.ts +105 -38
  291. package/src/internal/mailbox.ts +3 -0
  292. package/src/internal/managedRuntime/circular.ts +6 -0
  293. package/src/internal/managedRuntime.ts +36 -22
  294. package/src/internal/option.ts +4 -1
  295. package/src/internal/pool.ts +7 -1
  296. package/src/internal/redBlackTree.ts +4 -1
  297. package/src/internal/resource.ts +16 -5
  298. package/src/internal/runtime.ts +3 -0
  299. package/src/internal/scopedRef.ts +12 -8
  300. package/src/internal/stm/core.ts +2 -3
  301. package/src/internal/trie.ts +4 -1
  302. package/src/internal/version.ts +1 -1
@@ -16,6 +16,18 @@ export const NodeInspectSymbol = Symbol.for("nodejs.util.inspect.custom")
16
16
  */
17
17
  export type NodeInspectSymbol = typeof NodeInspectSymbol
18
18
 
19
+ /**
20
+ * @since 3.9.0
21
+ * @category symbols
22
+ */
23
+ export const DenoInspectSymbol = Symbol.for("Deno.customInspect")
24
+
25
+ /**
26
+ * @since 3.9.0
27
+ * @category symbols
28
+ */
29
+ export type DenoInspectSymbol = typeof DenoInspectSymbol
30
+
19
31
  /**
20
32
  * @since 2.0.0
21
33
  * @category models
@@ -24,6 +36,7 @@ export interface Inspectable {
24
36
  toString(): string
25
37
  toJSON(): unknown
26
38
  [NodeInspectSymbol](): unknown
39
+ [DenoInspectSymbol](): unknown
27
40
  }
28
41
 
29
42
  /**
@@ -56,6 +69,9 @@ export const BaseProto: Inspectable = {
56
69
  [NodeInspectSymbol]() {
57
70
  return this.toJSON()
58
71
  },
72
+ [DenoInspectSymbol]() {
73
+ return this.toJSON()
74
+ },
59
75
  toString() {
60
76
  return format(this.toJSON())
61
77
  }
@@ -75,6 +91,12 @@ export abstract class Class {
75
91
  [NodeInspectSymbol]() {
76
92
  return this.toJSON()
77
93
  }
94
+ /**
95
+ * @since 3.9.0
96
+ */
97
+ [DenoInspectSymbol]() {
98
+ return this.toJSON()
99
+ }
78
100
  /**
79
101
  * @since 2.0.0
80
102
  */
package/src/Layer.ts CHANGED
@@ -76,23 +76,34 @@ export declare namespace Layer {
76
76
  readonly _RIn: Types.Covariant<RIn>
77
77
  }
78
78
  }
79
+ /**
80
+ * @since 3.9.0
81
+ * @category type-level
82
+ */
83
+ export interface Any {
84
+ readonly [LayerTypeId]: {
85
+ readonly _ROut: any
86
+ readonly _E: any
87
+ readonly _RIn: any
88
+ }
89
+ }
79
90
  /**
80
91
  * @since 2.0.0
81
92
  * @category type-level
82
93
  */
83
- export type Context<T extends Layer<never, any, any>> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _RIn
94
+ export type Context<T extends Any> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _RIn
84
95
  : never
85
96
  /**
86
97
  * @since 2.0.0
87
98
  * @category type-level
88
99
  */
89
- export type Error<T extends Layer<never, any, any>> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _E
100
+ export type Error<T extends Any> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _E
90
101
  : never
91
102
  /**
92
103
  * @since 2.0.0
93
104
  * @category type-level
94
105
  */
95
- export type Success<T extends Layer<never, any, any>> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _ROut
106
+ export type Success<T extends Any> = [T] extends [Layer<infer _ROut, infer _E, infer _RIn>] ? _ROut
96
107
  : never
97
108
  }
98
109
 
@@ -1157,8 +1168,24 @@ export const provide: {
1157
1168
  * @category utils
1158
1169
  */
1159
1170
  <RIn, E, ROut>(
1160
- self: Layer<ROut, E, RIn>
1161
- ): <RIn2, E2, ROut2>(that: Layer<ROut2, E2, RIn2>) => Layer<ROut2, E | E2, RIn | Exclude<RIn2, ROut>>
1171
+ that: Layer<ROut, E, RIn>
1172
+ ): <RIn2, E2, ROut2>(self: Layer<ROut2, E2, RIn2>) => Layer<ROut2, E | E2, RIn | Exclude<RIn2, ROut>>
1173
+ /**
1174
+ * Feeds the output services of this builder into the input of the specified
1175
+ * builder, resulting in a new builder with the inputs of this builder as
1176
+ * well as any leftover inputs, and the outputs of the specified builder.
1177
+ *
1178
+ * @since 2.0.0
1179
+ * @category utils
1180
+ */
1181
+ <const Layers extends [Layer.Any, ...Array<Layer.Any>]>(that: Layers): <A, E, R>(
1182
+ self: Layer<A, E, R>
1183
+ ) => Layer<
1184
+ A,
1185
+ E | { [k in keyof Layers]: Layer.Error<Layers[k]> }[number],
1186
+ | { [k in keyof Layers]: Layer.Context<Layers[k]> }[number]
1187
+ | Exclude<R, { [k in keyof Layers]: Layer.Success<Layers[k]> }[number]>
1188
+ >
1162
1189
  /**
1163
1190
  * Feeds the output services of this builder into the input of the specified
1164
1191
  * builder, resulting in a new builder with the inputs of this builder as
@@ -1168,9 +1195,23 @@ export const provide: {
1168
1195
  * @category utils
1169
1196
  */
1170
1197
  <RIn2, E2, ROut2, RIn, E, ROut>(
1171
- that: Layer<ROut2, E2, RIn2>,
1172
- self: Layer<ROut, E, RIn>
1173
- ): Layer<ROut2, E2 | E, RIn | Exclude<RIn2, ROut>>
1198
+ self: Layer<ROut2, E2, RIn2>,
1199
+ that: Layer<ROut, E, RIn>
1200
+ ): Layer<ROut2, E | E2, RIn | Exclude<RIn2, ROut>>
1201
+ /**
1202
+ * Feeds the output services of this builder into the input of the specified
1203
+ * builder, resulting in a new builder with the inputs of this builder as
1204
+ * well as any leftover inputs, and the outputs of the specified builder.
1205
+ *
1206
+ * @since 2.0.0
1207
+ * @category utils
1208
+ */
1209
+ <A, E, R, const Layers extends [Layer.Any, ...Array<Layer.Any>]>(self: Layer<A, E, R>, that: Layers): Layer<
1210
+ A,
1211
+ E | { [k in keyof Layers]: Layer.Error<Layers[k]> }[number],
1212
+ | { [k in keyof Layers]: Layer.Context<Layers[k]> }[number]
1213
+ | Exclude<R, { [k in keyof Layers]: Layer.Success<Layers[k]> }[number]>
1214
+ >
1174
1215
  } = internal.provide
1175
1216
 
1176
1217
  /**
package/src/List.ts CHANGED
@@ -28,7 +28,7 @@ import * as Equal from "./Equal.js"
28
28
  import * as Equivalence from "./Equivalence.js"
29
29
  import { dual, identity, unsafeCoerce } from "./Function.js"
30
30
  import * as Hash from "./Hash.js"
31
- import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
31
+ import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
32
32
  import type { nonEmpty, NonEmptyIterable } from "./NonEmptyIterable.js"
33
33
  import * as Option from "./Option.js"
34
34
  import type { Pipeable } from "./Pipeable.js"
@@ -110,6 +110,9 @@ const ConsProto: Omit<Cons<unknown>, "head" | "tail" | typeof nonEmpty> = {
110
110
  values: toArray(this).map(toJSON)
111
111
  }
112
112
  },
113
+ [DenoInspectSymbol]() {
114
+ return this.toJSON()
115
+ },
113
116
  [NodeInspectSymbol]() {
114
117
  return this.toJSON()
115
118
  },
@@ -176,6 +179,9 @@ const NilProto: Nil<unknown> = {
176
179
  _tag: "Nil"
177
180
  }
178
181
  },
182
+ [DenoInspectSymbol]() {
183
+ return this.toJSON()
184
+ },
179
185
  [NodeInspectSymbol]() {
180
186
  return this.toJSON()
181
187
  },
@@ -5,9 +5,32 @@ import type * as Effect from "./Effect.js"
5
5
  import type * as Exit from "./Exit.js"
6
6
  import type * as Fiber from "./Fiber.js"
7
7
  import * as internal from "./internal/managedRuntime.js"
8
+ import * as circular from "./internal/managedRuntime/circular.js"
8
9
  import type * as Layer from "./Layer.js"
9
- import type { Pipeable } from "./Pipeable.js"
10
10
  import type * as Runtime from "./Runtime.js"
11
+ import type * as Unify from "./Unify.js"
12
+
13
+ /**
14
+ * @since 3.9.0
15
+ * @category symbol
16
+ */
17
+ export const TypeId: unique symbol = circular.TypeId as TypeId
18
+
19
+ /**
20
+ * @since 3.9.0
21
+ * @category symbol
22
+ */
23
+ export type TypeId = typeof TypeId
24
+
25
+ /**
26
+ * Checks if the provided argument is a `ManagedRuntime`.
27
+ *
28
+ * @param input - The value to be checked if it is a `ManagedRuntime`.
29
+
30
+ * @since 3.9.0
31
+ * @category guards
32
+ */
33
+ export const isManagedRuntime: (input: unknown) => input is ManagedRuntime<unknown, unknown> = internal.isManagedRuntime
11
34
 
12
35
  /**
13
36
  * @since 3.4.0
@@ -29,7 +52,8 @@ export declare namespace ManagedRuntime {
29
52
  * @since 2.0.0
30
53
  * @category models
31
54
  */
32
- export interface ManagedRuntime<in R, out ER> extends Pipeable {
55
+ export interface ManagedRuntime<in R, out ER> extends Effect.Effect<Runtime.Runtime<R>, ER> {
56
+ readonly [TypeId]: TypeId
33
57
  readonly memoMap: Layer.MemoMap
34
58
  readonly runtimeEffect: Effect.Effect<Runtime.Runtime<R>, ER>
35
59
  readonly runtime: () => Promise<Runtime.Runtime<R>>
@@ -103,6 +127,26 @@ export interface ManagedRuntime<in R, out ER> extends Pipeable {
103
127
  * Dispose of the resources associated with the runtime.
104
128
  */
105
129
  readonly disposeEffect: Effect.Effect<void, never, never>
130
+
131
+ readonly [Unify.typeSymbol]?: unknown
132
+ readonly [Unify.unifySymbol]?: ManagedRuntimeUnify<this>
133
+ readonly [Unify.ignoreSymbol]?: ManagedRuntimeUnifyIgnore
134
+ }
135
+
136
+ /**
137
+ * @category models
138
+ * @since 3.9.0
139
+ */
140
+ export interface ManagedRuntimeUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
141
+ ManagedRuntime?: () => Extract<A[Unify.typeSymbol], ManagedRuntime<any, any>>
142
+ }
143
+
144
+ /**
145
+ * @category models
146
+ * @since 3.9.0
147
+ */
148
+ export interface ManagedRuntimeUnifyIgnore extends Effect.EffectUnifyIgnore {
149
+ Effect?: true
106
150
  }
107
151
 
108
152
  /**
package/src/Micro.ts CHANGED
@@ -13,7 +13,7 @@ import { constTrue, constVoid, dual, identity, type LazyArg } from "./Function.j
13
13
  import { globalValue } from "./GlobalValue.js"
14
14
  import type { TypeLambda } from "./HKT.js"
15
15
  import type { Inspectable } from "./Inspectable.js"
16
- import { NodeInspectSymbol, toStringUnknown } from "./Inspectable.js"
16
+ import { DenoInspectSymbol, NodeInspectSymbol, toStringUnknown } from "./Inspectable.js"
17
17
  import * as doNotation from "./internal/doNotation.js"
18
18
  import { StructuralPrototype } from "./internal/effectable.js"
19
19
  import { SingleShotGen } from "./internal/singleShotGen.js"
@@ -323,6 +323,9 @@ abstract class MicroCauseImpl<Tag extends string, E> extends globalThis.Error im
323
323
  toString() {
324
324
  return this.stack
325
325
  }
326
+ [DenoInspectSymbol]() {
327
+ return this.stack
328
+ }
326
329
  [NodeInspectSymbol]() {
327
330
  return this.stack
328
331
  }
@@ -5253,6 +5256,9 @@ const YieldableError: new(message?: string) => YieldableError = (function() {
5253
5256
  toJSON() {
5254
5257
  return { ...this }
5255
5258
  }
5259
+ [DenoInspectSymbol](): string {
5260
+ return this[NodeInspectSymbol]()
5261
+ }
5256
5262
  [NodeInspectSymbol](): string {
5257
5263
  const stack = this.stack
5258
5264
  if (stack) {
@@ -5,7 +5,7 @@ import type { NonEmptyArray } from "./Array.js"
5
5
  import * as Equal from "./Equal.js"
6
6
  import { dual } from "./Function.js"
7
7
  import * as Hash from "./Hash.js"
8
- import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
8
+ import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
9
9
  import * as Option from "./Option.js"
10
10
  import type { Pipeable } from "./Pipeable.js"
11
11
  import { pipeArguments } from "./Pipeable.js"
@@ -46,6 +46,9 @@ const MutableHashMapProto: Omit<MutableHashMap<unknown, unknown>, "referential"
46
46
  values: Array.from(this).map(toJSON)
47
47
  }
48
48
  },
49
+ [DenoInspectSymbol]() {
50
+ return this.toJSON()
51
+ },
49
52
  [NodeInspectSymbol]() {
50
53
  return this.toJSON()
51
54
  },
@@ -2,7 +2,7 @@
2
2
  * @since 2.0.0
3
3
  */
4
4
  import * as Dual from "./Function.js"
5
- import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
5
+ import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
6
6
  import * as MutableHashMap from "./MutableHashMap.js"
7
7
  import type { Pipeable } from "./Pipeable.js"
8
8
  import { pipeArguments } from "./Pipeable.js"
@@ -40,6 +40,9 @@ const MutableHashSetProto: Omit<MutableHashSet<unknown>, "keyMap"> = {
40
40
  values: Array.from(this).map(toJSON)
41
41
  }
42
42
  },
43
+ [DenoInspectSymbol]() {
44
+ return this.toJSON()
45
+ },
43
46
  [NodeInspectSymbol]() {
44
47
  return this.toJSON()
45
48
  },
@@ -2,7 +2,7 @@
2
2
  * @since 2.0.0
3
3
  */
4
4
  import * as Dual from "./Function.js"
5
- import { format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
5
+ import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
6
6
  import type { Inspectable } from "./Inspectable.js"
7
7
  import type { Pipeable } from "./Pipeable.js"
8
8
  import { pipeArguments } from "./Pipeable.js"
@@ -63,6 +63,9 @@ const MutableListProto: Omit<MutableList<unknown>, "head" | "tail"> = {
63
63
  values: Array.from(this).map(toJSON)
64
64
  }
65
65
  },
66
+ [DenoInspectSymbol]() {
67
+ return this.toJSON()
68
+ },
66
69
  [NodeInspectSymbol]() {
67
70
  return this.toJSON()
68
71
  },
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Chunk from "./Chunk.js"
5
5
  import * as Dual from "./Function.js"
6
- import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
6
+ import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
7
7
  import * as MutableList from "./MutableList.js"
8
8
  import type { Pipeable } from "./Pipeable.js"
9
9
  import { pipeArguments } from "./Pipeable.js"
@@ -59,6 +59,9 @@ const MutableQueueProto: Omit<MutableQueue<unknown>, "queue" | "capacity"> = {
59
59
  values: Array.from(this).map(toJSON)
60
60
  }
61
61
  },
62
+ [DenoInspectSymbol]() {
63
+ return this.toJSON()
64
+ },
62
65
  [NodeInspectSymbol]() {
63
66
  return this.toJSON()
64
67
  },
package/src/MutableRef.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Equal from "./Equal.js"
5
5
  import * as Dual from "./Function.js"
6
- import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
6
+ import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
7
7
  import type { Pipeable } from "./Pipeable.js"
8
8
  import { pipeArguments } from "./Pipeable.js"
9
9
 
@@ -37,6 +37,9 @@ const MutableRefProto: Omit<MutableRef<unknown>, "current"> = {
37
37
  current: toJSON(this.current)
38
38
  }
39
39
  },
40
+ [DenoInspectSymbol]() {
41
+ return this.toJSON()
42
+ },
40
43
  [NodeInspectSymbol]() {
41
44
  return this.toJSON()
42
45
  },
package/src/Pool.ts CHANGED
@@ -7,6 +7,7 @@ import * as internal from "./internal/pool.js"
7
7
  import type { Pipeable } from "./Pipeable.js"
8
8
  import type * as Scope from "./Scope.js"
9
9
  import type * as Types from "./Types.js"
10
+ import type * as Unify from "./Unify.js"
10
11
 
11
12
  /**
12
13
  * @since 2.0.0
@@ -28,7 +29,7 @@ export type PoolTypeId = typeof PoolTypeId
28
29
  * @since 2.0.0
29
30
  * @category models
30
31
  */
31
- export interface Pool<in out A, out E = never> extends Pool.Variance<A, E>, Pipeable {
32
+ export interface Pool<in out A, out E = never> extends Pool.Variance<A, E>, Effect.Effect<A, E, Scope.Scope>, Pipeable {
32
33
  /**
33
34
  * Retrieves an item from the pool in a scoped effect. Note that if
34
35
  * acquisition fails, then the returned effect will fail for that same reason.
@@ -42,6 +43,30 @@ export interface Pool<in out A, out E = never> extends Pool.Variance<A, E>, Pipe
42
43
  * than eagerly.
43
44
  */
44
45
  invalidate(item: A): Effect.Effect<void>
46
+
47
+ readonly [Unify.typeSymbol]?: unknown
48
+ readonly [Unify.unifySymbol]?: PoolUnify<this>
49
+ readonly [Unify.ignoreSymbol]?: PoolUnifyIgnore
50
+ }
51
+
52
+ /**
53
+ * @category models
54
+ * @since 3.9.0
55
+ */
56
+ export interface PoolUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
57
+ Pool?: () => Extract<A[Unify.typeSymbol], Pool<any, any>> extends Pool<infer A0, infer _E0> | infer _ ?
58
+ A0 extends any ? Extract<A[Unify.typeSymbol], Pool<A0, any>> extends Pool<A0, infer E1> ? Pool<A0, E1>
59
+ : never
60
+ : never :
61
+ never
62
+ }
63
+
64
+ /**
65
+ * @category models
66
+ * @since 3.9.0
67
+ */
68
+ export interface PoolUnifyIgnore extends Effect.EffectUnifyIgnore {
69
+ Effect?: true
45
70
  }
46
71
 
47
72
  /**
package/src/Predicate.ts CHANGED
@@ -855,6 +855,22 @@ export const isPromiseLike = (
855
855
  input: unknown
856
856
  ): input is PromiseLike<unknown> => hasProperty(input, "then") && isFunction(input.then)
857
857
 
858
+ /**
859
+ * Tests if a value is a `RegExp`.
860
+ *
861
+ * @param input - The value to test.
862
+ *
863
+ * @example
864
+ * import { Predicate } from "effect"
865
+ *
866
+ * assert.deepStrictEqual(Predicate.isRegExp(/a/), true)
867
+ * assert.deepStrictEqual(Predicate.isRegExp("a"), false)
868
+ *
869
+ * @category guards
870
+ * @since 3.9.0
871
+ */
872
+ export const isRegExp = (input: unknown): input is RegExp => input instanceof RegExp
873
+
858
874
  /**
859
875
  * @since 2.0.0
860
876
  */
package/src/Queue.ts CHANGED
@@ -64,7 +64,7 @@ export type BackingQueueTypeId = typeof BackingQueueTypeId
64
64
  * @since 2.0.0
65
65
  * @category models
66
66
  */
67
- export interface Queue<in out A> extends Enqueue<A>, Dequeue<A>, Pipeable {
67
+ export interface Queue<in out A> extends Enqueue<A>, Dequeue<A> {
68
68
  /** @internal */
69
69
  readonly queue: BackingQueue<A>
70
70
  /** @internal */
@@ -134,7 +134,7 @@ export interface Enqueue<in A> extends Queue.EnqueueVariance<A>, BaseQueue, Pipe
134
134
  * @since 2.0.0
135
135
  * @category models
136
136
  */
137
- export interface Dequeue<out A> extends Effect.Effect<A>, Queue.DequeueVariance<A>, BaseQueue, Pipeable {
137
+ export interface Dequeue<out A> extends Effect.Effect<A>, Queue.DequeueVariance<A>, BaseQueue {
138
138
  /**
139
139
  * Takes the oldest value in the queue. If the queue is empty, this will return
140
140
  * a computation that resumes when an item has been added to the queue.
package/src/RegExp.ts CHANGED
@@ -3,6 +3,23 @@
3
3
  *
4
4
  * @since 2.0.0
5
5
  */
6
+ import * as predicate from "./Predicate.js"
7
+
8
+ /**
9
+ * Tests if a value is a `RegExp`.
10
+ *
11
+ * @param input - The value to test.
12
+ *
13
+ * @example
14
+ * import { RegExp } from "effect"
15
+ *
16
+ * assert.deepStrictEqual(RegExp.isRegExp(/a/), true)
17
+ * assert.deepStrictEqual(RegExp.isRegExp("a"), false)
18
+ *
19
+ * @category guards
20
+ * @since 3.9.0
21
+ */
22
+ export const isRegExp: (input: unknown) => input is RegExp = predicate.isRegExp
6
23
 
7
24
  /**
8
25
  * Escapes special characters in a regular expression pattern.
package/src/Resource.ts CHANGED
@@ -8,6 +8,7 @@ import type * as Schedule from "./Schedule.js"
8
8
  import type * as Scope from "./Scope.js"
9
9
  import type * as ScopedRef from "./ScopedRef.js"
10
10
  import type * as Types from "./Types.js"
11
+ import type * as Unify from "./Unify.js"
11
12
 
12
13
  /**
13
14
  * @since 2.0.0
@@ -28,11 +29,31 @@ export type ResourceTypeId = typeof ResourceTypeId
28
29
  * @since 2.0.0
29
30
  * @category models
30
31
  */
31
- export interface Resource<in out A, in out E = never> extends Resource.Variance<A, E> {
32
+ export interface Resource<in out A, in out E = never> extends Effect.Effect<A, E>, Resource.Variance<A, E> {
32
33
  /** @internal */
33
34
  readonly scopedRef: ScopedRef.ScopedRef<Exit.Exit<A, E>>
34
35
  /** @internal */
35
36
  readonly acquire: Effect.Effect<A, E, Scope.Scope>
37
+
38
+ readonly [Unify.typeSymbol]?: unknown
39
+ readonly [Unify.unifySymbol]?: ResourceUnify<this>
40
+ readonly [Unify.ignoreSymbol]?: ResourceUnifyIgnore
41
+ }
42
+
43
+ /**
44
+ * @category models
45
+ * @since 3.9.0
46
+ */
47
+ export interface ResourceUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
48
+ Resource?: () => Extract<A[Unify.typeSymbol], Resource<any, any>>
49
+ }
50
+
51
+ /**
52
+ * @category models
53
+ * @since 3.9.0
54
+ */
55
+ export interface ResourceUnifyIgnore extends Effect.EffectUnifyIgnore {
56
+ Effect?: true
36
57
  }
37
58
 
38
59
  /**
package/src/ScopedRef.ts CHANGED
@@ -8,6 +8,7 @@ import type { Pipeable } from "./Pipeable.js"
8
8
  import type * as Scope from "./Scope.js"
9
9
  import type * as Synchronized from "./SynchronizedRef.js"
10
10
  import type * as Types from "./Types.js"
11
+ import type * as Unify from "./Unify.js"
11
12
 
12
13
  /**
13
14
  * @since 2.0.0
@@ -31,9 +32,29 @@ export type ScopedRefTypeId = typeof ScopedRefTypeId
31
32
  * @since 2.0.0
32
33
  * @category models
33
34
  */
34
- export interface ScopedRef<in out A> extends ScopedRef.Variance<A>, Pipeable {
35
+ export interface ScopedRef<in out A> extends Effect.Effect<A>, ScopedRef.Variance<A>, Pipeable {
35
36
  /** @internal */
36
37
  readonly ref: Synchronized.SynchronizedRef<readonly [Scope.Scope.Closeable, A]>
38
+
39
+ readonly [Unify.typeSymbol]?: unknown
40
+ readonly [Unify.unifySymbol]?: ScopedRefUnify<this>
41
+ readonly [Unify.ignoreSymbol]?: ScopedRefUnifyIgnore
42
+ }
43
+
44
+ /**
45
+ * @category models
46
+ * @since 3.9.0
47
+ */
48
+ export interface ScopedRefUnify<A extends { [Unify.typeSymbol]?: any }> extends Effect.EffectUnify<A> {
49
+ ScopedRef?: () => Extract<A[Unify.typeSymbol], ScopedRef<any>>
50
+ }
51
+
52
+ /**
53
+ * @category models
54
+ * @since 3.9.0
55
+ */
56
+ export interface ScopedRefUnifyIgnore extends Effect.EffectUnifyIgnore {
57
+ Effect?: true
37
58
  }
38
59
 
39
60
  /**
package/src/SortedMap.ts CHANGED
@@ -5,7 +5,7 @@ import * as Equal from "./Equal.js"
5
5
  import * as Dual from "./Function.js"
6
6
  import { pipe } from "./Function.js"
7
7
  import * as Hash from "./Hash.js"
8
- import { format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
8
+ import { DenoInspectSymbol, format, type Inspectable, NodeInspectSymbol, toJSON } from "./Inspectable.js"
9
9
  import * as Option from "./Option.js"
10
10
  import type { Order } from "./Order.js"
11
11
  import type { Pipeable } from "./Pipeable.js"
@@ -62,6 +62,9 @@ const SortedMapProto: Omit<SortedMap<unknown, unknown>, "tree"> = {
62
62
  values: Array.from(this).map(toJSON)
63
63
  }
64
64
  },
65
+ [DenoInspectSymbol]() {
66
+ return this.toJSON()
67
+ },
65
68
  [NodeInspectSymbol]() {
66
69
  return this.toJSON()
67
70
  },
package/src/SortedSet.ts CHANGED
@@ -7,7 +7,7 @@ import * as Dual from "./Function.js"
7
7
  import { pipe } from "./Function.js"
8
8
  import * as Hash from "./Hash.js"
9
9
  import type { Inspectable } from "./Inspectable.js"
10
- import { format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
10
+ import { DenoInspectSymbol, format, NodeInspectSymbol, toJSON } from "./Inspectable.js"
11
11
  import type { Order } from "./Order.js"
12
12
  import type { Pipeable } from "./Pipeable.js"
13
13
  import { pipeArguments } from "./Pipeable.js"
@@ -62,6 +62,9 @@ const SortedSetProto: Omit<SortedSet<unknown>, "keyTree"> = {
62
62
  values: Array.from(this).map(toJSON)
63
63
  }
64
64
  },
65
+ [DenoInspectSymbol]() {
66
+ return this.toJSON()
67
+ },
65
68
  [NodeInspectSymbol]() {
66
69
  return this.toJSON()
67
70
  },
package/src/Tuple.ts CHANGED
@@ -7,6 +7,7 @@ import * as Equivalence from "./Equivalence.js"
7
7
  import { dual } from "./Function.js"
8
8
  import type { TypeLambda } from "./HKT.js"
9
9
  import * as order from "./Order.js"
10
+ import type { TupleOf } from "./Types.js"
10
11
 
11
12
  /**
12
13
  * @category type lambdas
@@ -61,6 +62,71 @@ export const getFirst = <L, R>(self: readonly [L, R]): L => self[0]
61
62
  */
62
63
  export const getSecond = <L, R>(self: readonly [L, R]): R => self[1]
63
64
 
65
+ /**
66
+ * Transforms each element of tuple using the given function, treating tuple homomorphically
67
+ *
68
+ * @param self - A tuple.
69
+ * @param f - The function to transform elements of the tuple.
70
+ *
71
+ * @example
72
+ * import { pipe, Tuple } from "effect"
73
+ *
74
+ * const result = pipe(
75
+ * ["a", 1, false] as const,
76
+ * Tuple.map((el) => el.toString().toUpperCase())
77
+ * )
78
+ * assert.deepStrictEqual(result, ['A', '1', 'FALSE'])
79
+ *
80
+ * @category mapping
81
+ * @since 3.9.0
82
+ */
83
+ export const map: {
84
+ /**
85
+ * Transforms each element of tuple using the given function, treating tuple homomorphically
86
+ *
87
+ * @param self - A tuple.
88
+ * @param f - The function to transform elements of the tuple.
89
+ *
90
+ * @example
91
+ * import { pipe, Tuple } from "effect"
92
+ *
93
+ * const result = pipe(
94
+ * ["a", 1, false] as const,
95
+ * Tuple.map((el) => el.toString().toUpperCase())
96
+ * )
97
+ * assert.deepStrictEqual(result, ['A', '1', 'FALSE'])
98
+ *
99
+ * @category mapping
100
+ * @since 3.9.0
101
+ */
102
+ <T extends ReadonlyArray<any> | [], B>(fn: (element: T[number]) => B): (self: T) => TupleOf<T["length"], B>
103
+ /**
104
+ * Transforms each element of tuple using the given function, treating tuple homomorphically
105
+ *
106
+ * @param self - A tuple.
107
+ * @param f - The function to transform elements of the tuple.
108
+ *
109
+ * @example
110
+ * import { pipe, Tuple } from "effect"
111
+ *
112
+ * const result = pipe(
113
+ * ["a", 1, false] as const,
114
+ * Tuple.map((el) => el.toString().toUpperCase())
115
+ * )
116
+ * assert.deepStrictEqual(result, ['A', '1', 'FALSE'])
117
+ *
118
+ * @category mapping
119
+ * @since 3.9.0
120
+ */
121
+ <B, T extends ReadonlyArray<any> | []>(self: T, fn: (element: T[number]) => B): TupleOf<T["length"], B>
122
+ } = dual(
123
+ 2,
124
+ <N extends number, A, B>(
125
+ self: TupleOf<N, A>,
126
+ fn: (element: A) => B
127
+ ): TupleOf<N, B> => self.map((element) => fn(element)) as TupleOf<N, B>
128
+ )
129
+
64
130
  /**
65
131
  * Transforms both elements of a tuple using the given functions.
66
132
  *