@depup/effect 3.20.0-depup.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 (2716) hide show
  1. package/.index/package.json +6 -0
  2. package/Arbitrary/package.json +6 -0
  3. package/Array/package.json +6 -0
  4. package/BigDecimal/package.json +6 -0
  5. package/BigInt/package.json +6 -0
  6. package/Boolean/package.json +6 -0
  7. package/Brand/package.json +6 -0
  8. package/Cache/package.json +6 -0
  9. package/Cause/package.json +6 -0
  10. package/Channel/package.json +6 -0
  11. package/ChildExecutorDecision/package.json +6 -0
  12. package/Chunk/package.json +6 -0
  13. package/Clock/package.json +6 -0
  14. package/Config/package.json +6 -0
  15. package/ConfigError/package.json +6 -0
  16. package/ConfigProvider/package.json +6 -0
  17. package/ConfigProviderPathPatch/package.json +6 -0
  18. package/Console/package.json +6 -0
  19. package/Context/package.json +6 -0
  20. package/Cron/package.json +6 -0
  21. package/Data/package.json +6 -0
  22. package/DateTime/package.json +6 -0
  23. package/DefaultServices/package.json +6 -0
  24. package/Deferred/package.json +6 -0
  25. package/Differ/package.json +6 -0
  26. package/Duration/package.json +6 -0
  27. package/Effect/package.json +6 -0
  28. package/Effectable/package.json +6 -0
  29. package/Either/package.json +6 -0
  30. package/Encoding/package.json +6 -0
  31. package/Equal/package.json +6 -0
  32. package/Equivalence/package.json +6 -0
  33. package/ExecutionPlan/package.json +6 -0
  34. package/ExecutionStrategy/package.json +6 -0
  35. package/Exit/package.json +6 -0
  36. package/FastCheck/package.json +6 -0
  37. package/Fiber/package.json +6 -0
  38. package/FiberHandle/package.json +6 -0
  39. package/FiberId/package.json +6 -0
  40. package/FiberMap/package.json +6 -0
  41. package/FiberRef/package.json +6 -0
  42. package/FiberRefs/package.json +6 -0
  43. package/FiberRefsPatch/package.json +6 -0
  44. package/FiberSet/package.json +6 -0
  45. package/FiberStatus/package.json +6 -0
  46. package/Function/package.json +6 -0
  47. package/GlobalValue/package.json +6 -0
  48. package/Graph/package.json +6 -0
  49. package/GroupBy/package.json +6 -0
  50. package/HKT/package.json +6 -0
  51. package/Hash/package.json +6 -0
  52. package/HashMap/package.json +6 -0
  53. package/HashRing/package.json +6 -0
  54. package/HashSet/package.json +6 -0
  55. package/Inspectable/package.json +6 -0
  56. package/Iterable/package.json +6 -0
  57. package/JSONSchema/package.json +6 -0
  58. package/KeyedPool/package.json +6 -0
  59. package/LICENSE +21 -0
  60. package/Layer/package.json +6 -0
  61. package/LayerMap/package.json +6 -0
  62. package/List/package.json +6 -0
  63. package/LogLevel/package.json +6 -0
  64. package/LogSpan/package.json +6 -0
  65. package/Logger/package.json +6 -0
  66. package/Mailbox/package.json +6 -0
  67. package/ManagedRuntime/package.json +6 -0
  68. package/Match/package.json +6 -0
  69. package/MergeDecision/package.json +6 -0
  70. package/MergeState/package.json +6 -0
  71. package/MergeStrategy/package.json +6 -0
  72. package/Metric/package.json +6 -0
  73. package/MetricBoundaries/package.json +6 -0
  74. package/MetricHook/package.json +6 -0
  75. package/MetricKey/package.json +6 -0
  76. package/MetricKeyType/package.json +6 -0
  77. package/MetricLabel/package.json +6 -0
  78. package/MetricPair/package.json +6 -0
  79. package/MetricPolling/package.json +6 -0
  80. package/MetricRegistry/package.json +6 -0
  81. package/MetricState/package.json +6 -0
  82. package/Micro/package.json +6 -0
  83. package/ModuleVersion/package.json +6 -0
  84. package/MutableHashMap/package.json +6 -0
  85. package/MutableHashSet/package.json +6 -0
  86. package/MutableList/package.json +6 -0
  87. package/MutableQueue/package.json +6 -0
  88. package/MutableRef/package.json +6 -0
  89. package/NonEmptyIterable/package.json +6 -0
  90. package/Number/package.json +6 -0
  91. package/Option/package.json +6 -0
  92. package/Order/package.json +6 -0
  93. package/Ordering/package.json +6 -0
  94. package/ParseResult/package.json +6 -0
  95. package/PartitionedSemaphore/package.json +6 -0
  96. package/Pipeable/package.json +6 -0
  97. package/Pool/package.json +6 -0
  98. package/Predicate/package.json +6 -0
  99. package/Pretty/package.json +6 -0
  100. package/PrimaryKey/package.json +6 -0
  101. package/PubSub/package.json +6 -0
  102. package/Queue/package.json +6 -0
  103. package/README.md +32 -0
  104. package/Random/package.json +6 -0
  105. package/RateLimiter/package.json +6 -0
  106. package/RcMap/package.json +6 -0
  107. package/RcRef/package.json +6 -0
  108. package/Readable/package.json +6 -0
  109. package/Record/package.json +6 -0
  110. package/RedBlackTree/package.json +6 -0
  111. package/Redacted/package.json +6 -0
  112. package/Ref/package.json +6 -0
  113. package/RegExp/package.json +6 -0
  114. package/Reloadable/package.json +6 -0
  115. package/Request/package.json +6 -0
  116. package/RequestBlock/package.json +6 -0
  117. package/RequestResolver/package.json +6 -0
  118. package/Resource/package.json +6 -0
  119. package/Runtime/package.json +6 -0
  120. package/RuntimeFlags/package.json +6 -0
  121. package/RuntimeFlagsPatch/package.json +6 -0
  122. package/STM/package.json +6 -0
  123. package/Schedule/package.json +6 -0
  124. package/ScheduleDecision/package.json +6 -0
  125. package/ScheduleInterval/package.json +6 -0
  126. package/ScheduleIntervals/package.json +6 -0
  127. package/Scheduler/package.json +6 -0
  128. package/Schema/package.json +6 -0
  129. package/SchemaAST/package.json +6 -0
  130. package/Scope/package.json +6 -0
  131. package/ScopedCache/package.json +6 -0
  132. package/ScopedRef/package.json +6 -0
  133. package/Secret/package.json +6 -0
  134. package/SingleProducerAsyncInput/package.json +6 -0
  135. package/Sink/package.json +6 -0
  136. package/SortedMap/package.json +6 -0
  137. package/SortedSet/package.json +6 -0
  138. package/Stream/package.json +6 -0
  139. package/StreamEmit/package.json +6 -0
  140. package/StreamHaltStrategy/package.json +6 -0
  141. package/Streamable/package.json +6 -0
  142. package/String/package.json +6 -0
  143. package/Struct/package.json +6 -0
  144. package/Subscribable/package.json +6 -0
  145. package/SubscriptionRef/package.json +6 -0
  146. package/Supervisor/package.json +6 -0
  147. package/Symbol/package.json +6 -0
  148. package/SynchronizedRef/package.json +6 -0
  149. package/TArray/package.json +6 -0
  150. package/TDeferred/package.json +6 -0
  151. package/TMap/package.json +6 -0
  152. package/TPriorityQueue/package.json +6 -0
  153. package/TPubSub/package.json +6 -0
  154. package/TQueue/package.json +6 -0
  155. package/TRandom/package.json +6 -0
  156. package/TReentrantLock/package.json +6 -0
  157. package/TRef/package.json +6 -0
  158. package/TSemaphore/package.json +6 -0
  159. package/TSet/package.json +6 -0
  160. package/TSubscriptionRef/package.json +6 -0
  161. package/Take/package.json +6 -0
  162. package/TestAnnotation/package.json +6 -0
  163. package/TestAnnotationMap/package.json +6 -0
  164. package/TestAnnotations/package.json +6 -0
  165. package/TestClock/package.json +6 -0
  166. package/TestConfig/package.json +6 -0
  167. package/TestContext/package.json +6 -0
  168. package/TestLive/package.json +6 -0
  169. package/TestServices/package.json +6 -0
  170. package/TestSized/package.json +6 -0
  171. package/Tracer/package.json +6 -0
  172. package/Trie/package.json +6 -0
  173. package/Tuple/package.json +6 -0
  174. package/Types/package.json +6 -0
  175. package/Unify/package.json +6 -0
  176. package/UpstreamPullRequest/package.json +6 -0
  177. package/UpstreamPullStrategy/package.json +6 -0
  178. package/Utils/package.json +6 -0
  179. package/changes.json +14 -0
  180. package/dist/cjs/Arbitrary.js +813 -0
  181. package/dist/cjs/Arbitrary.js.map +1 -0
  182. package/dist/cjs/Array.js +2695 -0
  183. package/dist/cjs/Array.js.map +1 -0
  184. package/dist/cjs/BigDecimal.js +1116 -0
  185. package/dist/cjs/BigDecimal.js.map +1 -0
  186. package/dist/cjs/BigInt.js +567 -0
  187. package/dist/cjs/BigInt.js.map +1 -0
  188. package/dist/cjs/Boolean.js +251 -0
  189. package/dist/cjs/Boolean.js.map +1 -0
  190. package/dist/cjs/Brand.js +175 -0
  191. package/dist/cjs/Brand.js.map +1 -0
  192. package/dist/cjs/Cache.js +50 -0
  193. package/dist/cjs/Cache.js.map +1 -0
  194. package/dist/cjs/Cause.js +1011 -0
  195. package/dist/cjs/Cause.js.map +1 -0
  196. package/dist/cjs/Channel.js +889 -0
  197. package/dist/cjs/Channel.js.map +1 -0
  198. package/dist/cjs/ChildExecutorDecision.js +72 -0
  199. package/dist/cjs/ChildExecutorDecision.js.map +1 -0
  200. package/dist/cjs/Chunk.js +1114 -0
  201. package/dist/cjs/Chunk.js.map +1 -0
  202. package/dist/cjs/Clock.js +45 -0
  203. package/dist/cjs/Clock.js.map +1 -0
  204. package/dist/cjs/Config.js +328 -0
  205. package/dist/cjs/Config.js.map +1 -0
  206. package/dist/cjs/ConfigError.js +114 -0
  207. package/dist/cjs/ConfigError.js.map +1 -0
  208. package/dist/cjs/ConfigProvider.js +173 -0
  209. package/dist/cjs/ConfigProvider.js.map +1 -0
  210. package/dist/cjs/ConfigProviderPathPatch.js +38 -0
  211. package/dist/cjs/ConfigProviderPathPatch.js.map +1 -0
  212. package/dist/cjs/Console.js +125 -0
  213. package/dist/cjs/Console.js.map +1 -0
  214. package/dist/cjs/Context.js +367 -0
  215. package/dist/cjs/Context.js.map +1 -0
  216. package/dist/cjs/Cron.js +583 -0
  217. package/dist/cjs/Cron.js.map +1 -0
  218. package/dist/cjs/Data.js +291 -0
  219. package/dist/cjs/Data.js.map +1 -0
  220. package/dist/cjs/DateTime.js +1084 -0
  221. package/dist/cjs/DateTime.js.map +1 -0
  222. package/dist/cjs/DefaultServices.js +19 -0
  223. package/dist/cjs/DefaultServices.js.map +1 -0
  224. package/dist/cjs/Deferred.js +167 -0
  225. package/dist/cjs/Deferred.js.map +1 -0
  226. package/dist/cjs/Differ.js +140 -0
  227. package/dist/cjs/Differ.js.map +1 -0
  228. package/dist/cjs/Duration.js +737 -0
  229. package/dist/cjs/Duration.js.map +1 -0
  230. package/dist/cjs/Effect.js +10717 -0
  231. package/dist/cjs/Effect.js.map +1 -0
  232. package/dist/cjs/Effectable.js +58 -0
  233. package/dist/cjs/Effectable.js.map +1 -0
  234. package/dist/cjs/Either.js +654 -0
  235. package/dist/cjs/Either.js.map +1 -0
  236. package/dist/cjs/Encoding.js +155 -0
  237. package/dist/cjs/Encoding.js.map +1 -0
  238. package/dist/cjs/Equal.js +81 -0
  239. package/dist/cjs/Equal.js.map +1 -0
  240. package/dist/cjs/Equivalence.js +181 -0
  241. package/dist/cjs/Equivalence.js.map +1 -0
  242. package/dist/cjs/ExecutionPlan.js +108 -0
  243. package/dist/cjs/ExecutionPlan.js.map +1 -0
  244. package/dist/cjs/ExecutionStrategy.js +62 -0
  245. package/dist/cjs/ExecutionStrategy.js.map +1 -0
  246. package/dist/cjs/Exit.js +256 -0
  247. package/dist/cjs/Exit.js.map +1 -0
  248. package/dist/cjs/FastCheck.js +17 -0
  249. package/dist/cjs/FastCheck.js.map +1 -0
  250. package/dist/cjs/Fiber.js +340 -0
  251. package/dist/cjs/Fiber.js.map +1 -0
  252. package/dist/cjs/FiberHandle.js +335 -0
  253. package/dist/cjs/FiberHandle.js.map +1 -0
  254. package/dist/cjs/FiberId.js +122 -0
  255. package/dist/cjs/FiberId.js.map +1 -0
  256. package/dist/cjs/FiberMap.js +374 -0
  257. package/dist/cjs/FiberMap.js.map +1 -0
  258. package/dist/cjs/FiberRef.js +243 -0
  259. package/dist/cjs/FiberRef.js.map +1 -0
  260. package/dist/cjs/FiberRefs.js +91 -0
  261. package/dist/cjs/FiberRefs.js.map +1 -0
  262. package/dist/cjs/FiberRefsPatch.js +39 -0
  263. package/dist/cjs/FiberRefsPatch.js.map +1 -0
  264. package/dist/cjs/FiberSet.js +308 -0
  265. package/dist/cjs/FiberSet.js.map +1 -0
  266. package/dist/cjs/FiberStatus.js +59 -0
  267. package/dist/cjs/FiberStatus.js.map +1 -0
  268. package/dist/cjs/Function.js +488 -0
  269. package/dist/cjs/Function.js.map +1 -0
  270. package/dist/cjs/GlobalValue.js +59 -0
  271. package/dist/cjs/GlobalValue.js.map +1 -0
  272. package/dist/cjs/Graph.js +3080 -0
  273. package/dist/cjs/Graph.js.map +1 -0
  274. package/dist/cjs/GroupBy.js +47 -0
  275. package/dist/cjs/GroupBy.js.map +1 -0
  276. package/dist/cjs/HKT.js +6 -0
  277. package/dist/cjs/HKT.js.map +1 -0
  278. package/dist/cjs/Hash.js +184 -0
  279. package/dist/cjs/Hash.js.map +1 -0
  280. package/dist/cjs/HashMap.js +322 -0
  281. package/dist/cjs/HashMap.js.map +1 -0
  282. package/dist/cjs/HashRing.js +257 -0
  283. package/dist/cjs/HashRing.js.map +1 -0
  284. package/dist/cjs/HashSet.js +1262 -0
  285. package/dist/cjs/HashSet.js.map +1 -0
  286. package/dist/cjs/Inspectable.js +213 -0
  287. package/dist/cjs/Inspectable.js.map +1 -0
  288. package/dist/cjs/Iterable.js +1009 -0
  289. package/dist/cjs/Iterable.js.map +1 -0
  290. package/dist/cjs/JSONSchema.js +727 -0
  291. package/dist/cjs/JSONSchema.js.map +1 -0
  292. package/dist/cjs/KeyedPool.js +83 -0
  293. package/dist/cjs/KeyedPool.js.map +1 -0
  294. package/dist/cjs/Layer.js +651 -0
  295. package/dist/cjs/Layer.js.map +1 -0
  296. package/dist/cjs/LayerMap.js +212 -0
  297. package/dist/cjs/LayerMap.js.map +1 -0
  298. package/dist/cjs/List.js +784 -0
  299. package/dist/cjs/List.js.map +1 -0
  300. package/dist/cjs/LogLevel.js +143 -0
  301. package/dist/cjs/LogLevel.js.map +1 -0
  302. package/dist/cjs/LogSpan.js +23 -0
  303. package/dist/cjs/LogSpan.js.map +1 -0
  304. package/dist/cjs/Logger.js +497 -0
  305. package/dist/cjs/Logger.js.map +1 -0
  306. package/dist/cjs/Mailbox.js +105 -0
  307. package/dist/cjs/Mailbox.js.map +1 -0
  308. package/dist/cjs/ManagedRuntime.js +49 -0
  309. package/dist/cjs/ManagedRuntime.js.map +1 -0
  310. package/dist/cjs/Match.js +819 -0
  311. package/dist/cjs/Match.js.map +1 -0
  312. package/dist/cjs/MergeDecision.js +42 -0
  313. package/dist/cjs/MergeDecision.js.map +1 -0
  314. package/dist/cjs/MergeState.js +65 -0
  315. package/dist/cjs/MergeState.js.map +1 -0
  316. package/dist/cjs/MergeStrategy.js +59 -0
  317. package/dist/cjs/MergeStrategy.js.map +1 -0
  318. package/dist/cjs/Metric.js +415 -0
  319. package/dist/cjs/Metric.js.map +1 -0
  320. package/dist/cjs/MetricBoundaries.js +40 -0
  321. package/dist/cjs/MetricBoundaries.js.map +1 -0
  322. package/dist/cjs/MetricHook.js +54 -0
  323. package/dist/cjs/MetricHook.js.map +1 -0
  324. package/dist/cjs/MetricKey.js +70 -0
  325. package/dist/cjs/MetricKey.js.map +1 -0
  326. package/dist/cjs/MetricKeyType.js +94 -0
  327. package/dist/cjs/MetricKeyType.js.map +1 -0
  328. package/dist/cjs/MetricLabel.js +24 -0
  329. package/dist/cjs/MetricLabel.js.map +1 -0
  330. package/dist/cjs/MetricPair.js +28 -0
  331. package/dist/cjs/MetricPair.js.map +1 -0
  332. package/dist/cjs/MetricPolling.js +66 -0
  333. package/dist/cjs/MetricPolling.js.map +1 -0
  334. package/dist/cjs/MetricRegistry.js +23 -0
  335. package/dist/cjs/MetricRegistry.js.map +1 -0
  336. package/dist/cjs/MetricState.js +94 -0
  337. package/dist/cjs/MetricState.js.map +1 -0
  338. package/dist/cjs/Micro.js +2582 -0
  339. package/dist/cjs/Micro.js.map +1 -0
  340. package/dist/cjs/ModuleVersion.js +25 -0
  341. package/dist/cjs/ModuleVersion.js.map +1 -0
  342. package/dist/cjs/MutableHashMap.js +314 -0
  343. package/dist/cjs/MutableHashMap.js.map +1 -0
  344. package/dist/cjs/MutableHashSet.js +524 -0
  345. package/dist/cjs/MutableHashSet.js.map +1 -0
  346. package/dist/cjs/MutableList.js +258 -0
  347. package/dist/cjs/MutableList.js.map +1 -0
  348. package/dist/cjs/MutableQueue.js +173 -0
  349. package/dist/cjs/MutableQueue.js.map +1 -0
  350. package/dist/cjs/MutableRef.js +144 -0
  351. package/dist/cjs/MutableRef.js.map +1 -0
  352. package/dist/cjs/NonEmptyIterable.js +23 -0
  353. package/dist/cjs/NonEmptyIterable.js.map +1 -0
  354. package/dist/cjs/Number.js +903 -0
  355. package/dist/cjs/Number.js.map +1 -0
  356. package/dist/cjs/Option.js +1769 -0
  357. package/dist/cjs/Option.js.map +1 -0
  358. package/dist/cjs/Order.js +275 -0
  359. package/dist/cjs/Order.js.map +1 -0
  360. package/dist/cjs/Ordering.js +80 -0
  361. package/dist/cjs/Ordering.js.map +1 -0
  362. package/dist/cjs/ParseResult.js +1594 -0
  363. package/dist/cjs/ParseResult.js.map +1 -0
  364. package/dist/cjs/PartitionedSemaphore.js +147 -0
  365. package/dist/cjs/PartitionedSemaphore.js.map +1 -0
  366. package/dist/cjs/Pipeable.js +70 -0
  367. package/dist/cjs/Pipeable.js.map +1 -0
  368. package/dist/cjs/Pool.js +107 -0
  369. package/dist/cjs/Pool.js.map +1 -0
  370. package/dist/cjs/Predicate.js +1159 -0
  371. package/dist/cjs/Predicate.js.map +1 -0
  372. package/dist/cjs/Pretty.js +183 -0
  373. package/dist/cjs/Pretty.js.map +1 -0
  374. package/dist/cjs/PrimaryKey.js +21 -0
  375. package/dist/cjs/PrimaryKey.js.map +1 -0
  376. package/dist/cjs/PubSub.js +127 -0
  377. package/dist/cjs/PubSub.js.map +1 -0
  378. package/dist/cjs/Queue.js +255 -0
  379. package/dist/cjs/Queue.js.map +1 -0
  380. package/dist/cjs/Random.js +145 -0
  381. package/dist/cjs/Random.js.map +1 -0
  382. package/dist/cjs/RateLimiter.js +84 -0
  383. package/dist/cjs/RateLimiter.js.map +1 -0
  384. package/dist/cjs/RcMap.js +76 -0
  385. package/dist/cjs/RcMap.js.map +1 -0
  386. package/dist/cjs/RcRef.js +58 -0
  387. package/dist/cjs/RcRef.js.map +1 -0
  388. package/dist/cjs/Readable.js +55 -0
  389. package/dist/cjs/Readable.js.map +1 -0
  390. package/dist/cjs/Record.js +865 -0
  391. package/dist/cjs/Record.js.map +1 -0
  392. package/dist/cjs/RedBlackTree.js +266 -0
  393. package/dist/cjs/RedBlackTree.js.map +1 -0
  394. package/dist/cjs/Redacted.js +101 -0
  395. package/dist/cjs/Redacted.js.map +1 -0
  396. package/dist/cjs/Ref.js +84 -0
  397. package/dist/cjs/Ref.js.map +1 -0
  398. package/dist/cjs/RegExp.js +46 -0
  399. package/dist/cjs/RegExp.js.map +1 -0
  400. package/dist/cjs/Reloadable.js +66 -0
  401. package/dist/cjs/Reloadable.js.map +1 -0
  402. package/dist/cjs/Request.js +148 -0
  403. package/dist/cjs/Request.js.map +1 -0
  404. package/dist/cjs/RequestBlock.js +43 -0
  405. package/dist/cjs/RequestBlock.js.map +1 -0
  406. package/dist/cjs/RequestResolver.js +185 -0
  407. package/dist/cjs/RequestResolver.js.map +1 -0
  408. package/dist/cjs/Resource.js +51 -0
  409. package/dist/cjs/Resource.js.map +1 -0
  410. package/dist/cjs/Runtime.js +188 -0
  411. package/dist/cjs/Runtime.js.map +1 -0
  412. package/dist/cjs/RuntimeFlags.js +259 -0
  413. package/dist/cjs/RuntimeFlags.js.map +1 -0
  414. package/dist/cjs/RuntimeFlagsPatch.js +142 -0
  415. package/dist/cjs/RuntimeFlagsPatch.js.map +1 -0
  416. package/dist/cjs/STM.js +981 -0
  417. package/dist/cjs/STM.js.map +1 -0
  418. package/dist/cjs/Schedule.js +1603 -0
  419. package/dist/cjs/Schedule.js.map +1 -0
  420. package/dist/cjs/ScheduleDecision.js +34 -0
  421. package/dist/cjs/ScheduleDecision.js.map +1 -0
  422. package/dist/cjs/ScheduleInterval.js +107 -0
  423. package/dist/cjs/ScheduleInterval.js.map +1 -0
  424. package/dist/cjs/ScheduleIntervals.js +85 -0
  425. package/dist/cjs/ScheduleIntervals.js.map +1 -0
  426. package/dist/cjs/Scheduler.js +308 -0
  427. package/dist/cjs/Scheduler.js.map +1 -0
  428. package/dist/cjs/Schema.js +6254 -0
  429. package/dist/cjs/Schema.js.map +1 -0
  430. package/dist/cjs/SchemaAST.js +2552 -0
  431. package/dist/cjs/SchemaAST.js.map +1 -0
  432. package/dist/cjs/Scope.js +102 -0
  433. package/dist/cjs/Scope.js.map +1 -0
  434. package/dist/cjs/ScopedCache.js +31 -0
  435. package/dist/cjs/ScopedCache.js.map +1 -0
  436. package/dist/cjs/ScopedRef.js +49 -0
  437. package/dist/cjs/ScopedRef.js.map +1 -0
  438. package/dist/cjs/Secret.js +51 -0
  439. package/dist/cjs/Secret.js.map +1 -0
  440. package/dist/cjs/SingleProducerAsyncInput.js +14 -0
  441. package/dist/cjs/SingleProducerAsyncInput.js.map +1 -0
  442. package/dist/cjs/Sink.js +872 -0
  443. package/dist/cjs/Sink.js.map +1 -0
  444. package/dist/cjs/SortedMap.js +189 -0
  445. package/dist/cjs/SortedMap.js.map +1 -0
  446. package/dist/cjs/SortedSet.js +251 -0
  447. package/dist/cjs/SortedSet.js.map +1 -0
  448. package/dist/cjs/Stream.js +4112 -0
  449. package/dist/cjs/Stream.js.map +1 -0
  450. package/dist/cjs/StreamEmit.js +6 -0
  451. package/dist/cjs/StreamEmit.js.map +1 -0
  452. package/dist/cjs/StreamHaltStrategy.js +65 -0
  453. package/dist/cjs/StreamHaltStrategy.js.map +1 -0
  454. package/dist/cjs/Streamable.js +45 -0
  455. package/dist/cjs/Streamable.js.map +1 -0
  456. package/dist/cjs/String.js +680 -0
  457. package/dist/cjs/String.js.map +1 -0
  458. package/dist/cjs/Struct.js +202 -0
  459. package/dist/cjs/Struct.js.map +1 -0
  460. package/dist/cjs/Subscribable.js +67 -0
  461. package/dist/cjs/Subscribable.js.map +1 -0
  462. package/dist/cjs/SubscriptionRef.js +123 -0
  463. package/dist/cjs/SubscriptionRef.js.map +1 -0
  464. package/dist/cjs/Supervisor.js +115 -0
  465. package/dist/cjs/Supervisor.js.map +1 -0
  466. package/dist/cjs/Symbol.js +35 -0
  467. package/dist/cjs/Symbol.js.map +1 -0
  468. package/dist/cjs/SynchronizedRef.js +126 -0
  469. package/dist/cjs/SynchronizedRef.js.map +1 -0
  470. package/dist/cjs/TArray.js +314 -0
  471. package/dist/cjs/TArray.js.map +1 -0
  472. package/dist/cjs/TDeferred.js +40 -0
  473. package/dist/cjs/TDeferred.js.map +1 -0
  474. package/dist/cjs/TMap.js +286 -0
  475. package/dist/cjs/TMap.js.map +1 -0
  476. package/dist/cjs/TPriorityQueue.js +143 -0
  477. package/dist/cjs/TPriorityQueue.js.map +1 -0
  478. package/dist/cjs/TPubSub.js +138 -0
  479. package/dist/cjs/TPubSub.js.map +1 -0
  480. package/dist/cjs/TQueue.js +237 -0
  481. package/dist/cjs/TQueue.js.map +1 -0
  482. package/dist/cjs/TRandom.js +72 -0
  483. package/dist/cjs/TRandom.js.map +1 -0
  484. package/dist/cjs/TReentrantLock.js +149 -0
  485. package/dist/cjs/TReentrantLock.js.map +1 -0
  486. package/dist/cjs/TRef.js +83 -0
  487. package/dist/cjs/TRef.js.map +1 -0
  488. package/dist/cjs/TSemaphore.js +73 -0
  489. package/dist/cjs/TSemaphore.js.map +1 -0
  490. package/dist/cjs/TSet.js +208 -0
  491. package/dist/cjs/TSet.js.map +1 -0
  492. package/dist/cjs/TSubscriptionRef.js +95 -0
  493. package/dist/cjs/TSubscriptionRef.js.map +1 -0
  494. package/dist/cjs/Take.js +155 -0
  495. package/dist/cjs/Take.js.map +1 -0
  496. package/dist/cjs/TestAnnotation.js +105 -0
  497. package/dist/cjs/TestAnnotation.js.map +1 -0
  498. package/dist/cjs/TestAnnotationMap.js +91 -0
  499. package/dist/cjs/TestAnnotationMap.js.map +1 -0
  500. package/dist/cjs/TestAnnotations.js +71 -0
  501. package/dist/cjs/TestAnnotations.js.map +1 -0
  502. package/dist/cjs/TestClock.js +372 -0
  503. package/dist/cjs/TestClock.js.map +1 -0
  504. package/dist/cjs/TestConfig.js +22 -0
  505. package/dist/cjs/TestConfig.js.map +1 -0
  506. package/dist/cjs/TestContext.js +28 -0
  507. package/dist/cjs/TestContext.js.map +1 -0
  508. package/dist/cjs/TestLive.js +39 -0
  509. package/dist/cjs/TestLive.js.map +1 -0
  510. package/dist/cjs/TestServices.js +255 -0
  511. package/dist/cjs/TestServices.js.map +1 -0
  512. package/dist/cjs/TestSized.js +46 -0
  513. package/dist/cjs/TestSized.js.map +1 -0
  514. package/dist/cjs/Tracer.js +44 -0
  515. package/dist/cjs/Tracer.js.map +1 -0
  516. package/dist/cjs/Trie.js +724 -0
  517. package/dist/cjs/Trie.js.map +1 -0
  518. package/dist/cjs/Tuple.js +210 -0
  519. package/dist/cjs/Tuple.js.map +1 -0
  520. package/dist/cjs/Types.js +6 -0
  521. package/dist/cjs/Types.js.map +1 -0
  522. package/dist/cjs/Unify.js +16 -0
  523. package/dist/cjs/Unify.js.map +1 -0
  524. package/dist/cjs/UpstreamPullRequest.js +59 -0
  525. package/dist/cjs/UpstreamPullRequest.js.map +1 -0
  526. package/dist/cjs/UpstreamPullStrategy.js +59 -0
  527. package/dist/cjs/UpstreamPullStrategy.js.map +1 -0
  528. package/dist/cjs/Utils.js +374 -0
  529. package/dist/cjs/Utils.js.map +1 -0
  530. package/dist/cjs/index.js +395 -0
  531. package/dist/cjs/index.js.map +1 -0
  532. package/dist/cjs/internal/array.js +13 -0
  533. package/dist/cjs/internal/array.js.map +1 -0
  534. package/dist/cjs/internal/blockedRequests.js +369 -0
  535. package/dist/cjs/internal/blockedRequests.js.map +1 -0
  536. package/dist/cjs/internal/cache.js +500 -0
  537. package/dist/cjs/internal/cache.js.map +1 -0
  538. package/dist/cjs/internal/cause.js +867 -0
  539. package/dist/cjs/internal/cause.js.map +1 -0
  540. package/dist/cjs/internal/channel/channelExecutor.js +697 -0
  541. package/dist/cjs/internal/channel/channelExecutor.js.map +1 -0
  542. package/dist/cjs/internal/channel/channelState.js +77 -0
  543. package/dist/cjs/internal/channel/channelState.js.map +1 -0
  544. package/dist/cjs/internal/channel/childExecutorDecision.js +74 -0
  545. package/dist/cjs/internal/channel/childExecutorDecision.js.map +1 -0
  546. package/dist/cjs/internal/channel/continuation.js +57 -0
  547. package/dist/cjs/internal/channel/continuation.js.map +1 -0
  548. package/dist/cjs/internal/channel/mergeDecision.js +60 -0
  549. package/dist/cjs/internal/channel/mergeDecision.js.map +1 -0
  550. package/dist/cjs/internal/channel/mergeState.js +83 -0
  551. package/dist/cjs/internal/channel/mergeState.js.map +1 -0
  552. package/dist/cjs/internal/channel/mergeStrategy.js +58 -0
  553. package/dist/cjs/internal/channel/mergeStrategy.js.map +1 -0
  554. package/dist/cjs/internal/channel/singleProducerAsyncInput.js +171 -0
  555. package/dist/cjs/internal/channel/singleProducerAsyncInput.js.map +1 -0
  556. package/dist/cjs/internal/channel/subexecutor.js +163 -0
  557. package/dist/cjs/internal/channel/subexecutor.js.map +1 -0
  558. package/dist/cjs/internal/channel/upstreamPullRequest.js +64 -0
  559. package/dist/cjs/internal/channel/upstreamPullRequest.js.map +1 -0
  560. package/dist/cjs/internal/channel/upstreamPullStrategy.js +64 -0
  561. package/dist/cjs/internal/channel/upstreamPullStrategy.js.map +1 -0
  562. package/dist/cjs/internal/channel.js +738 -0
  563. package/dist/cjs/internal/channel.js.map +1 -0
  564. package/dist/cjs/internal/clock.js +85 -0
  565. package/dist/cjs/internal/clock.js.map +1 -0
  566. package/dist/cjs/internal/completedRequestMap.js +11 -0
  567. package/dist/cjs/internal/completedRequestMap.js.map +1 -0
  568. package/dist/cjs/internal/concurrency.js +37 -0
  569. package/dist/cjs/internal/concurrency.js.map +1 -0
  570. package/dist/cjs/internal/config.js +397 -0
  571. package/dist/cjs/internal/config.js.map +1 -0
  572. package/dist/cjs/internal/configError.js +284 -0
  573. package/dist/cjs/internal/configError.js.map +1 -0
  574. package/dist/cjs/internal/configProvider/pathPatch.js +83 -0
  575. package/dist/cjs/internal/configProvider/pathPatch.js.map +1 -0
  576. package/dist/cjs/internal/configProvider.js +443 -0
  577. package/dist/cjs/internal/configProvider.js.map +1 -0
  578. package/dist/cjs/internal/console.js +79 -0
  579. package/dist/cjs/internal/console.js.map +1 -0
  580. package/dist/cjs/internal/context.js +273 -0
  581. package/dist/cjs/internal/context.js.map +1 -0
  582. package/dist/cjs/internal/core-effect.js +872 -0
  583. package/dist/cjs/internal/core-effect.js.map +1 -0
  584. package/dist/cjs/internal/core-stream.js +258 -0
  585. package/dist/cjs/internal/core-stream.js.map +1 -0
  586. package/dist/cjs/internal/core.js +1713 -0
  587. package/dist/cjs/internal/core.js.map +1 -0
  588. package/dist/cjs/internal/data.js +37 -0
  589. package/dist/cjs/internal/data.js.map +1 -0
  590. package/dist/cjs/internal/dataSource.js +107 -0
  591. package/dist/cjs/internal/dataSource.js.map +1 -0
  592. package/dist/cjs/internal/dateTime.js +839 -0
  593. package/dist/cjs/internal/dateTime.js.map +1 -0
  594. package/dist/cjs/internal/defaultServices/console.js +99 -0
  595. package/dist/cjs/internal/defaultServices/console.js.map +1 -0
  596. package/dist/cjs/internal/defaultServices.js +92 -0
  597. package/dist/cjs/internal/defaultServices.js.map +1 -0
  598. package/dist/cjs/internal/deferred.js +36 -0
  599. package/dist/cjs/internal/deferred.js.map +1 -0
  600. package/dist/cjs/internal/differ/chunkPatch.js +139 -0
  601. package/dist/cjs/internal/differ/chunkPatch.js.map +1 -0
  602. package/dist/cjs/internal/differ/contextPatch.js +152 -0
  603. package/dist/cjs/internal/differ/contextPatch.js.map +1 -0
  604. package/dist/cjs/internal/differ/hashMapPatch.js +139 -0
  605. package/dist/cjs/internal/differ/hashMapPatch.js.map +1 -0
  606. package/dist/cjs/internal/differ/hashSetPatch.js +113 -0
  607. package/dist/cjs/internal/differ/hashSetPatch.js.map +1 -0
  608. package/dist/cjs/internal/differ/orPatch.js +184 -0
  609. package/dist/cjs/internal/differ/orPatch.js.map +1 -0
  610. package/dist/cjs/internal/differ/readonlyArrayPatch.js +138 -0
  611. package/dist/cjs/internal/differ/readonlyArrayPatch.js.map +1 -0
  612. package/dist/cjs/internal/differ.js +149 -0
  613. package/dist/cjs/internal/differ.js.map +1 -0
  614. package/dist/cjs/internal/doNotation.js +25 -0
  615. package/dist/cjs/internal/doNotation.js.map +1 -0
  616. package/dist/cjs/internal/effect/circular.js +420 -0
  617. package/dist/cjs/internal/effect/circular.js.map +1 -0
  618. package/dist/cjs/internal/effectable.js +120 -0
  619. package/dist/cjs/internal/effectable.js.map +1 -0
  620. package/dist/cjs/internal/either.js +100 -0
  621. package/dist/cjs/internal/either.js.map +1 -0
  622. package/dist/cjs/internal/encoding/base64.js +81 -0
  623. package/dist/cjs/internal/encoding/base64.js.map +1 -0
  624. package/dist/cjs/internal/encoding/base64Url.js +30 -0
  625. package/dist/cjs/internal/encoding/base64Url.js.map +1 -0
  626. package/dist/cjs/internal/encoding/common.js +48 -0
  627. package/dist/cjs/internal/encoding/common.js.map +1 -0
  628. package/dist/cjs/internal/encoding/hex.js +57 -0
  629. package/dist/cjs/internal/encoding/hex.js.map +1 -0
  630. package/dist/cjs/internal/errors.js +13 -0
  631. package/dist/cjs/internal/errors.js.map +1 -0
  632. package/dist/cjs/internal/executionPlan.js +68 -0
  633. package/dist/cjs/internal/executionPlan.js.map +1 -0
  634. package/dist/cjs/internal/executionStrategy.js +54 -0
  635. package/dist/cjs/internal/executionStrategy.js.map +1 -0
  636. package/dist/cjs/internal/fiber.js +279 -0
  637. package/dist/cjs/internal/fiber.js.map +1 -0
  638. package/dist/cjs/internal/fiberId.js +239 -0
  639. package/dist/cjs/internal/fiberId.js.map +1 -0
  640. package/dist/cjs/internal/fiberMessage.js +38 -0
  641. package/dist/cjs/internal/fiberMessage.js.map +1 -0
  642. package/dist/cjs/internal/fiberRefs/patch.js +115 -0
  643. package/dist/cjs/internal/fiberRefs/patch.js.map +1 -0
  644. package/dist/cjs/internal/fiberRefs.js +203 -0
  645. package/dist/cjs/internal/fiberRefs.js.map +1 -0
  646. package/dist/cjs/internal/fiberRuntime.js +2207 -0
  647. package/dist/cjs/internal/fiberRuntime.js.map +1 -0
  648. package/dist/cjs/internal/fiberScope.js +52 -0
  649. package/dist/cjs/internal/fiberScope.js.map +1 -0
  650. package/dist/cjs/internal/fiberStatus.js +85 -0
  651. package/dist/cjs/internal/fiberStatus.js.map +1 -0
  652. package/dist/cjs/internal/groupBy.js +222 -0
  653. package/dist/cjs/internal/groupBy.js.map +1 -0
  654. package/dist/cjs/internal/hashMap/array.js +56 -0
  655. package/dist/cjs/internal/hashMap/array.js.map +1 -0
  656. package/dist/cjs/internal/hashMap/bitwise.js +38 -0
  657. package/dist/cjs/internal/hashMap/bitwise.js.map +1 -0
  658. package/dist/cjs/internal/hashMap/config.js +17 -0
  659. package/dist/cjs/internal/hashMap/config.js.map +1 -0
  660. package/dist/cjs/internal/hashMap/keySet.js +12 -0
  661. package/dist/cjs/internal/hashMap/keySet.js.map +1 -0
  662. package/dist/cjs/internal/hashMap/node.js +268 -0
  663. package/dist/cjs/internal/hashMap/node.js.map +1 -0
  664. package/dist/cjs/internal/hashMap.js +379 -0
  665. package/dist/cjs/internal/hashMap.js.map +1 -0
  666. package/dist/cjs/internal/hashSet.js +198 -0
  667. package/dist/cjs/internal/hashSet.js.map +1 -0
  668. package/dist/cjs/internal/keyedPool.js +170 -0
  669. package/dist/cjs/internal/keyedPool.js.map +1 -0
  670. package/dist/cjs/internal/layer/circular.js +80 -0
  671. package/dist/cjs/internal/layer/circular.js.map +1 -0
  672. package/dist/cjs/internal/layer.js +595 -0
  673. package/dist/cjs/internal/layer.js.map +1 -0
  674. package/dist/cjs/internal/logSpan.js +26 -0
  675. package/dist/cjs/internal/logSpan.js.map +1 -0
  676. package/dist/cjs/internal/logger-circular.js +26 -0
  677. package/dist/cjs/internal/logger-circular.js.map +1 -0
  678. package/dist/cjs/internal/logger.js +381 -0
  679. package/dist/cjs/internal/logger.js.map +1 -0
  680. package/dist/cjs/internal/mailbox.js +462 -0
  681. package/dist/cjs/internal/mailbox.js.map +1 -0
  682. package/dist/cjs/internal/managedRuntime/circular.js +10 -0
  683. package/dist/cjs/internal/managedRuntime/circular.js.map +1 -0
  684. package/dist/cjs/internal/managedRuntime.js +95 -0
  685. package/dist/cjs/internal/managedRuntime.js.map +1 -0
  686. package/dist/cjs/internal/matcher.js +320 -0
  687. package/dist/cjs/internal/matcher.js.map +1 -0
  688. package/dist/cjs/internal/metric/boundaries.js +53 -0
  689. package/dist/cjs/internal/metric/boundaries.js.map +1 -0
  690. package/dist/cjs/internal/metric/hook.js +388 -0
  691. package/dist/cjs/internal/metric/hook.js.map +1 -0
  692. package/dist/cjs/internal/metric/key.js +73 -0
  693. package/dist/cjs/internal/metric/key.js.map +1 -0
  694. package/dist/cjs/internal/metric/keyType.js +188 -0
  695. package/dist/cjs/internal/metric/keyType.js.map +1 -0
  696. package/dist/cjs/internal/metric/label.js +45 -0
  697. package/dist/cjs/internal/metric/label.js.map +1 -0
  698. package/dist/cjs/internal/metric/pair.js +40 -0
  699. package/dist/cjs/internal/metric/pair.js.map +1 -0
  700. package/dist/cjs/internal/metric/polling.js +80 -0
  701. package/dist/cjs/internal/metric/polling.js.map +1 -0
  702. package/dist/cjs/internal/metric/registry.js +113 -0
  703. package/dist/cjs/internal/metric/registry.js.map +1 -0
  704. package/dist/cjs/internal/metric/state.js +201 -0
  705. package/dist/cjs/internal/metric/state.js.map +1 -0
  706. package/dist/cjs/internal/metric.js +204 -0
  707. package/dist/cjs/internal/metric.js.map +1 -0
  708. package/dist/cjs/internal/opCodes/cause.js +19 -0
  709. package/dist/cjs/internal/opCodes/cause.js.map +1 -0
  710. package/dist/cjs/internal/opCodes/channel.js +35 -0
  711. package/dist/cjs/internal/opCodes/channel.js.map +1 -0
  712. package/dist/cjs/internal/opCodes/channelChildExecutorDecision.js +13 -0
  713. package/dist/cjs/internal/opCodes/channelChildExecutorDecision.js.map +1 -0
  714. package/dist/cjs/internal/opCodes/channelMergeDecision.js +11 -0
  715. package/dist/cjs/internal/opCodes/channelMergeDecision.js.map +1 -0
  716. package/dist/cjs/internal/opCodes/channelMergeState.js +13 -0
  717. package/dist/cjs/internal/opCodes/channelMergeState.js.map +1 -0
  718. package/dist/cjs/internal/opCodes/channelMergeStrategy.js +11 -0
  719. package/dist/cjs/internal/opCodes/channelMergeStrategy.js.map +1 -0
  720. package/dist/cjs/internal/opCodes/channelState.js +15 -0
  721. package/dist/cjs/internal/opCodes/channelState.js.map +1 -0
  722. package/dist/cjs/internal/opCodes/channelUpstreamPullRequest.js +11 -0
  723. package/dist/cjs/internal/opCodes/channelUpstreamPullRequest.js.map +1 -0
  724. package/dist/cjs/internal/opCodes/channelUpstreamPullStrategy.js +11 -0
  725. package/dist/cjs/internal/opCodes/channelUpstreamPullStrategy.js.map +1 -0
  726. package/dist/cjs/internal/opCodes/config.js +29 -0
  727. package/dist/cjs/internal/opCodes/config.js.map +1 -0
  728. package/dist/cjs/internal/opCodes/configError.js +19 -0
  729. package/dist/cjs/internal/opCodes/configError.js.map +1 -0
  730. package/dist/cjs/internal/opCodes/continuation.js +11 -0
  731. package/dist/cjs/internal/opCodes/continuation.js.map +1 -0
  732. package/dist/cjs/internal/opCodes/deferred.js +11 -0
  733. package/dist/cjs/internal/opCodes/deferred.js.map +1 -0
  734. package/dist/cjs/internal/opCodes/effect.js +37 -0
  735. package/dist/cjs/internal/opCodes/effect.js.map +1 -0
  736. package/dist/cjs/internal/opCodes/layer.js +27 -0
  737. package/dist/cjs/internal/opCodes/layer.js.map +1 -0
  738. package/dist/cjs/internal/opCodes/streamHaltStrategy.js +15 -0
  739. package/dist/cjs/internal/opCodes/streamHaltStrategy.js.map +1 -0
  740. package/dist/cjs/internal/option.js +82 -0
  741. package/dist/cjs/internal/option.js.map +1 -0
  742. package/dist/cjs/internal/pool.js +288 -0
  743. package/dist/cjs/internal/pool.js.map +1 -0
  744. package/dist/cjs/internal/pubsub.js +1287 -0
  745. package/dist/cjs/internal/pubsub.js.map +1 -0
  746. package/dist/cjs/internal/query.js +102 -0
  747. package/dist/cjs/internal/query.js.map +1 -0
  748. package/dist/cjs/internal/queue.js +518 -0
  749. package/dist/cjs/internal/queue.js.map +1 -0
  750. package/dist/cjs/internal/random.js +128 -0
  751. package/dist/cjs/internal/random.js.map +1 -0
  752. package/dist/cjs/internal/rateLimiter.js +52 -0
  753. package/dist/cjs/internal/rateLimiter.js.map +1 -0
  754. package/dist/cjs/internal/rcMap.js +182 -0
  755. package/dist/cjs/internal/rcMap.js.map +1 -0
  756. package/dist/cjs/internal/rcRef.js +139 -0
  757. package/dist/cjs/internal/rcRef.js.map +1 -0
  758. package/dist/cjs/internal/redBlackTree/iterator.js +199 -0
  759. package/dist/cjs/internal/redBlackTree/iterator.js.map +1 -0
  760. package/dist/cjs/internal/redBlackTree/node.js +60 -0
  761. package/dist/cjs/internal/redBlackTree/node.js.map +1 -0
  762. package/dist/cjs/internal/redBlackTree.js +1088 -0
  763. package/dist/cjs/internal/redBlackTree.js.map +1 -0
  764. package/dist/cjs/internal/redacted.js +67 -0
  765. package/dist/cjs/internal/redacted.js.map +1 -0
  766. package/dist/cjs/internal/ref.js +121 -0
  767. package/dist/cjs/internal/ref.js.map +1 -0
  768. package/dist/cjs/internal/reloadable.js +56 -0
  769. package/dist/cjs/internal/reloadable.js.map +1 -0
  770. package/dist/cjs/internal/request.js +104 -0
  771. package/dist/cjs/internal/request.js.map +1 -0
  772. package/dist/cjs/internal/resource.js +49 -0
  773. package/dist/cjs/internal/resource.js.map +1 -0
  774. package/dist/cjs/internal/ringBuffer.js +64 -0
  775. package/dist/cjs/internal/ringBuffer.js.map +1 -0
  776. package/dist/cjs/internal/runtime.js +321 -0
  777. package/dist/cjs/internal/runtime.js.map +1 -0
  778. package/dist/cjs/internal/runtimeFlags.js +126 -0
  779. package/dist/cjs/internal/runtimeFlags.js.map +1 -0
  780. package/dist/cjs/internal/runtimeFlagsPatch.js +52 -0
  781. package/dist/cjs/internal/runtimeFlagsPatch.js.map +1 -0
  782. package/dist/cjs/internal/schedule/decision.js +44 -0
  783. package/dist/cjs/internal/schedule/decision.js.map +1 -0
  784. package/dist/cjs/internal/schedule/interval.js +83 -0
  785. package/dist/cjs/internal/schedule/interval.js.map +1 -0
  786. package/dist/cjs/internal/schedule/intervals.js +134 -0
  787. package/dist/cjs/internal/schedule/intervals.js.map +1 -0
  788. package/dist/cjs/internal/schedule.js +900 -0
  789. package/dist/cjs/internal/schedule.js.map +1 -0
  790. package/dist/cjs/internal/schema/errors.js +113 -0
  791. package/dist/cjs/internal/schema/errors.js.map +1 -0
  792. package/dist/cjs/internal/schema/schemaId.js +49 -0
  793. package/dist/cjs/internal/schema/schemaId.js.map +1 -0
  794. package/dist/cjs/internal/schema/util.js +48 -0
  795. package/dist/cjs/internal/schema/util.js.map +1 -0
  796. package/dist/cjs/internal/scopedCache.js +398 -0
  797. package/dist/cjs/internal/scopedCache.js.map +1 -0
  798. package/dist/cjs/internal/scopedRef.js +53 -0
  799. package/dist/cjs/internal/scopedRef.js.map +1 -0
  800. package/dist/cjs/internal/secret.js +90 -0
  801. package/dist/cjs/internal/secret.js.map +1 -0
  802. package/dist/cjs/internal/singleShotGen.js +37 -0
  803. package/dist/cjs/internal/singleShotGen.js.map +1 -0
  804. package/dist/cjs/internal/sink.js +883 -0
  805. package/dist/cjs/internal/sink.js.map +1 -0
  806. package/dist/cjs/internal/stack.js +12 -0
  807. package/dist/cjs/internal/stack.js.map +1 -0
  808. package/dist/cjs/internal/stm/core.js +525 -0
  809. package/dist/cjs/internal/stm/core.js.map +1 -0
  810. package/dist/cjs/internal/stm/entry.js +57 -0
  811. package/dist/cjs/internal/stm/entry.js.map +1 -0
  812. package/dist/cjs/internal/stm/journal.js +104 -0
  813. package/dist/cjs/internal/stm/journal.js.map +1 -0
  814. package/dist/cjs/internal/stm/opCodes/stm.js +31 -0
  815. package/dist/cjs/internal/stm/opCodes/stm.js.map +1 -0
  816. package/dist/cjs/internal/stm/opCodes/stmState.js +13 -0
  817. package/dist/cjs/internal/stm/opCodes/stmState.js.map +1 -0
  818. package/dist/cjs/internal/stm/opCodes/strategy.js +13 -0
  819. package/dist/cjs/internal/stm/opCodes/strategy.js.map +1 -0
  820. package/dist/cjs/internal/stm/opCodes/tExit.js +17 -0
  821. package/dist/cjs/internal/stm/opCodes/tExit.js.map +1 -0
  822. package/dist/cjs/internal/stm/opCodes/tryCommit.js +11 -0
  823. package/dist/cjs/internal/stm/opCodes/tryCommit.js.map +1 -0
  824. package/dist/cjs/internal/stm/stm.js +514 -0
  825. package/dist/cjs/internal/stm/stm.js.map +1 -0
  826. package/dist/cjs/internal/stm/stmState.js +102 -0
  827. package/dist/cjs/internal/stm/stmState.js.map +1 -0
  828. package/dist/cjs/internal/stm/tArray.js +258 -0
  829. package/dist/cjs/internal/stm/tArray.js.map +1 -0
  830. package/dist/cjs/internal/stm/tDeferred.js +51 -0
  831. package/dist/cjs/internal/stm/tDeferred.js.map +1 -0
  832. package/dist/cjs/internal/stm/tExit.js +116 -0
  833. package/dist/cjs/internal/stm/tExit.js.map +1 -0
  834. package/dist/cjs/internal/stm/tMap.js +448 -0
  835. package/dist/cjs/internal/stm/tMap.js.map +1 -0
  836. package/dist/cjs/internal/stm/tPriorityQueue.js +164 -0
  837. package/dist/cjs/internal/stm/tPriorityQueue.js.map +1 -0
  838. package/dist/cjs/internal/stm/tPubSub.js +397 -0
  839. package/dist/cjs/internal/stm/tPubSub.js.map +1 -0
  840. package/dist/cjs/internal/stm/tQueue.js +284 -0
  841. package/dist/cjs/internal/stm/tQueue.js.map +1 -0
  842. package/dist/cjs/internal/stm/tRandom.js +92 -0
  843. package/dist/cjs/internal/stm/tRandom.js.map +1 -0
  844. package/dist/cjs/internal/stm/tReentrantLock.js +215 -0
  845. package/dist/cjs/internal/stm/tReentrantLock.js.map +1 -0
  846. package/dist/cjs/internal/stm/tRef.js +110 -0
  847. package/dist/cjs/internal/stm/tRef.js.map +1 -0
  848. package/dist/cjs/internal/stm/tSemaphore.js +72 -0
  849. package/dist/cjs/internal/stm/tSemaphore.js.map +1 -0
  850. package/dist/cjs/internal/stm/tSet.js +104 -0
  851. package/dist/cjs/internal/stm/tSet.js.map +1 -0
  852. package/dist/cjs/internal/stm/tSubscriptionRef.js +177 -0
  853. package/dist/cjs/internal/stm/tSubscriptionRef.js.map +1 -0
  854. package/dist/cjs/internal/stm/tryCommit.js +25 -0
  855. package/dist/cjs/internal/stm/tryCommit.js.map +1 -0
  856. package/dist/cjs/internal/stm/txnId.js +18 -0
  857. package/dist/cjs/internal/stm/txnId.js.map +1 -0
  858. package/dist/cjs/internal/stm/versioned.js +15 -0
  859. package/dist/cjs/internal/stm/versioned.js.map +1 -0
  860. package/dist/cjs/internal/stream/debounceState.js +29 -0
  861. package/dist/cjs/internal/stream/debounceState.js.map +1 -0
  862. package/dist/cjs/internal/stream/emit.js +129 -0
  863. package/dist/cjs/internal/stream/emit.js.map +1 -0
  864. package/dist/cjs/internal/stream/haltStrategy.js +75 -0
  865. package/dist/cjs/internal/stream/haltStrategy.js.map +1 -0
  866. package/dist/cjs/internal/stream/handoff.js +65 -0
  867. package/dist/cjs/internal/stream/handoff.js.map +1 -0
  868. package/dist/cjs/internal/stream/handoffSignal.js +31 -0
  869. package/dist/cjs/internal/stream/handoffSignal.js.map +1 -0
  870. package/dist/cjs/internal/stream/pull.js +34 -0
  871. package/dist/cjs/internal/stream/pull.js.map +1 -0
  872. package/dist/cjs/internal/stream/sinkEndReason.js +19 -0
  873. package/dist/cjs/internal/stream/sinkEndReason.js.map +1 -0
  874. package/dist/cjs/internal/stream/zipAllState.js +41 -0
  875. package/dist/cjs/internal/stream/zipAllState.js.map +1 -0
  876. package/dist/cjs/internal/stream/zipChunksState.js +29 -0
  877. package/dist/cjs/internal/stream/zipChunksState.js.map +1 -0
  878. package/dist/cjs/internal/stream.js +2979 -0
  879. package/dist/cjs/internal/stream.js.map +1 -0
  880. package/dist/cjs/internal/string-utils.js +90 -0
  881. package/dist/cjs/internal/string-utils.js.map +1 -0
  882. package/dist/cjs/internal/subscriptionRef.js +72 -0
  883. package/dist/cjs/internal/subscriptionRef.js.map +1 -0
  884. package/dist/cjs/internal/supervisor/patch.js +135 -0
  885. package/dist/cjs/internal/supervisor/patch.js.map +1 -0
  886. package/dist/cjs/internal/supervisor.js +222 -0
  887. package/dist/cjs/internal/supervisor.js.map +1 -0
  888. package/dist/cjs/internal/synchronizedRef.js +51 -0
  889. package/dist/cjs/internal/synchronizedRef.js.map +1 -0
  890. package/dist/cjs/internal/take.js +130 -0
  891. package/dist/cjs/internal/take.js.map +1 -0
  892. package/dist/cjs/internal/testing/sleep.js +14 -0
  893. package/dist/cjs/internal/testing/sleep.js.map +1 -0
  894. package/dist/cjs/internal/testing/suspendedWarningData.js +58 -0
  895. package/dist/cjs/internal/testing/suspendedWarningData.js.map +1 -0
  896. package/dist/cjs/internal/testing/warningData.js +59 -0
  897. package/dist/cjs/internal/testing/warningData.js.map +1 -0
  898. package/dist/cjs/internal/tracer.js +134 -0
  899. package/dist/cjs/internal/tracer.js.map +1 -0
  900. package/dist/cjs/internal/trie.js +564 -0
  901. package/dist/cjs/internal/trie.js.map +1 -0
  902. package/dist/cjs/internal/version.js +14 -0
  903. package/dist/cjs/internal/version.js.map +1 -0
  904. package/dist/dts/Arbitrary.d.ts +69 -0
  905. package/dist/dts/Arbitrary.d.ts.map +1 -0
  906. package/dist/dts/Array.d.ts +5922 -0
  907. package/dist/dts/Array.d.ts.map +1 -0
  908. package/dist/dts/BigDecimal.d.ts +1483 -0
  909. package/dist/dts/BigDecimal.d.ts.map +1 -0
  910. package/dist/dts/BigInt.d.ts +1033 -0
  911. package/dist/dts/BigInt.d.ts.map +1 -0
  912. package/dist/dts/Boolean.d.ts +523 -0
  913. package/dist/dts/Boolean.d.ts.map +1 -0
  914. package/dist/dts/Brand.d.ts +234 -0
  915. package/dist/dts/Brand.d.ts.map +1 -0
  916. package/dist/dts/Cache.d.ts +241 -0
  917. package/dist/dts/Cache.d.ts.map +1 -0
  918. package/dist/dts/Cause.d.ts +1928 -0
  919. package/dist/dts/Cause.d.ts.map +1 -0
  920. package/dist/dts/Channel.d.ts +1989 -0
  921. package/dist/dts/Channel.d.ts.map +1 -0
  922. package/dist/dts/ChildExecutorDecision.d.ts +135 -0
  923. package/dist/dts/ChildExecutorDecision.d.ts.map +1 -0
  924. package/dist/dts/Chunk.d.ts +1709 -0
  925. package/dist/dts/Chunk.d.ts.map +1 -0
  926. package/dist/dts/Clock.d.ts +97 -0
  927. package/dist/dts/Clock.d.ts.map +1 -0
  928. package/dist/dts/Config.d.ts +667 -0
  929. package/dist/dts/Config.d.ts.map +1 -0
  930. package/dist/dts/ConfigError.d.ts +238 -0
  931. package/dist/dts/ConfigError.d.ts.map +1 -0
  932. package/dist/dts/ConfigProvider.d.ts +372 -0
  933. package/dist/dts/ConfigProvider.d.ts.map +1 -0
  934. package/dist/dts/ConfigProviderPathPatch.d.ts +118 -0
  935. package/dist/dts/ConfigProviderPathPatch.d.ts.map +1 -0
  936. package/dist/dts/Console.d.ts +224 -0
  937. package/dist/dts/Console.d.ts.map +1 -0
  938. package/dist/dts/Context.d.ts +823 -0
  939. package/dist/dts/Context.d.ts.map +1 -0
  940. package/dist/dts/Cron.d.ts +226 -0
  941. package/dist/dts/Cron.d.ts.map +1 -0
  942. package/dist/dts/Data.d.ts +613 -0
  943. package/dist/dts/Data.d.ts.map +1 -0
  944. package/dist/dts/DateTime.d.ts +2417 -0
  945. package/dist/dts/DateTime.d.ts.map +1 -0
  946. package/dist/dts/DefaultServices.d.ts +26 -0
  947. package/dist/dts/DefaultServices.d.ts.map +1 -0
  948. package/dist/dts/Deferred.d.ts +437 -0
  949. package/dist/dts/Deferred.d.ts.map +1 -0
  950. package/dist/dts/Differ.d.ts +420 -0
  951. package/dist/dts/Differ.d.ts.map +1 -0
  952. package/dist/dts/Duration.d.ts +557 -0
  953. package/dist/dts/Duration.d.ts.map +1 -0
  954. package/dist/dts/Effect.d.ts +26986 -0
  955. package/dist/dts/Effect.d.ts.map +1 -0
  956. package/dist/dts/Effectable.d.ts +93 -0
  957. package/dist/dts/Effectable.d.ts.map +1 -0
  958. package/dist/dts/Either.d.ts +1431 -0
  959. package/dist/dts/Either.d.ts.map +1 -0
  960. package/dist/dts/Encoding.d.ts +160 -0
  961. package/dist/dts/Encoding.d.ts.map +1 -0
  962. package/dist/dts/Equal.d.ts +34 -0
  963. package/dist/dts/Equal.d.ts.map +1 -0
  964. package/dist/dts/Equivalence.d.ts +158 -0
  965. package/dist/dts/Equivalence.d.ts.map +1 -0
  966. package/dist/dts/ExecutionPlan.d.ts +210 -0
  967. package/dist/dts/ExecutionPlan.d.ts.map +1 -0
  968. package/dist/dts/ExecutionStrategy.d.ts +122 -0
  969. package/dist/dts/ExecutionStrategy.d.ts.map +1 -0
  970. package/dist/dts/Exit.d.ts +663 -0
  971. package/dist/dts/Exit.d.ts.map +1 -0
  972. package/dist/dts/FastCheck.d.ts +9 -0
  973. package/dist/dts/FastCheck.d.ts.map +1 -0
  974. package/dist/dts/Fiber.d.ts +831 -0
  975. package/dist/dts/Fiber.d.ts.map +1 -0
  976. package/dist/dts/FiberHandle.d.ts +270 -0
  977. package/dist/dts/FiberHandle.d.ts.map +1 -0
  978. package/dist/dts/FiberId.d.ts +196 -0
  979. package/dist/dts/FiberId.d.ts.map +1 -0
  980. package/dist/dts/FiberMap.d.ts +368 -0
  981. package/dist/dts/FiberMap.d.ts.map +1 -0
  982. package/dist/dts/FiberRef.d.ts +422 -0
  983. package/dist/dts/FiberRef.d.ts.map +1 -0
  984. package/dist/dts/FiberRefs.d.ts +256 -0
  985. package/dist/dts/FiberRefs.d.ts.map +1 -0
  986. package/dist/dts/FiberRefsPatch.d.ts +125 -0
  987. package/dist/dts/FiberRefsPatch.d.ts.map +1 -0
  988. package/dist/dts/FiberSet.d.ts +236 -0
  989. package/dist/dts/FiberSet.d.ts.map +1 -0
  990. package/dist/dts/FiberStatus.d.ts +94 -0
  991. package/dist/dts/FiberStatus.d.ts.map +1 -0
  992. package/dist/dts/Function.d.ts +660 -0
  993. package/dist/dts/Function.d.ts.map +1 -0
  994. package/dist/dts/GlobalValue.d.ts +25 -0
  995. package/dist/dts/GlobalValue.d.ts.map +1 -0
  996. package/dist/dts/Graph.d.ts +1753 -0
  997. package/dist/dts/Graph.d.ts.map +1 -0
  998. package/dist/dts/GroupBy.d.ts +125 -0
  999. package/dist/dts/GroupBy.d.ts.map +1 -0
  1000. package/dist/dts/HKT.d.ts +41 -0
  1001. package/dist/dts/HKT.d.ts.map +1 -0
  1002. package/dist/dts/Hash.d.ts +79 -0
  1003. package/dist/dts/Hash.d.ts.map +1 -0
  1004. package/dist/dts/HashMap.d.ts +863 -0
  1005. package/dist/dts/HashMap.d.ts.map +1 -0
  1006. package/dist/dts/HashRing.d.ts +158 -0
  1007. package/dist/dts/HashRing.d.ts.map +1 -0
  1008. package/dist/dts/HashSet.d.ts +2271 -0
  1009. package/dist/dts/HashSet.d.ts.map +1 -0
  1010. package/dist/dts/Inspectable.d.ts +88 -0
  1011. package/dist/dts/Inspectable.d.ts.map +1 -0
  1012. package/dist/dts/Iterable.d.ts +1047 -0
  1013. package/dist/dts/Iterable.d.ts.map +1 -0
  1014. package/dist/dts/JSONSchema.d.ts +268 -0
  1015. package/dist/dts/JSONSchema.d.ts.map +1 -0
  1016. package/dist/dts/KeyedPool.d.ts +182 -0
  1017. package/dist/dts/KeyedPool.d.ts.map +1 -0
  1018. package/dist/dts/Layer.d.ts +1374 -0
  1019. package/dist/dts/Layer.d.ts.map +1 -0
  1020. package/dist/dts/LayerMap.d.ts +265 -0
  1021. package/dist/dts/LayerMap.d.ts.map +1 -0
  1022. package/dist/dts/List.d.ts +937 -0
  1023. package/dist/dts/List.d.ts.map +1 -0
  1024. package/dist/dts/LogLevel.d.ts +333 -0
  1025. package/dist/dts/LogLevel.d.ts.map +1 -0
  1026. package/dist/dts/LogSpan.d.ts +19 -0
  1027. package/dist/dts/LogSpan.d.ts.map +1 -0
  1028. package/dist/dts/Logger.d.ts +795 -0
  1029. package/dist/dts/Logger.d.ts.map +1 -0
  1030. package/dist/dts/Mailbox.d.ts +274 -0
  1031. package/dist/dts/Mailbox.d.ts.map +1 -0
  1032. package/dist/dts/ManagedRuntime.d.ts +154 -0
  1033. package/dist/dts/ManagedRuntime.d.ts.map +1 -0
  1034. package/dist/dts/Match.d.ts +1140 -0
  1035. package/dist/dts/Match.d.ts.map +1 -0
  1036. package/dist/dts/MergeDecision.d.ts +86 -0
  1037. package/dist/dts/MergeDecision.d.ts.map +1 -0
  1038. package/dist/dts/MergeState.d.ts +130 -0
  1039. package/dist/dts/MergeState.d.ts.map +1 -0
  1040. package/dist/dts/MergeStrategy.d.ts +104 -0
  1041. package/dist/dts/MergeStrategy.d.ts.map +1 -0
  1042. package/dist/dts/Metric.d.ts +1042 -0
  1043. package/dist/dts/Metric.d.ts.map +1 -0
  1044. package/dist/dts/MetricBoundaries.d.ts +58 -0
  1045. package/dist/dts/MetricBoundaries.d.ts.map +1 -0
  1046. package/dist/dts/MetricHook.d.ts +155 -0
  1047. package/dist/dts/MetricHook.d.ts.map +1 -0
  1048. package/dist/dts/MetricKey.d.ts +222 -0
  1049. package/dist/dts/MetricKey.d.ts.map +1 -0
  1050. package/dist/dts/MetricKeyType.d.ts +224 -0
  1051. package/dist/dts/MetricKeyType.d.ts.map +1 -0
  1052. package/dist/dts/MetricLabel.d.ts +42 -0
  1053. package/dist/dts/MetricLabel.d.ts.map +1 -0
  1054. package/dist/dts/MetricPair.d.ts +54 -0
  1055. package/dist/dts/MetricPair.d.ts.map +1 -0
  1056. package/dist/dts/MetricPolling.d.ts +151 -0
  1057. package/dist/dts/MetricPolling.d.ts.map +1 -0
  1058. package/dist/dts/MetricRegistry.d.ts +34 -0
  1059. package/dist/dts/MetricRegistry.d.ts.map +1 -0
  1060. package/dist/dts/MetricState.d.ts +238 -0
  1061. package/dist/dts/MetricState.d.ts.map +1 -0
  1062. package/dist/dts/Micro.d.ts +3440 -0
  1063. package/dist/dts/Micro.d.ts.map +1 -0
  1064. package/dist/dts/ModuleVersion.d.ts +11 -0
  1065. package/dist/dts/ModuleVersion.d.ts.map +1 -0
  1066. package/dist/dts/MutableHashMap.d.ts +170 -0
  1067. package/dist/dts/MutableHashMap.d.ts.map +1 -0
  1068. package/dist/dts/MutableHashSet.d.ts +547 -0
  1069. package/dist/dts/MutableHashSet.d.ts.map +1 -0
  1070. package/dist/dts/MutableList.d.ts +150 -0
  1071. package/dist/dts/MutableList.d.ts.map +1 -0
  1072. package/dist/dts/MutableQueue.d.ts +189 -0
  1073. package/dist/dts/MutableQueue.d.ts.map +1 -0
  1074. package/dist/dts/MutableRef.d.ts +175 -0
  1075. package/dist/dts/MutableRef.d.ts.map +1 -0
  1076. package/dist/dts/NonEmptyIterable.d.ts +21 -0
  1077. package/dist/dts/NonEmptyIterable.d.ts.map +1 -0
  1078. package/dist/dts/Number.d.ts +1361 -0
  1079. package/dist/dts/Number.d.ts.map +1 -0
  1080. package/dist/dts/Option.d.ts +3757 -0
  1081. package/dist/dts/Option.d.ts.map +1 -0
  1082. package/dist/dts/Order.d.ts +260 -0
  1083. package/dist/dts/Order.d.ts.map +1 -0
  1084. package/dist/dts/Ordering.d.ts +144 -0
  1085. package/dist/dts/Ordering.d.ts.map +1 -0
  1086. package/dist/dts/ParseResult.d.ts +560 -0
  1087. package/dist/dts/ParseResult.d.ts.map +1 -0
  1088. package/dist/dts/PartitionedSemaphore.d.ts +76 -0
  1089. package/dist/dts/PartitionedSemaphore.d.ts.map +1 -0
  1090. package/dist/dts/Pipeable.d.ts +65 -0
  1091. package/dist/dts/Pipeable.d.ts.map +1 -0
  1092. package/dist/dts/Pool.d.ts +201 -0
  1093. package/dist/dts/Pool.d.ts.map +1 -0
  1094. package/dist/dts/Predicate.d.ts +2197 -0
  1095. package/dist/dts/Predicate.d.ts.map +1 -0
  1096. package/dist/dts/Pretty.d.ts +26 -0
  1097. package/dist/dts/Pretty.d.ts.map +1 -0
  1098. package/dist/dts/PrimaryKey.d.ts +21 -0
  1099. package/dist/dts/PrimaryKey.d.ts.map +1 -0
  1100. package/dist/dts/PubSub.d.ts +197 -0
  1101. package/dist/dts/PubSub.d.ts.map +1 -0
  1102. package/dist/dts/Queue.d.ts +664 -0
  1103. package/dist/dts/Queue.d.ts.map +1 -0
  1104. package/dist/dts/Random.d.ts +183 -0
  1105. package/dist/dts/Random.d.ts.map +1 -0
  1106. package/dist/dts/RateLimiter.d.ts +134 -0
  1107. package/dist/dts/RateLimiter.d.ts.map +1 -0
  1108. package/dist/dts/RcMap.d.ts +231 -0
  1109. package/dist/dts/RcMap.d.ts.map +1 -0
  1110. package/dist/dts/RcRef.d.ts +111 -0
  1111. package/dist/dts/RcRef.d.ts.map +1 -0
  1112. package/dist/dts/Readable.d.ts +72 -0
  1113. package/dist/dts/Readable.d.ts.map +1 -0
  1114. package/dist/dts/Record.d.ts +1547 -0
  1115. package/dist/dts/Record.d.ts.map +1 -0
  1116. package/dist/dts/RedBlackTree.d.ts +676 -0
  1117. package/dist/dts/RedBlackTree.d.ts.map +1 -0
  1118. package/dist/dts/Redacted.d.ts +133 -0
  1119. package/dist/dts/Redacted.d.ts.map +1 -0
  1120. package/dist/dts/Ref.d.ts +250 -0
  1121. package/dist/dts/Ref.d.ts.map +1 -0
  1122. package/dist/dts/RegExp.d.ts +31 -0
  1123. package/dist/dts/RegExp.d.ts.map +1 -0
  1124. package/dist/dts/Reloadable.d.ts +102 -0
  1125. package/dist/dts/Reloadable.d.ts.map +1 -0
  1126. package/dist/dts/Request.d.ts +383 -0
  1127. package/dist/dts/Request.d.ts.map +1 -0
  1128. package/dist/dts/RequestBlock.d.ts +94 -0
  1129. package/dist/dts/RequestBlock.d.ts.map +1 -0
  1130. package/dist/dts/RequestResolver.d.ts +413 -0
  1131. package/dist/dts/RequestResolver.d.ts.map +1 -0
  1132. package/dist/dts/Resource.d.ts +99 -0
  1133. package/dist/dts/Resource.d.ts.map +1 -0
  1134. package/dist/dts/Runtime.d.ts +578 -0
  1135. package/dist/dts/Runtime.d.ts.map +1 -0
  1136. package/dist/dts/RuntimeFlags.d.ts +397 -0
  1137. package/dist/dts/RuntimeFlags.d.ts.map +1 -0
  1138. package/dist/dts/RuntimeFlagsPatch.d.ts +273 -0
  1139. package/dist/dts/RuntimeFlagsPatch.d.ts.map +1 -0
  1140. package/dist/dts/STM.d.ts +2645 -0
  1141. package/dist/dts/STM.d.ts.map +1 -0
  1142. package/dist/dts/Schedule.d.ts +3509 -0
  1143. package/dist/dts/Schedule.d.ts.map +1 -0
  1144. package/dist/dts/ScheduleDecision.d.ts +50 -0
  1145. package/dist/dts/ScheduleDecision.d.ts.map +1 -0
  1146. package/dist/dts/ScheduleInterval.d.ts +204 -0
  1147. package/dist/dts/ScheduleInterval.d.ts.map +1 -0
  1148. package/dist/dts/ScheduleIntervals.d.ts +159 -0
  1149. package/dist/dts/ScheduleIntervals.d.ts.map +1 -0
  1150. package/dist/dts/Scheduler.d.ts +161 -0
  1151. package/dist/dts/Scheduler.d.ts.map +1 -0
  1152. package/dist/dts/Schema.d.ts +5094 -0
  1153. package/dist/dts/Schema.d.ts.map +1 -0
  1154. package/dist/dts/SchemaAST.d.ts +1360 -0
  1155. package/dist/dts/SchemaAST.d.ts.map +1 -0
  1156. package/dist/dts/Scope.d.ts +194 -0
  1157. package/dist/dts/Scope.d.ts.map +1 -0
  1158. package/dist/dts/ScopedCache.d.ts +127 -0
  1159. package/dist/dts/ScopedCache.d.ts.map +1 -0
  1160. package/dist/dts/ScopedRef.d.ts +125 -0
  1161. package/dist/dts/ScopedRef.d.ts.map +1 -0
  1162. package/dist/dts/Secret.d.ts +76 -0
  1163. package/dist/dts/Secret.d.ts.map +1 -0
  1164. package/dist/dts/SingleProducerAsyncInput.d.ts +57 -0
  1165. package/dist/dts/SingleProducerAsyncInput.d.ts.map +1 -0
  1166. package/dist/dts/Sink.d.ts +1616 -0
  1167. package/dist/dts/Sink.d.ts.map +1 -0
  1168. package/dist/dts/SortedMap.d.ts +234 -0
  1169. package/dist/dts/SortedMap.d.ts.map +1 -0
  1170. package/dist/dts/SortedSet.d.ts +333 -0
  1171. package/dist/dts/SortedSet.d.ts.map +1 -0
  1172. package/dist/dts/Stream.d.ts +10803 -0
  1173. package/dist/dts/Stream.d.ts.map +1 -0
  1174. package/dist/dts/StreamEmit.d.ts +117 -0
  1175. package/dist/dts/StreamEmit.d.ts.map +1 -0
  1176. package/dist/dts/StreamHaltStrategy.d.ts +116 -0
  1177. package/dist/dts/StreamHaltStrategy.d.ts.map +1 -0
  1178. package/dist/dts/Streamable.d.ts +27 -0
  1179. package/dist/dts/Streamable.d.ts.map +1 -0
  1180. package/dist/dts/String.d.ts +848 -0
  1181. package/dist/dts/String.d.ts.map +1 -0
  1182. package/dist/dts/Struct.d.ts +295 -0
  1183. package/dist/dts/Struct.d.ts.map +1 -0
  1184. package/dist/dts/Subscribable.d.ts +76 -0
  1185. package/dist/dts/Subscribable.d.ts.map +1 -0
  1186. package/dist/dts/SubscriptionRef.d.ts +384 -0
  1187. package/dist/dts/SubscriptionRef.d.ts.map +1 -0
  1188. package/dist/dts/Supervisor.d.ts +171 -0
  1189. package/dist/dts/Supervisor.d.ts.map +1 -0
  1190. package/dist/dts/Symbol.d.ts +26 -0
  1191. package/dist/dts/Symbol.d.ts.map +1 -0
  1192. package/dist/dts/SynchronizedRef.d.ts +378 -0
  1193. package/dist/dts/SynchronizedRef.d.ts.map +1 -0
  1194. package/dist/dts/TArray.d.ts +857 -0
  1195. package/dist/dts/TArray.d.ts.map +1 -0
  1196. package/dist/dts/TDeferred.d.ts +104 -0
  1197. package/dist/dts/TDeferred.d.ts.map +1 -0
  1198. package/dist/dts/TMap.d.ts +780 -0
  1199. package/dist/dts/TMap.d.ts.map +1 -0
  1200. package/dist/dts/TPriorityQueue.d.ts +250 -0
  1201. package/dist/dts/TPriorityQueue.d.ts.map +1 -0
  1202. package/dist/dts/TPubSub.d.ts +186 -0
  1203. package/dist/dts/TPubSub.d.ts.map +1 -0
  1204. package/dist/dts/TQueue.d.ts +492 -0
  1205. package/dist/dts/TQueue.d.ts.map +1 -0
  1206. package/dist/dts/TRandom.d.ts +108 -0
  1207. package/dist/dts/TRandom.d.ts.map +1 -0
  1208. package/dist/dts/TReentrantLock.d.ts +230 -0
  1209. package/dist/dts/TReentrantLock.d.ts.map +1 -0
  1210. package/dist/dts/TRef.d.ts +235 -0
  1211. package/dist/dts/TRef.d.ts.map +1 -0
  1212. package/dist/dts/TSemaphore.d.ts +145 -0
  1213. package/dist/dts/TSemaphore.d.ts.map +1 -0
  1214. package/dist/dts/TSet.d.ts +564 -0
  1215. package/dist/dts/TSet.d.ts.map +1 -0
  1216. package/dist/dts/TSubscriptionRef.d.ts +251 -0
  1217. package/dist/dts/TSubscriptionRef.d.ts.map +1 -0
  1218. package/dist/dts/Take.d.ts +271 -0
  1219. package/dist/dts/Take.d.ts.map +1 -0
  1220. package/dist/dts/TestAnnotation.d.ts +71 -0
  1221. package/dist/dts/TestAnnotation.d.ts.map +1 -0
  1222. package/dist/dts/TestAnnotationMap.d.ts +56 -0
  1223. package/dist/dts/TestAnnotationMap.d.ts.map +1 -0
  1224. package/dist/dts/TestAnnotations.d.ts +59 -0
  1225. package/dist/dts/TestAnnotations.d.ts.map +1 -0
  1226. package/dist/dts/TestClock.d.ts +147 -0
  1227. package/dist/dts/TestClock.d.ts.map +1 -0
  1228. package/dist/dts/TestConfig.d.ts +45 -0
  1229. package/dist/dts/TestConfig.d.ts.map +1 -0
  1230. package/dist/dts/TestContext.d.ts +15 -0
  1231. package/dist/dts/TestContext.d.ts.map +1 -0
  1232. package/dist/dts/TestLive.d.ts +35 -0
  1233. package/dist/dts/TestLive.d.ts.map +1 -0
  1234. package/dist/dts/TestServices.d.ts +231 -0
  1235. package/dist/dts/TestServices.d.ts.map +1 -0
  1236. package/dist/dts/TestSized.d.ts +36 -0
  1237. package/dist/dts/TestSized.d.ts.map +1 -0
  1238. package/dist/dts/Tracer.d.ts +152 -0
  1239. package/dist/dts/Tracer.d.ts.map +1 -0
  1240. package/dist/dts/Trie.d.ts +1828 -0
  1241. package/dist/dts/Trie.d.ts.map +1 -0
  1242. package/dist/dts/Tuple.d.ts +446 -0
  1243. package/dist/dts/Tuple.d.ts.map +1 -0
  1244. package/dist/dts/Types.d.ts +330 -0
  1245. package/dist/dts/Types.d.ts.map +1 -0
  1246. package/dist/dts/Unify.d.ts +75 -0
  1247. package/dist/dts/Unify.d.ts.map +1 -0
  1248. package/dist/dts/UpstreamPullRequest.d.ts +109 -0
  1249. package/dist/dts/UpstreamPullRequest.d.ts.map +1 -0
  1250. package/dist/dts/UpstreamPullStrategy.d.ts +110 -0
  1251. package/dist/dts/UpstreamPullStrategy.d.ts.map +1 -0
  1252. package/dist/dts/Utils.d.ts +283 -0
  1253. package/dist/dts/Utils.d.ts.map +1 -0
  1254. package/dist/dts/index.d.ts +1385 -0
  1255. package/dist/dts/index.d.ts.map +1 -0
  1256. package/dist/dts/internal/array.d.ts +5 -0
  1257. package/dist/dts/internal/array.d.ts.map +1 -0
  1258. package/dist/dts/internal/blockedRequests.d.ts +2 -0
  1259. package/dist/dts/internal/blockedRequests.d.ts.map +1 -0
  1260. package/dist/dts/internal/cache.d.ts +2 -0
  1261. package/dist/dts/internal/cache.d.ts.map +1 -0
  1262. package/dist/dts/internal/cause.d.ts +2 -0
  1263. package/dist/dts/internal/cause.d.ts.map +1 -0
  1264. package/dist/dts/internal/channel/channelExecutor.d.ts +3 -0
  1265. package/dist/dts/internal/channel/channelExecutor.d.ts.map +1 -0
  1266. package/dist/dts/internal/channel/channelState.d.ts +2 -0
  1267. package/dist/dts/internal/channel/channelState.d.ts.map +1 -0
  1268. package/dist/dts/internal/channel/childExecutorDecision.d.ts +2 -0
  1269. package/dist/dts/internal/channel/childExecutorDecision.d.ts.map +1 -0
  1270. package/dist/dts/internal/channel/continuation.d.ts +2 -0
  1271. package/dist/dts/internal/channel/continuation.d.ts.map +1 -0
  1272. package/dist/dts/internal/channel/mergeDecision.d.ts +2 -0
  1273. package/dist/dts/internal/channel/mergeDecision.d.ts.map +1 -0
  1274. package/dist/dts/internal/channel/mergeState.d.ts +2 -0
  1275. package/dist/dts/internal/channel/mergeState.d.ts.map +1 -0
  1276. package/dist/dts/internal/channel/mergeStrategy.d.ts +2 -0
  1277. package/dist/dts/internal/channel/mergeStrategy.d.ts.map +1 -0
  1278. package/dist/dts/internal/channel/singleProducerAsyncInput.d.ts +2 -0
  1279. package/dist/dts/internal/channel/singleProducerAsyncInput.d.ts.map +1 -0
  1280. package/dist/dts/internal/channel/subexecutor.d.ts +2 -0
  1281. package/dist/dts/internal/channel/subexecutor.d.ts.map +1 -0
  1282. package/dist/dts/internal/channel/upstreamPullRequest.d.ts +2 -0
  1283. package/dist/dts/internal/channel/upstreamPullRequest.d.ts.map +1 -0
  1284. package/dist/dts/internal/channel/upstreamPullStrategy.d.ts +2 -0
  1285. package/dist/dts/internal/channel/upstreamPullStrategy.d.ts.map +1 -0
  1286. package/dist/dts/internal/channel.d.ts +2 -0
  1287. package/dist/dts/internal/channel.d.ts.map +1 -0
  1288. package/dist/dts/internal/clock.d.ts +2 -0
  1289. package/dist/dts/internal/clock.d.ts.map +1 -0
  1290. package/dist/dts/internal/completedRequestMap.d.ts +2 -0
  1291. package/dist/dts/internal/completedRequestMap.d.ts.map +1 -0
  1292. package/dist/dts/internal/concurrency.d.ts +2 -0
  1293. package/dist/dts/internal/concurrency.d.ts.map +1 -0
  1294. package/dist/dts/internal/config.d.ts +2 -0
  1295. package/dist/dts/internal/config.d.ts.map +1 -0
  1296. package/dist/dts/internal/configError.d.ts +2 -0
  1297. package/dist/dts/internal/configError.d.ts.map +1 -0
  1298. package/dist/dts/internal/configProvider/pathPatch.d.ts +2 -0
  1299. package/dist/dts/internal/configProvider/pathPatch.d.ts.map +1 -0
  1300. package/dist/dts/internal/configProvider.d.ts +2 -0
  1301. package/dist/dts/internal/configProvider.d.ts.map +1 -0
  1302. package/dist/dts/internal/console.d.ts +2 -0
  1303. package/dist/dts/internal/console.d.ts.map +1 -0
  1304. package/dist/dts/internal/context.d.ts +2 -0
  1305. package/dist/dts/internal/context.d.ts.map +1 -0
  1306. package/dist/dts/internal/core-effect.d.ts +8 -0
  1307. package/dist/dts/internal/core-effect.d.ts.map +1 -0
  1308. package/dist/dts/internal/core-stream.d.ts +9 -0
  1309. package/dist/dts/internal/core-stream.d.ts.map +1 -0
  1310. package/dist/dts/internal/core.d.ts +9 -0
  1311. package/dist/dts/internal/core.d.ts.map +1 -0
  1312. package/dist/dts/internal/data.d.ts +2 -0
  1313. package/dist/dts/internal/data.d.ts.map +1 -0
  1314. package/dist/dts/internal/dataSource.d.ts +2 -0
  1315. package/dist/dts/internal/dataSource.d.ts.map +1 -0
  1316. package/dist/dts/internal/dateTime.d.ts +2 -0
  1317. package/dist/dts/internal/dateTime.d.ts.map +1 -0
  1318. package/dist/dts/internal/defaultServices/console.d.ts +2 -0
  1319. package/dist/dts/internal/defaultServices/console.d.ts.map +1 -0
  1320. package/dist/dts/internal/defaultServices.d.ts +10 -0
  1321. package/dist/dts/internal/defaultServices.d.ts.map +1 -0
  1322. package/dist/dts/internal/deferred.d.ts +2 -0
  1323. package/dist/dts/internal/deferred.d.ts.map +1 -0
  1324. package/dist/dts/internal/differ/chunkPatch.d.ts +2 -0
  1325. package/dist/dts/internal/differ/chunkPatch.d.ts.map +1 -0
  1326. package/dist/dts/internal/differ/contextPatch.d.ts +2 -0
  1327. package/dist/dts/internal/differ/contextPatch.d.ts.map +1 -0
  1328. package/dist/dts/internal/differ/hashMapPatch.d.ts +2 -0
  1329. package/dist/dts/internal/differ/hashMapPatch.d.ts.map +1 -0
  1330. package/dist/dts/internal/differ/hashSetPatch.d.ts +2 -0
  1331. package/dist/dts/internal/differ/hashSetPatch.d.ts.map +1 -0
  1332. package/dist/dts/internal/differ/orPatch.d.ts +2 -0
  1333. package/dist/dts/internal/differ/orPatch.d.ts.map +1 -0
  1334. package/dist/dts/internal/differ/readonlyArrayPatch.d.ts +2 -0
  1335. package/dist/dts/internal/differ/readonlyArrayPatch.d.ts.map +1 -0
  1336. package/dist/dts/internal/differ.d.ts +2 -0
  1337. package/dist/dts/internal/differ.d.ts.map +1 -0
  1338. package/dist/dts/internal/doNotation.d.ts +2 -0
  1339. package/dist/dts/internal/doNotation.d.ts.map +1 -0
  1340. package/dist/dts/internal/effect/circular.d.ts +2 -0
  1341. package/dist/dts/internal/effect/circular.d.ts.map +1 -0
  1342. package/dist/dts/internal/effectable.d.ts +2 -0
  1343. package/dist/dts/internal/effectable.d.ts.map +1 -0
  1344. package/dist/dts/internal/either.d.ts +5 -0
  1345. package/dist/dts/internal/either.d.ts.map +1 -0
  1346. package/dist/dts/internal/encoding/base64.d.ts +2 -0
  1347. package/dist/dts/internal/encoding/base64.d.ts.map +1 -0
  1348. package/dist/dts/internal/encoding/base64Url.d.ts +2 -0
  1349. package/dist/dts/internal/encoding/base64Url.d.ts.map +1 -0
  1350. package/dist/dts/internal/encoding/common.d.ts +5 -0
  1351. package/dist/dts/internal/encoding/common.d.ts.map +1 -0
  1352. package/dist/dts/internal/encoding/hex.d.ts +2 -0
  1353. package/dist/dts/internal/encoding/hex.d.ts.map +1 -0
  1354. package/dist/dts/internal/errors.d.ts +5 -0
  1355. package/dist/dts/internal/errors.d.ts.map +1 -0
  1356. package/dist/dts/internal/executionPlan.d.ts +2 -0
  1357. package/dist/dts/internal/executionPlan.d.ts.map +1 -0
  1358. package/dist/dts/internal/executionStrategy.d.ts +2 -0
  1359. package/dist/dts/internal/executionStrategy.d.ts.map +1 -0
  1360. package/dist/dts/internal/fiber.d.ts +6 -0
  1361. package/dist/dts/internal/fiber.d.ts.map +1 -0
  1362. package/dist/dts/internal/fiberId.d.ts +2 -0
  1363. package/dist/dts/internal/fiberId.d.ts.map +1 -0
  1364. package/dist/dts/internal/fiberMessage.d.ts +2 -0
  1365. package/dist/dts/internal/fiberMessage.d.ts.map +1 -0
  1366. package/dist/dts/internal/fiberRefs/patch.d.ts +2 -0
  1367. package/dist/dts/internal/fiberRefs/patch.d.ts.map +1 -0
  1368. package/dist/dts/internal/fiberRefs.d.ts +2 -0
  1369. package/dist/dts/internal/fiberRefs.d.ts.map +1 -0
  1370. package/dist/dts/internal/fiberRuntime.d.ts +7 -0
  1371. package/dist/dts/internal/fiberRuntime.d.ts.map +1 -0
  1372. package/dist/dts/internal/fiberScope.d.ts +18 -0
  1373. package/dist/dts/internal/fiberScope.d.ts.map +1 -0
  1374. package/dist/dts/internal/fiberStatus.d.ts +2 -0
  1375. package/dist/dts/internal/fiberStatus.d.ts.map +1 -0
  1376. package/dist/dts/internal/groupBy.d.ts +2 -0
  1377. package/dist/dts/internal/groupBy.d.ts.map +1 -0
  1378. package/dist/dts/internal/hashMap/array.d.ts +2 -0
  1379. package/dist/dts/internal/hashMap/array.d.ts.map +1 -0
  1380. package/dist/dts/internal/hashMap/bitwise.d.ts +2 -0
  1381. package/dist/dts/internal/hashMap/bitwise.d.ts.map +1 -0
  1382. package/dist/dts/internal/hashMap/config.d.ts +2 -0
  1383. package/dist/dts/internal/hashMap/config.d.ts.map +1 -0
  1384. package/dist/dts/internal/hashMap/keySet.d.ts +2 -0
  1385. package/dist/dts/internal/hashMap/keySet.d.ts.map +1 -0
  1386. package/dist/dts/internal/hashMap/node.d.ts +2 -0
  1387. package/dist/dts/internal/hashMap/node.d.ts.map +1 -0
  1388. package/dist/dts/internal/hashMap.d.ts +9 -0
  1389. package/dist/dts/internal/hashMap.d.ts.map +1 -0
  1390. package/dist/dts/internal/hashSet.d.ts +2 -0
  1391. package/dist/dts/internal/hashSet.d.ts.map +1 -0
  1392. package/dist/dts/internal/keyedPool.d.ts +2 -0
  1393. package/dist/dts/internal/keyedPool.d.ts.map +1 -0
  1394. package/dist/dts/internal/layer/circular.d.ts +2 -0
  1395. package/dist/dts/internal/layer/circular.d.ts.map +1 -0
  1396. package/dist/dts/internal/layer.d.ts +16 -0
  1397. package/dist/dts/internal/layer.d.ts.map +1 -0
  1398. package/dist/dts/internal/logSpan.d.ts +2 -0
  1399. package/dist/dts/internal/logSpan.d.ts.map +1 -0
  1400. package/dist/dts/internal/logger-circular.d.ts +2 -0
  1401. package/dist/dts/internal/logger-circular.d.ts.map +1 -0
  1402. package/dist/dts/internal/logger.d.ts +2 -0
  1403. package/dist/dts/internal/logger.d.ts.map +1 -0
  1404. package/dist/dts/internal/mailbox.d.ts +2 -0
  1405. package/dist/dts/internal/mailbox.d.ts.map +1 -0
  1406. package/dist/dts/internal/managedRuntime/circular.d.ts +2 -0
  1407. package/dist/dts/internal/managedRuntime/circular.d.ts.map +1 -0
  1408. package/dist/dts/internal/managedRuntime.d.ts +2 -0
  1409. package/dist/dts/internal/managedRuntime.d.ts.map +1 -0
  1410. package/dist/dts/internal/matcher.d.ts +2 -0
  1411. package/dist/dts/internal/matcher.d.ts.map +1 -0
  1412. package/dist/dts/internal/metric/boundaries.d.ts +2 -0
  1413. package/dist/dts/internal/metric/boundaries.d.ts.map +1 -0
  1414. package/dist/dts/internal/metric/hook.d.ts +2 -0
  1415. package/dist/dts/internal/metric/hook.d.ts.map +1 -0
  1416. package/dist/dts/internal/metric/key.d.ts +2 -0
  1417. package/dist/dts/internal/metric/key.d.ts.map +1 -0
  1418. package/dist/dts/internal/metric/keyType.d.ts +2 -0
  1419. package/dist/dts/internal/metric/keyType.d.ts.map +1 -0
  1420. package/dist/dts/internal/metric/label.d.ts +2 -0
  1421. package/dist/dts/internal/metric/label.d.ts.map +1 -0
  1422. package/dist/dts/internal/metric/pair.d.ts +2 -0
  1423. package/dist/dts/internal/metric/pair.d.ts.map +1 -0
  1424. package/dist/dts/internal/metric/polling.d.ts +2 -0
  1425. package/dist/dts/internal/metric/polling.d.ts.map +1 -0
  1426. package/dist/dts/internal/metric/registry.d.ts +2 -0
  1427. package/dist/dts/internal/metric/registry.d.ts.map +1 -0
  1428. package/dist/dts/internal/metric/state.d.ts +22 -0
  1429. package/dist/dts/internal/metric/state.d.ts.map +1 -0
  1430. package/dist/dts/internal/metric.d.ts +2 -0
  1431. package/dist/dts/internal/metric.d.ts.map +1 -0
  1432. package/dist/dts/internal/opCodes/cause.d.ts +2 -0
  1433. package/dist/dts/internal/opCodes/cause.d.ts.map +1 -0
  1434. package/dist/dts/internal/opCodes/channel.d.ts +2 -0
  1435. package/dist/dts/internal/opCodes/channel.d.ts.map +1 -0
  1436. package/dist/dts/internal/opCodes/channelChildExecutorDecision.d.ts +2 -0
  1437. package/dist/dts/internal/opCodes/channelChildExecutorDecision.d.ts.map +1 -0
  1438. package/dist/dts/internal/opCodes/channelMergeDecision.d.ts +2 -0
  1439. package/dist/dts/internal/opCodes/channelMergeDecision.d.ts.map +1 -0
  1440. package/dist/dts/internal/opCodes/channelMergeState.d.ts +2 -0
  1441. package/dist/dts/internal/opCodes/channelMergeState.d.ts.map +1 -0
  1442. package/dist/dts/internal/opCodes/channelMergeStrategy.d.ts +2 -0
  1443. package/dist/dts/internal/opCodes/channelMergeStrategy.d.ts.map +1 -0
  1444. package/dist/dts/internal/opCodes/channelState.d.ts +2 -0
  1445. package/dist/dts/internal/opCodes/channelState.d.ts.map +1 -0
  1446. package/dist/dts/internal/opCodes/channelUpstreamPullRequest.d.ts +2 -0
  1447. package/dist/dts/internal/opCodes/channelUpstreamPullRequest.d.ts.map +1 -0
  1448. package/dist/dts/internal/opCodes/channelUpstreamPullStrategy.d.ts +2 -0
  1449. package/dist/dts/internal/opCodes/channelUpstreamPullStrategy.d.ts.map +1 -0
  1450. package/dist/dts/internal/opCodes/config.d.ts +2 -0
  1451. package/dist/dts/internal/opCodes/config.d.ts.map +1 -0
  1452. package/dist/dts/internal/opCodes/configError.d.ts +2 -0
  1453. package/dist/dts/internal/opCodes/configError.d.ts.map +1 -0
  1454. package/dist/dts/internal/opCodes/continuation.d.ts +2 -0
  1455. package/dist/dts/internal/opCodes/continuation.d.ts.map +1 -0
  1456. package/dist/dts/internal/opCodes/deferred.d.ts +2 -0
  1457. package/dist/dts/internal/opCodes/deferred.d.ts.map +1 -0
  1458. package/dist/dts/internal/opCodes/effect.d.ts +2 -0
  1459. package/dist/dts/internal/opCodes/effect.d.ts.map +1 -0
  1460. package/dist/dts/internal/opCodes/layer.d.ts +2 -0
  1461. package/dist/dts/internal/opCodes/layer.d.ts.map +1 -0
  1462. package/dist/dts/internal/opCodes/streamHaltStrategy.d.ts +2 -0
  1463. package/dist/dts/internal/opCodes/streamHaltStrategy.d.ts.map +1 -0
  1464. package/dist/dts/internal/option.d.ts +5 -0
  1465. package/dist/dts/internal/option.d.ts.map +1 -0
  1466. package/dist/dts/internal/pool.d.ts +2 -0
  1467. package/dist/dts/internal/pool.d.ts.map +1 -0
  1468. package/dist/dts/internal/pubsub.d.ts +2 -0
  1469. package/dist/dts/internal/pubsub.d.ts.map +1 -0
  1470. package/dist/dts/internal/query.d.ts +2 -0
  1471. package/dist/dts/internal/query.d.ts.map +1 -0
  1472. package/dist/dts/internal/queue.d.ts +2 -0
  1473. package/dist/dts/internal/queue.d.ts.map +1 -0
  1474. package/dist/dts/internal/random.d.ts +3 -0
  1475. package/dist/dts/internal/random.d.ts.map +1 -0
  1476. package/dist/dts/internal/rateLimiter.d.ts +2 -0
  1477. package/dist/dts/internal/rateLimiter.d.ts.map +1 -0
  1478. package/dist/dts/internal/rcMap.d.ts +2 -0
  1479. package/dist/dts/internal/rcMap.d.ts.map +1 -0
  1480. package/dist/dts/internal/rcRef.d.ts +2 -0
  1481. package/dist/dts/internal/rcRef.d.ts.map +1 -0
  1482. package/dist/dts/internal/redBlackTree/iterator.d.ts +2 -0
  1483. package/dist/dts/internal/redBlackTree/iterator.d.ts.map +1 -0
  1484. package/dist/dts/internal/redBlackTree/node.d.ts +14 -0
  1485. package/dist/dts/internal/redBlackTree/node.d.ts.map +1 -0
  1486. package/dist/dts/internal/redBlackTree.d.ts +2 -0
  1487. package/dist/dts/internal/redBlackTree.d.ts.map +1 -0
  1488. package/dist/dts/internal/redacted.d.ts +2 -0
  1489. package/dist/dts/internal/redacted.d.ts.map +1 -0
  1490. package/dist/dts/internal/ref.d.ts +2 -0
  1491. package/dist/dts/internal/ref.d.ts.map +1 -0
  1492. package/dist/dts/internal/reloadable.d.ts +2 -0
  1493. package/dist/dts/internal/reloadable.d.ts.map +1 -0
  1494. package/dist/dts/internal/request.d.ts +2 -0
  1495. package/dist/dts/internal/request.d.ts.map +1 -0
  1496. package/dist/dts/internal/resource.d.ts +2 -0
  1497. package/dist/dts/internal/resource.d.ts.map +1 -0
  1498. package/dist/dts/internal/ringBuffer.d.ts +2 -0
  1499. package/dist/dts/internal/ringBuffer.d.ts.map +1 -0
  1500. package/dist/dts/internal/runtime.d.ts +2 -0
  1501. package/dist/dts/internal/runtime.d.ts.map +1 -0
  1502. package/dist/dts/internal/runtimeFlags.d.ts +3 -0
  1503. package/dist/dts/internal/runtimeFlags.d.ts.map +1 -0
  1504. package/dist/dts/internal/runtimeFlagsPatch.d.ts +2 -0
  1505. package/dist/dts/internal/runtimeFlagsPatch.d.ts.map +1 -0
  1506. package/dist/dts/internal/schedule/decision.d.ts +2 -0
  1507. package/dist/dts/internal/schedule/decision.d.ts.map +1 -0
  1508. package/dist/dts/internal/schedule/interval.d.ts +2 -0
  1509. package/dist/dts/internal/schedule/interval.d.ts.map +1 -0
  1510. package/dist/dts/internal/schedule/intervals.d.ts +2 -0
  1511. package/dist/dts/internal/schedule/intervals.d.ts.map +1 -0
  1512. package/dist/dts/internal/schedule.d.ts +2 -0
  1513. package/dist/dts/internal/schedule.d.ts.map +1 -0
  1514. package/dist/dts/internal/schema/errors.d.ts +2 -0
  1515. package/dist/dts/internal/schema/errors.d.ts.map +1 -0
  1516. package/dist/dts/internal/schema/schemaId.d.ts +2 -0
  1517. package/dist/dts/internal/schema/schemaId.d.ts.map +1 -0
  1518. package/dist/dts/internal/schema/util.d.ts +2 -0
  1519. package/dist/dts/internal/schema/util.d.ts.map +1 -0
  1520. package/dist/dts/internal/scopedCache.d.ts +2 -0
  1521. package/dist/dts/internal/scopedCache.d.ts.map +1 -0
  1522. package/dist/dts/internal/scopedRef.d.ts +2 -0
  1523. package/dist/dts/internal/scopedRef.d.ts.map +1 -0
  1524. package/dist/dts/internal/secret.d.ts +2 -0
  1525. package/dist/dts/internal/secret.d.ts.map +1 -0
  1526. package/dist/dts/internal/singleShotGen.d.ts +2 -0
  1527. package/dist/dts/internal/singleShotGen.d.ts.map +1 -0
  1528. package/dist/dts/internal/sink.d.ts +2 -0
  1529. package/dist/dts/internal/sink.d.ts.map +1 -0
  1530. package/dist/dts/internal/stack.d.ts +2 -0
  1531. package/dist/dts/internal/stack.d.ts.map +1 -0
  1532. package/dist/dts/internal/stm/core.d.ts +2 -0
  1533. package/dist/dts/internal/stm/core.d.ts.map +1 -0
  1534. package/dist/dts/internal/stm/entry.d.ts +2 -0
  1535. package/dist/dts/internal/stm/entry.d.ts.map +1 -0
  1536. package/dist/dts/internal/stm/journal.d.ts +2 -0
  1537. package/dist/dts/internal/stm/journal.d.ts.map +1 -0
  1538. package/dist/dts/internal/stm/opCodes/stm.d.ts +2 -0
  1539. package/dist/dts/internal/stm/opCodes/stm.d.ts.map +1 -0
  1540. package/dist/dts/internal/stm/opCodes/stmState.d.ts +2 -0
  1541. package/dist/dts/internal/stm/opCodes/stmState.d.ts.map +1 -0
  1542. package/dist/dts/internal/stm/opCodes/strategy.d.ts +2 -0
  1543. package/dist/dts/internal/stm/opCodes/strategy.d.ts.map +1 -0
  1544. package/dist/dts/internal/stm/opCodes/tExit.d.ts +2 -0
  1545. package/dist/dts/internal/stm/opCodes/tExit.d.ts.map +1 -0
  1546. package/dist/dts/internal/stm/opCodes/tryCommit.d.ts +2 -0
  1547. package/dist/dts/internal/stm/opCodes/tryCommit.d.ts.map +1 -0
  1548. package/dist/dts/internal/stm/stm.d.ts +7 -0
  1549. package/dist/dts/internal/stm/stm.d.ts.map +1 -0
  1550. package/dist/dts/internal/stm/stmState.d.ts +2 -0
  1551. package/dist/dts/internal/stm/stmState.d.ts.map +1 -0
  1552. package/dist/dts/internal/stm/tArray.d.ts +2 -0
  1553. package/dist/dts/internal/stm/tArray.d.ts.map +1 -0
  1554. package/dist/dts/internal/stm/tDeferred.d.ts +2 -0
  1555. package/dist/dts/internal/stm/tDeferred.d.ts.map +1 -0
  1556. package/dist/dts/internal/stm/tExit.d.ts +5 -0
  1557. package/dist/dts/internal/stm/tExit.d.ts.map +1 -0
  1558. package/dist/dts/internal/stm/tMap.d.ts +2 -0
  1559. package/dist/dts/internal/stm/tMap.d.ts.map +1 -0
  1560. package/dist/dts/internal/stm/tPriorityQueue.d.ts +2 -0
  1561. package/dist/dts/internal/stm/tPriorityQueue.d.ts.map +1 -0
  1562. package/dist/dts/internal/stm/tPubSub.d.ts +2 -0
  1563. package/dist/dts/internal/stm/tPubSub.d.ts.map +1 -0
  1564. package/dist/dts/internal/stm/tQueue.d.ts +2 -0
  1565. package/dist/dts/internal/stm/tQueue.d.ts.map +1 -0
  1566. package/dist/dts/internal/stm/tRandom.d.ts +2 -0
  1567. package/dist/dts/internal/stm/tRandom.d.ts.map +1 -0
  1568. package/dist/dts/internal/stm/tReentrantLock.d.ts +2 -0
  1569. package/dist/dts/internal/stm/tReentrantLock.d.ts.map +1 -0
  1570. package/dist/dts/internal/stm/tRef.d.ts +4 -0
  1571. package/dist/dts/internal/stm/tRef.d.ts.map +1 -0
  1572. package/dist/dts/internal/stm/tSemaphore.d.ts +2 -0
  1573. package/dist/dts/internal/stm/tSemaphore.d.ts.map +1 -0
  1574. package/dist/dts/internal/stm/tSet.d.ts +2 -0
  1575. package/dist/dts/internal/stm/tSet.d.ts.map +1 -0
  1576. package/dist/dts/internal/stm/tSubscriptionRef.d.ts +2 -0
  1577. package/dist/dts/internal/stm/tSubscriptionRef.d.ts.map +1 -0
  1578. package/dist/dts/internal/stm/tryCommit.d.ts +2 -0
  1579. package/dist/dts/internal/stm/tryCommit.d.ts.map +1 -0
  1580. package/dist/dts/internal/stm/txnId.d.ts +2 -0
  1581. package/dist/dts/internal/stm/txnId.d.ts.map +1 -0
  1582. package/dist/dts/internal/stm/versioned.d.ts +2 -0
  1583. package/dist/dts/internal/stm/versioned.d.ts.map +1 -0
  1584. package/dist/dts/internal/stream/debounceState.d.ts +4 -0
  1585. package/dist/dts/internal/stream/debounceState.d.ts.map +1 -0
  1586. package/dist/dts/internal/stream/emit.d.ts +2 -0
  1587. package/dist/dts/internal/stream/emit.d.ts.map +1 -0
  1588. package/dist/dts/internal/stream/haltStrategy.d.ts +2 -0
  1589. package/dist/dts/internal/stream/haltStrategy.d.ts.map +1 -0
  1590. package/dist/dts/internal/stream/handoff.d.ts +2 -0
  1591. package/dist/dts/internal/stream/handoff.d.ts.map +1 -0
  1592. package/dist/dts/internal/stream/handoffSignal.d.ts +6 -0
  1593. package/dist/dts/internal/stream/handoffSignal.d.ts.map +1 -0
  1594. package/dist/dts/internal/stream/pull.d.ts +2 -0
  1595. package/dist/dts/internal/stream/pull.d.ts.map +1 -0
  1596. package/dist/dts/internal/stream/sinkEndReason.d.ts +2 -0
  1597. package/dist/dts/internal/stream/sinkEndReason.d.ts.map +1 -0
  1598. package/dist/dts/internal/stream/zipAllState.d.ts +2 -0
  1599. package/dist/dts/internal/stream/zipAllState.d.ts.map +1 -0
  1600. package/dist/dts/internal/stream/zipChunksState.d.ts +2 -0
  1601. package/dist/dts/internal/stream/zipChunksState.d.ts.map +1 -0
  1602. package/dist/dts/internal/stream.d.ts +29 -0
  1603. package/dist/dts/internal/stream.d.ts.map +1 -0
  1604. package/dist/dts/internal/string-utils.d.ts +7 -0
  1605. package/dist/dts/internal/string-utils.d.ts.map +1 -0
  1606. package/dist/dts/internal/subscriptionRef.d.ts +2 -0
  1607. package/dist/dts/internal/subscriptionRef.d.ts.map +1 -0
  1608. package/dist/dts/internal/supervisor/patch.d.ts +2 -0
  1609. package/dist/dts/internal/supervisor/patch.d.ts.map +1 -0
  1610. package/dist/dts/internal/supervisor.d.ts +2 -0
  1611. package/dist/dts/internal/supervisor.d.ts.map +1 -0
  1612. package/dist/dts/internal/synchronizedRef.d.ts +2 -0
  1613. package/dist/dts/internal/synchronizedRef.d.ts.map +1 -0
  1614. package/dist/dts/internal/take.d.ts +2 -0
  1615. package/dist/dts/internal/take.d.ts.map +1 -0
  1616. package/dist/dts/internal/testing/sleep.d.ts +2 -0
  1617. package/dist/dts/internal/testing/sleep.d.ts.map +1 -0
  1618. package/dist/dts/internal/testing/suspendedWarningData.d.ts +2 -0
  1619. package/dist/dts/internal/testing/suspendedWarningData.d.ts.map +1 -0
  1620. package/dist/dts/internal/testing/warningData.d.ts +2 -0
  1621. package/dist/dts/internal/testing/warningData.d.ts.map +1 -0
  1622. package/dist/dts/internal/tracer.d.ts +2 -0
  1623. package/dist/dts/internal/tracer.d.ts.map +1 -0
  1624. package/dist/dts/internal/trie.d.ts +2 -0
  1625. package/dist/dts/internal/trie.d.ts.map +1 -0
  1626. package/dist/dts/internal/version.d.ts +3 -0
  1627. package/dist/dts/internal/version.d.ts.map +1 -0
  1628. package/dist/esm/Arbitrary.js +798 -0
  1629. package/dist/esm/Arbitrary.js.map +1 -0
  1630. package/dist/esm/Array.js +2703 -0
  1631. package/dist/esm/Array.js.map +1 -0
  1632. package/dist/esm/BigDecimal.js +1087 -0
  1633. package/dist/esm/BigDecimal.js.map +1 -0
  1634. package/dist/esm/BigInt.js +548 -0
  1635. package/dist/esm/BigInt.js.map +1 -0
  1636. package/dist/esm/Boolean.js +240 -0
  1637. package/dist/esm/Boolean.js.map +1 -0
  1638. package/dist/esm/Brand.js +161 -0
  1639. package/dist/esm/Brand.js.map +1 -0
  1640. package/dist/esm/Cache.js +43 -0
  1641. package/dist/esm/Cache.js.map +1 -0
  1642. package/dist/esm/Cause.js +1004 -0
  1643. package/dist/esm/Cause.js.map +1 -0
  1644. package/dist/esm/Channel.js +887 -0
  1645. package/dist/esm/Channel.js.map +1 -0
  1646. package/dist/esm/ChildExecutorDecision.js +64 -0
  1647. package/dist/esm/ChildExecutorDecision.js.map +1 -0
  1648. package/dist/esm/Chunk.js +1083 -0
  1649. package/dist/esm/Chunk.js.map +1 -0
  1650. package/dist/esm/Clock.js +38 -0
  1651. package/dist/esm/Clock.js.map +1 -0
  1652. package/dist/esm/Config.js +321 -0
  1653. package/dist/esm/Config.js.map +1 -0
  1654. package/dist/esm/ConfigError.js +107 -0
  1655. package/dist/esm/ConfigError.js.map +1 -0
  1656. package/dist/esm/ConfigProvider.js +166 -0
  1657. package/dist/esm/ConfigProvider.js.map +1 -0
  1658. package/dist/esm/ConfigProviderPathPatch.js +30 -0
  1659. package/dist/esm/ConfigProviderPathPatch.js.map +1 -0
  1660. package/dist/esm/Console.js +118 -0
  1661. package/dist/esm/Console.js.map +1 -0
  1662. package/dist/esm/Context.js +360 -0
  1663. package/dist/esm/Context.js.map +1 -0
  1664. package/dist/esm/Cron.js +566 -0
  1665. package/dist/esm/Cron.js.map +1 -0
  1666. package/dist/esm/Data.js +305 -0
  1667. package/dist/esm/Data.js.map +1 -0
  1668. package/dist/esm/DateTime.js +1071 -0
  1669. package/dist/esm/DateTime.js.map +1 -0
  1670. package/dist/esm/DefaultServices.js +12 -0
  1671. package/dist/esm/DefaultServices.js.map +1 -0
  1672. package/dist/esm/Deferred.js +169 -0
  1673. package/dist/esm/Deferred.js.map +1 -0
  1674. package/dist/esm/Differ.js +132 -0
  1675. package/dist/esm/Differ.js.map +1 -0
  1676. package/dist/esm/Duration.js +702 -0
  1677. package/dist/esm/Duration.js.map +1 -0
  1678. package/dist/esm/Effect.js +10883 -0
  1679. package/dist/esm/Effect.js.map +1 -0
  1680. package/dist/esm/Effectable.js +49 -0
  1681. package/dist/esm/Effectable.js.map +1 -0
  1682. package/dist/esm/Either.js +688 -0
  1683. package/dist/esm/Either.js.map +1 -0
  1684. package/dist/esm/Encoding.js +136 -0
  1685. package/dist/esm/Encoding.js.map +1 -0
  1686. package/dist/esm/Equal.js +71 -0
  1687. package/dist/esm/Equal.js.map +1 -0
  1688. package/dist/esm/Equivalence.js +166 -0
  1689. package/dist/esm/Equivalence.js.map +1 -0
  1690. package/dist/esm/ExecutionPlan.js +99 -0
  1691. package/dist/esm/ExecutionPlan.js.map +1 -0
  1692. package/dist/esm/ExecutionStrategy.js +55 -0
  1693. package/dist/esm/ExecutionStrategy.js.map +1 -0
  1694. package/dist/esm/Exit.js +257 -0
  1695. package/dist/esm/Exit.js.map +1 -0
  1696. package/dist/esm/FastCheck.js +9 -0
  1697. package/dist/esm/FastCheck.js.map +1 -0
  1698. package/dist/esm/Fiber.js +350 -0
  1699. package/dist/esm/Fiber.js.map +1 -0
  1700. package/dist/esm/FiberHandle.js +316 -0
  1701. package/dist/esm/FiberHandle.js.map +1 -0
  1702. package/dist/esm/FiberId.js +115 -0
  1703. package/dist/esm/FiberId.js.map +1 -0
  1704. package/dist/esm/FiberMap.js +356 -0
  1705. package/dist/esm/FiberMap.js.map +1 -0
  1706. package/dist/esm/FiberRef.js +242 -0
  1707. package/dist/esm/FiberRef.js.map +1 -0
  1708. package/dist/esm/FiberRefs.js +92 -0
  1709. package/dist/esm/FiberRefs.js.map +1 -0
  1710. package/dist/esm/FiberRefsPatch.js +32 -0
  1711. package/dist/esm/FiberRefsPatch.js.map +1 -0
  1712. package/dist/esm/FiberSet.js +289 -0
  1713. package/dist/esm/FiberSet.js.map +1 -0
  1714. package/dist/esm/FiberStatus.js +52 -0
  1715. package/dist/esm/FiberStatus.js.map +1 -0
  1716. package/dist/esm/Function.js +467 -0
  1717. package/dist/esm/Function.js.map +1 -0
  1718. package/dist/esm/GlobalValue.js +52 -0
  1719. package/dist/esm/GlobalValue.js.map +1 -0
  1720. package/dist/esm/Graph.js +3019 -0
  1721. package/dist/esm/Graph.js.map +1 -0
  1722. package/dist/esm/GroupBy.js +39 -0
  1723. package/dist/esm/GroupBy.js.map +1 -0
  1724. package/dist/esm/HKT.js +2 -0
  1725. package/dist/esm/HKT.js.map +1 -0
  1726. package/dist/esm/Hash.js +166 -0
  1727. package/dist/esm/Hash.js.map +1 -0
  1728. package/dist/esm/HashMap.js +312 -0
  1729. package/dist/esm/HashMap.js.map +1 -0
  1730. package/dist/esm/HashRing.js +245 -0
  1731. package/dist/esm/HashRing.js.map +1 -0
  1732. package/dist/esm/HashSet.js +1253 -0
  1733. package/dist/esm/HashSet.js.map +1 -0
  1734. package/dist/esm/Inspectable.js +194 -0
  1735. package/dist/esm/Inspectable.js.map +1 -0
  1736. package/dist/esm/Iterable.js +987 -0
  1737. package/dist/esm/Iterable.js.map +1 -0
  1738. package/dist/esm/JSONSchema.js +715 -0
  1739. package/dist/esm/JSONSchema.js.map +1 -0
  1740. package/dist/esm/KeyedPool.js +76 -0
  1741. package/dist/esm/KeyedPool.js.map +1 -0
  1742. package/dist/esm/Layer.js +642 -0
  1743. package/dist/esm/Layer.js.map +1 -0
  1744. package/dist/esm/LayerMap.js +202 -0
  1745. package/dist/esm/LayerMap.js.map +1 -0
  1746. package/dist/esm/List.js +756 -0
  1747. package/dist/esm/List.js.map +1 -0
  1748. package/dist/esm/LogLevel.js +135 -0
  1749. package/dist/esm/LogLevel.js.map +1 -0
  1750. package/dist/esm/LogSpan.js +15 -0
  1751. package/dist/esm/LogSpan.js.map +1 -0
  1752. package/dist/esm/Logger.js +490 -0
  1753. package/dist/esm/Logger.js.map +1 -0
  1754. package/dist/esm/Mailbox.js +96 -0
  1755. package/dist/esm/Mailbox.js.map +1 -0
  1756. package/dist/esm/ManagedRuntime.js +42 -0
  1757. package/dist/esm/ManagedRuntime.js.map +1 -0
  1758. package/dist/esm/Match.js +828 -0
  1759. package/dist/esm/Match.js.map +1 -0
  1760. package/dist/esm/MergeDecision.js +35 -0
  1761. package/dist/esm/MergeDecision.js.map +1 -0
  1762. package/dist/esm/MergeState.js +58 -0
  1763. package/dist/esm/MergeState.js.map +1 -0
  1764. package/dist/esm/MergeStrategy.js +51 -0
  1765. package/dist/esm/MergeStrategy.js.map +1 -0
  1766. package/dist/esm/Metric.js +408 -0
  1767. package/dist/esm/Metric.js.map +1 -0
  1768. package/dist/esm/MetricBoundaries.js +33 -0
  1769. package/dist/esm/MetricBoundaries.js.map +1 -0
  1770. package/dist/esm/MetricHook.js +47 -0
  1771. package/dist/esm/MetricHook.js.map +1 -0
  1772. package/dist/esm/MetricKey.js +63 -0
  1773. package/dist/esm/MetricKey.js.map +1 -0
  1774. package/dist/esm/MetricKeyType.js +87 -0
  1775. package/dist/esm/MetricKeyType.js.map +1 -0
  1776. package/dist/esm/MetricLabel.js +17 -0
  1777. package/dist/esm/MetricLabel.js.map +1 -0
  1778. package/dist/esm/MetricPair.js +20 -0
  1779. package/dist/esm/MetricPair.js.map +1 -0
  1780. package/dist/esm/MetricPolling.js +59 -0
  1781. package/dist/esm/MetricPolling.js.map +1 -0
  1782. package/dist/esm/MetricRegistry.js +15 -0
  1783. package/dist/esm/MetricRegistry.js.map +1 -0
  1784. package/dist/esm/MetricState.js +87 -0
  1785. package/dist/esm/MetricState.js.map +1 -0
  1786. package/dist/esm/Micro.js +2528 -0
  1787. package/dist/esm/Micro.js.map +1 -0
  1788. package/dist/esm/ModuleVersion.js +17 -0
  1789. package/dist/esm/ModuleVersion.js.map +1 -0
  1790. package/dist/esm/MutableHashMap.js +299 -0
  1791. package/dist/esm/MutableHashMap.js.map +1 -0
  1792. package/dist/esm/MutableHashSet.js +511 -0
  1793. package/dist/esm/MutableHashSet.js.map +1 -0
  1794. package/dist/esm/MutableList.js +240 -0
  1795. package/dist/esm/MutableList.js.map +1 -0
  1796. package/dist/esm/MutableQueue.js +159 -0
  1797. package/dist/esm/MutableQueue.js.map +1 -0
  1798. package/dist/esm/MutableRef.js +127 -0
  1799. package/dist/esm/MutableRef.js.map +1 -0
  1800. package/dist/esm/NonEmptyIterable.js +16 -0
  1801. package/dist/esm/NonEmptyIterable.js.map +1 -0
  1802. package/dist/esm/Number.js +887 -0
  1803. package/dist/esm/Number.js.map +1 -0
  1804. package/dist/esm/Option.js +1785 -0
  1805. package/dist/esm/Option.js.map +1 -0
  1806. package/dist/esm/Order.js +252 -0
  1807. package/dist/esm/Order.js.map +1 -0
  1808. package/dist/esm/Ordering.js +72 -0
  1809. package/dist/esm/Ordering.js.map +1 -0
  1810. package/dist/esm/ParseResult.js +1556 -0
  1811. package/dist/esm/ParseResult.js.map +1 -0
  1812. package/dist/esm/PartitionedSemaphore.js +137 -0
  1813. package/dist/esm/PartitionedSemaphore.js.map +1 -0
  1814. package/dist/esm/Pipeable.js +62 -0
  1815. package/dist/esm/Pipeable.js.map +1 -0
  1816. package/dist/esm/Pool.js +100 -0
  1817. package/dist/esm/Pool.js.map +1 -0
  1818. package/dist/esm/Predicate.js +1117 -0
  1819. package/dist/esm/Predicate.js.map +1 -0
  1820. package/dist/esm/Pretty.js +174 -0
  1821. package/dist/esm/Pretty.js.map +1 -0
  1822. package/dist/esm/PrimaryKey.js +14 -0
  1823. package/dist/esm/PrimaryKey.js.map +1 -0
  1824. package/dist/esm/PubSub.js +120 -0
  1825. package/dist/esm/PubSub.js.map +1 -0
  1826. package/dist/esm/Queue.js +248 -0
  1827. package/dist/esm/Queue.js.map +1 -0
  1828. package/dist/esm/Random.js +138 -0
  1829. package/dist/esm/Random.js.map +1 -0
  1830. package/dist/esm/RateLimiter.js +77 -0
  1831. package/dist/esm/RateLimiter.js.map +1 -0
  1832. package/dist/esm/RcMap.js +69 -0
  1833. package/dist/esm/RcMap.js.map +1 -0
  1834. package/dist/esm/RcRef.js +51 -0
  1835. package/dist/esm/RcRef.js.map +1 -0
  1836. package/dist/esm/Readable.js +45 -0
  1837. package/dist/esm/Readable.js.map +1 -0
  1838. package/dist/esm/Record.js +846 -0
  1839. package/dist/esm/Record.js.map +1 -0
  1840. package/dist/esm/RedBlackTree.js +259 -0
  1841. package/dist/esm/RedBlackTree.js.map +1 -0
  1842. package/dist/esm/Redacted.js +93 -0
  1843. package/dist/esm/Redacted.js.map +1 -0
  1844. package/dist/esm/Ref.js +77 -0
  1845. package/dist/esm/Ref.js.map +1 -0
  1846. package/dist/esm/RegExp.js +37 -0
  1847. package/dist/esm/RegExp.js.map +1 -0
  1848. package/dist/esm/Reloadable.js +59 -0
  1849. package/dist/esm/Reloadable.js.map +1 -0
  1850. package/dist/esm/Request.js +140 -0
  1851. package/dist/esm/Request.js.map +1 -0
  1852. package/dist/esm/RequestBlock.js +35 -0
  1853. package/dist/esm/RequestBlock.js.map +1 -0
  1854. package/dist/esm/RequestResolver.js +175 -0
  1855. package/dist/esm/RequestResolver.js.map +1 -0
  1856. package/dist/esm/Resource.js +44 -0
  1857. package/dist/esm/Resource.js.map +1 -0
  1858. package/dist/esm/Runtime.js +181 -0
  1859. package/dist/esm/Runtime.js.map +1 -0
  1860. package/dist/esm/RuntimeFlags.js +251 -0
  1861. package/dist/esm/RuntimeFlags.js.map +1 -0
  1862. package/dist/esm/RuntimeFlagsPatch.js +134 -0
  1863. package/dist/esm/RuntimeFlagsPatch.js.map +1 -0
  1864. package/dist/esm/STM.js +1002 -0
  1865. package/dist/esm/STM.js.map +1 -0
  1866. package/dist/esm/Schedule.js +1595 -0
  1867. package/dist/esm/Schedule.js.map +1 -0
  1868. package/dist/esm/ScheduleDecision.js +32 -0
  1869. package/dist/esm/ScheduleDecision.js.map +1 -0
  1870. package/dist/esm/ScheduleInterval.js +100 -0
  1871. package/dist/esm/ScheduleInterval.js.map +1 -0
  1872. package/dist/esm/ScheduleIntervals.js +78 -0
  1873. package/dist/esm/ScheduleIntervals.js.map +1 -0
  1874. package/dist/esm/Scheduler.js +289 -0
  1875. package/dist/esm/Scheduler.js.map +1 -0
  1876. package/dist/esm/Schema.js +6035 -0
  1877. package/dist/esm/Schema.js.map +1 -0
  1878. package/dist/esm/SchemaAST.js +2485 -0
  1879. package/dist/esm/SchemaAST.js.map +1 -0
  1880. package/dist/esm/Scope.js +94 -0
  1881. package/dist/esm/Scope.js.map +1 -0
  1882. package/dist/esm/ScopedCache.js +24 -0
  1883. package/dist/esm/ScopedCache.js.map +1 -0
  1884. package/dist/esm/ScopedRef.js +42 -0
  1885. package/dist/esm/ScopedRef.js.map +1 -0
  1886. package/dist/esm/Secret.js +44 -0
  1887. package/dist/esm/Secret.js.map +1 -0
  1888. package/dist/esm/SingleProducerAsyncInput.js +7 -0
  1889. package/dist/esm/SingleProducerAsyncInput.js.map +1 -0
  1890. package/dist/esm/Sink.js +864 -0
  1891. package/dist/esm/Sink.js.map +1 -0
  1892. package/dist/esm/SortedMap.js +169 -0
  1893. package/dist/esm/SortedMap.js.map +1 -0
  1894. package/dist/esm/SortedSet.js +237 -0
  1895. package/dist/esm/SortedSet.js.map +1 -0
  1896. package/dist/esm/Stream.js +4192 -0
  1897. package/dist/esm/Stream.js.map +1 -0
  1898. package/dist/esm/StreamEmit.js +2 -0
  1899. package/dist/esm/StreamEmit.js.map +1 -0
  1900. package/dist/esm/StreamHaltStrategy.js +57 -0
  1901. package/dist/esm/StreamHaltStrategy.js.map +1 -0
  1902. package/dist/esm/Streamable.js +36 -0
  1903. package/dist/esm/Streamable.js.map +1 -0
  1904. package/dist/esm/String.js +635 -0
  1905. package/dist/esm/String.js.map +1 -0
  1906. package/dist/esm/Struct.js +191 -0
  1907. package/dist/esm/Struct.js.map +1 -0
  1908. package/dist/esm/Subscribable.js +56 -0
  1909. package/dist/esm/Subscribable.js.map +1 -0
  1910. package/dist/esm/SubscriptionRef.js +116 -0
  1911. package/dist/esm/SubscriptionRef.js.map +1 -0
  1912. package/dist/esm/Supervisor.js +107 -0
  1913. package/dist/esm/Supervisor.js.map +1 -0
  1914. package/dist/esm/Symbol.js +27 -0
  1915. package/dist/esm/Symbol.js.map +1 -0
  1916. package/dist/esm/SynchronizedRef.js +119 -0
  1917. package/dist/esm/SynchronizedRef.js.map +1 -0
  1918. package/dist/esm/TArray.js +306 -0
  1919. package/dist/esm/TArray.js.map +1 -0
  1920. package/dist/esm/TDeferred.js +39 -0
  1921. package/dist/esm/TDeferred.js.map +1 -0
  1922. package/dist/esm/TMap.js +279 -0
  1923. package/dist/esm/TMap.js.map +1 -0
  1924. package/dist/esm/TPriorityQueue.js +136 -0
  1925. package/dist/esm/TPriorityQueue.js.map +1 -0
  1926. package/dist/esm/TPubSub.js +131 -0
  1927. package/dist/esm/TPubSub.js.map +1 -0
  1928. package/dist/esm/TQueue.js +229 -0
  1929. package/dist/esm/TQueue.js.map +1 -0
  1930. package/dist/esm/TRandom.js +65 -0
  1931. package/dist/esm/TRandom.js.map +1 -0
  1932. package/dist/esm/TReentrantLock.js +142 -0
  1933. package/dist/esm/TReentrantLock.js.map +1 -0
  1934. package/dist/esm/TRef.js +75 -0
  1935. package/dist/esm/TRef.js.map +1 -0
  1936. package/dist/esm/TSemaphore.js +65 -0
  1937. package/dist/esm/TSemaphore.js.map +1 -0
  1938. package/dist/esm/TSet.js +201 -0
  1939. package/dist/esm/TSet.js.map +1 -0
  1940. package/dist/esm/TSubscriptionRef.js +87 -0
  1941. package/dist/esm/TSubscriptionRef.js.map +1 -0
  1942. package/dist/esm/Take.js +148 -0
  1943. package/dist/esm/Take.js.map +1 -0
  1944. package/dist/esm/TestAnnotation.js +94 -0
  1945. package/dist/esm/TestAnnotation.js.map +1 -0
  1946. package/dist/esm/TestAnnotationMap.js +80 -0
  1947. package/dist/esm/TestAnnotationMap.js.map +1 -0
  1948. package/dist/esm/TestAnnotations.js +61 -0
  1949. package/dist/esm/TestAnnotations.js.map +1 -0
  1950. package/dist/esm/TestClock.js +354 -0
  1951. package/dist/esm/TestClock.js.map +1 -0
  1952. package/dist/esm/TestConfig.js +13 -0
  1953. package/dist/esm/TestConfig.js.map +1 -0
  1954. package/dist/esm/TestContext.js +21 -0
  1955. package/dist/esm/TestContext.js.map +1 -0
  1956. package/dist/esm/TestLive.js +30 -0
  1957. package/dist/esm/TestLive.js.map +1 -0
  1958. package/dist/esm/TestServices.js +230 -0
  1959. package/dist/esm/TestServices.js.map +1 -0
  1960. package/dist/esm/TestSized.js +36 -0
  1961. package/dist/esm/TestSized.js.map +1 -0
  1962. package/dist/esm/Tracer.js +37 -0
  1963. package/dist/esm/Tracer.js.map +1 -0
  1964. package/dist/esm/Trie.js +716 -0
  1965. package/dist/esm/Trie.js.map +1 -0
  1966. package/dist/esm/Tuple.js +235 -0
  1967. package/dist/esm/Tuple.js.map +1 -0
  1968. package/dist/esm/Types.js +7 -0
  1969. package/dist/esm/Types.js.map +1 -0
  1970. package/dist/esm/Unify.js +9 -0
  1971. package/dist/esm/Unify.js.map +1 -0
  1972. package/dist/esm/UpstreamPullRequest.js +51 -0
  1973. package/dist/esm/UpstreamPullRequest.js.map +1 -0
  1974. package/dist/esm/UpstreamPullStrategy.js +51 -0
  1975. package/dist/esm/UpstreamPullStrategy.js.map +1 -0
  1976. package/dist/esm/Utils.js +357 -0
  1977. package/dist/esm/Utils.js.map +1 -0
  1978. package/dist/esm/index.js +1385 -0
  1979. package/dist/esm/index.js.map +1 -0
  1980. package/dist/esm/internal/array.js +6 -0
  1981. package/dist/esm/internal/array.js.map +1 -0
  1982. package/dist/esm/internal/blockedRequests.js +341 -0
  1983. package/dist/esm/internal/blockedRequests.js.map +1 -0
  1984. package/dist/esm/internal/cache.js +480 -0
  1985. package/dist/esm/internal/cache.js.map +1 -0
  1986. package/dist/esm/internal/cause.js +824 -0
  1987. package/dist/esm/internal/cause.js.map +1 -0
  1988. package/dist/esm/internal/channel/channelExecutor.js +688 -0
  1989. package/dist/esm/internal/channel/channelExecutor.js.map +1 -0
  1990. package/dist/esm/internal/channel/channelState.js +59 -0
  1991. package/dist/esm/internal/channel/channelState.js.map +1 -0
  1992. package/dist/esm/internal/channel/childExecutorDecision.js +60 -0
  1993. package/dist/esm/internal/channel/childExecutorDecision.js.map +1 -0
  1994. package/dist/esm/internal/channel/continuation.js +48 -0
  1995. package/dist/esm/internal/channel/continuation.js.map +1 -0
  1996. package/dist/esm/internal/channel/mergeDecision.js +49 -0
  1997. package/dist/esm/internal/channel/mergeDecision.js.map +1 -0
  1998. package/dist/esm/internal/channel/mergeState.js +69 -0
  1999. package/dist/esm/internal/channel/mergeState.js.map +1 -0
  2000. package/dist/esm/internal/channel/mergeStrategy.js +46 -0
  2001. package/dist/esm/internal/channel/mergeStrategy.js.map +1 -0
  2002. package/dist/esm/internal/channel/singleProducerAsyncInput.js +163 -0
  2003. package/dist/esm/internal/channel/singleProducerAsyncInput.js.map +1 -0
  2004. package/dist/esm/internal/channel/subexecutor.js +152 -0
  2005. package/dist/esm/internal/channel/subexecutor.js.map +1 -0
  2006. package/dist/esm/internal/channel/upstreamPullRequest.js +52 -0
  2007. package/dist/esm/internal/channel/upstreamPullRequest.js.map +1 -0
  2008. package/dist/esm/internal/channel/upstreamPullStrategy.js +52 -0
  2009. package/dist/esm/internal/channel/upstreamPullStrategy.js.map +1 -0
  2010. package/dist/esm/internal/channel.js +683 -0
  2011. package/dist/esm/internal/channel.js.map +1 -0
  2012. package/dist/esm/internal/clock.js +77 -0
  2013. package/dist/esm/internal/clock.js.map +1 -0
  2014. package/dist/esm/internal/completedRequestMap.js +5 -0
  2015. package/dist/esm/internal/completedRequestMap.js.map +1 -0
  2016. package/dist/esm/internal/concurrency.js +28 -0
  2017. package/dist/esm/internal/concurrency.js.map +1 -0
  2018. package/dist/esm/internal/config.js +363 -0
  2019. package/dist/esm/internal/config.js.map +1 -0
  2020. package/dist/esm/internal/configError.js +263 -0
  2021. package/dist/esm/internal/configError.js.map +1 -0
  2022. package/dist/esm/internal/configProvider/pathPatch.js +76 -0
  2023. package/dist/esm/internal/configProvider/pathPatch.js.map +1 -0
  2024. package/dist/esm/internal/configProvider.js +425 -0
  2025. package/dist/esm/internal/configProvider.js.map +1 -0
  2026. package/dist/esm/internal/console.js +54 -0
  2027. package/dist/esm/internal/console.js.map +1 -0
  2028. package/dist/esm/internal/context.js +253 -0
  2029. package/dist/esm/internal/context.js.map +1 -0
  2030. package/dist/esm/internal/core-effect.js +811 -0
  2031. package/dist/esm/internal/core-effect.js.map +1 -0
  2032. package/dist/esm/internal/core-stream.js +236 -0
  2033. package/dist/esm/internal/core-stream.js.map +1 -0
  2034. package/dist/esm/internal/core.js +1610 -0
  2035. package/dist/esm/internal/core.js.map +1 -0
  2036. package/dist/esm/internal/data.js +29 -0
  2037. package/dist/esm/internal/data.js.map +1 -0
  2038. package/dist/esm/internal/dataSource.js +93 -0
  2039. package/dist/esm/internal/dataSource.js.map +1 -0
  2040. package/dist/esm/internal/dateTime.js +796 -0
  2041. package/dist/esm/internal/dateTime.js.map +1 -0
  2042. package/dist/esm/internal/defaultServices/console.js +92 -0
  2043. package/dist/esm/internal/defaultServices/console.js.map +1 -0
  2044. package/dist/esm/internal/defaultServices.js +73 -0
  2045. package/dist/esm/internal/defaultServices.js.map +1 -0
  2046. package/dist/esm/internal/deferred.js +27 -0
  2047. package/dist/esm/internal/deferred.js.map +1 -0
  2048. package/dist/esm/internal/differ/chunkPatch.js +130 -0
  2049. package/dist/esm/internal/differ/chunkPatch.js.map +1 -0
  2050. package/dist/esm/internal/differ/contextPatch.js +143 -0
  2051. package/dist/esm/internal/differ/contextPatch.js.map +1 -0
  2052. package/dist/esm/internal/differ/hashMapPatch.js +130 -0
  2053. package/dist/esm/internal/differ/hashMapPatch.js.map +1 -0
  2054. package/dist/esm/internal/differ/hashSetPatch.js +101 -0
  2055. package/dist/esm/internal/differ/hashSetPatch.js.map +1 -0
  2056. package/dist/esm/internal/differ/orPatch.js +170 -0
  2057. package/dist/esm/internal/differ/orPatch.js.map +1 -0
  2058. package/dist/esm/internal/differ/readonlyArrayPatch.js +129 -0
  2059. package/dist/esm/internal/differ/readonlyArrayPatch.js.map +1 -0
  2060. package/dist/esm/internal/differ.js +134 -0
  2061. package/dist/esm/internal/differ.js.map +1 -0
  2062. package/dist/esm/internal/doNotation.js +16 -0
  2063. package/dist/esm/internal/doNotation.js.map +1 -0
  2064. package/dist/esm/internal/effect/circular.js +402 -0
  2065. package/dist/esm/internal/effect/circular.js.map +1 -0
  2066. package/dist/esm/internal/effectable.js +113 -0
  2067. package/dist/esm/internal/effectable.js.map +1 -0
  2068. package/dist/esm/internal/either.js +85 -0
  2069. package/dist/esm/internal/either.js.map +1 -0
  2070. package/dist/esm/internal/encoding/base64.js +71 -0
  2071. package/dist/esm/internal/encoding/base64.js.map +1 -0
  2072. package/dist/esm/internal/encoding/base64Url.js +21 -0
  2073. package/dist/esm/internal/encoding/base64Url.js.map +1 -0
  2074. package/dist/esm/internal/encoding/common.js +38 -0
  2075. package/dist/esm/internal/encoding/common.js.map +1 -0
  2076. package/dist/esm/internal/encoding/hex.js +48 -0
  2077. package/dist/esm/internal/encoding/hex.js.map +1 -0
  2078. package/dist/esm/internal/errors.js +6 -0
  2079. package/dist/esm/internal/errors.js.map +1 -0
  2080. package/dist/esm/internal/executionPlan.js +59 -0
  2081. package/dist/esm/internal/executionPlan.js.map +1 -0
  2082. package/dist/esm/internal/executionStrategy.js +44 -0
  2083. package/dist/esm/internal/executionStrategy.js.map +1 -0
  2084. package/dist/esm/internal/fiber.js +253 -0
  2085. package/dist/esm/internal/fiber.js.map +1 -0
  2086. package/dist/esm/internal/fiberId.js +219 -0
  2087. package/dist/esm/internal/fiberId.js.map +1 -0
  2088. package/dist/esm/internal/fiberMessage.js +28 -0
  2089. package/dist/esm/internal/fiberMessage.js.map +1 -0
  2090. package/dist/esm/internal/fiberRefs/patch.js +107 -0
  2091. package/dist/esm/internal/fiberRefs/patch.js.map +1 -0
  2092. package/dist/esm/internal/fiberRefs.js +189 -0
  2093. package/dist/esm/internal/fiberRefs.js.map +1 -0
  2094. package/dist/esm/internal/fiberRuntime.js +2148 -0
  2095. package/dist/esm/internal/fiberRuntime.js.map +1 -0
  2096. package/dist/esm/internal/fiberScope.js +44 -0
  2097. package/dist/esm/internal/fiberScope.js.map +1 -0
  2098. package/dist/esm/internal/fiberStatus.js +72 -0
  2099. package/dist/esm/internal/fiberStatus.js.map +1 -0
  2100. package/dist/esm/internal/groupBy.js +213 -0
  2101. package/dist/esm/internal/groupBy.js.map +1 -0
  2102. package/dist/esm/internal/hashMap/array.js +48 -0
  2103. package/dist/esm/internal/hashMap/array.js.map +1 -0
  2104. package/dist/esm/internal/hashMap/bitwise.js +29 -0
  2105. package/dist/esm/internal/hashMap/bitwise.js.map +1 -0
  2106. package/dist/esm/internal/hashMap/config.js +11 -0
  2107. package/dist/esm/internal/hashMap/config.js.map +1 -0
  2108. package/dist/esm/internal/hashMap/keySet.js +6 -0
  2109. package/dist/esm/internal/hashMap/keySet.js.map +1 -0
  2110. package/dist/esm/internal/hashMap/node.js +253 -0
  2111. package/dist/esm/internal/hashMap/node.js.map +1 -0
  2112. package/dist/esm/internal/hashMap.js +360 -0
  2113. package/dist/esm/internal/hashMap.js.map +1 -0
  2114. package/dist/esm/internal/hashSet.js +182 -0
  2115. package/dist/esm/internal/hashSet.js.map +1 -0
  2116. package/dist/esm/internal/keyedPool.js +159 -0
  2117. package/dist/esm/internal/keyedPool.js.map +1 -0
  2118. package/dist/esm/internal/layer/circular.js +63 -0
  2119. package/dist/esm/internal/layer/circular.js.map +1 -0
  2120. package/dist/esm/internal/layer.js +552 -0
  2121. package/dist/esm/internal/layer.js.map +1 -0
  2122. package/dist/esm/internal/logSpan.js +17 -0
  2123. package/dist/esm/internal/logSpan.js.map +1 -0
  2124. package/dist/esm/internal/logger-circular.js +19 -0
  2125. package/dist/esm/internal/logger-circular.js.map +1 -0
  2126. package/dist/esm/internal/logger.js +367 -0
  2127. package/dist/esm/internal/logger.js.map +1 -0
  2128. package/dist/esm/internal/mailbox.js +450 -0
  2129. package/dist/esm/internal/mailbox.js.map +1 -0
  2130. package/dist/esm/internal/managedRuntime/circular.js +4 -0
  2131. package/dist/esm/internal/managedRuntime/circular.js.map +1 -0
  2132. package/dist/esm/internal/managedRuntime.js +86 -0
  2133. package/dist/esm/internal/managedRuntime.js.map +1 -0
  2134. package/dist/esm/internal/matcher.js +291 -0
  2135. package/dist/esm/internal/matcher.js.map +1 -0
  2136. package/dist/esm/internal/metric/boundaries.js +42 -0
  2137. package/dist/esm/internal/metric/boundaries.js.map +1 -0
  2138. package/dist/esm/internal/metric/hook.js +375 -0
  2139. package/dist/esm/internal/metric/hook.js.map +1 -0
  2140. package/dist/esm/internal/metric/key.js +60 -0
  2141. package/dist/esm/internal/metric/key.js.map +1 -0
  2142. package/dist/esm/internal/metric/keyType.js +169 -0
  2143. package/dist/esm/internal/metric/keyType.js.map +1 -0
  2144. package/dist/esm/internal/metric/label.js +36 -0
  2145. package/dist/esm/internal/metric/label.js.map +1 -0
  2146. package/dist/esm/internal/metric/pair.js +32 -0
  2147. package/dist/esm/internal/metric/pair.js.map +1 -0
  2148. package/dist/esm/internal/metric/polling.js +69 -0
  2149. package/dist/esm/internal/metric/polling.js.map +1 -0
  2150. package/dist/esm/internal/metric/registry.js +105 -0
  2151. package/dist/esm/internal/metric/registry.js.map +1 -0
  2152. package/dist/esm/internal/metric/state.js +181 -0
  2153. package/dist/esm/internal/metric/state.js.map +1 -0
  2154. package/dist/esm/internal/metric.js +181 -0
  2155. package/dist/esm/internal/metric.js.map +1 -0
  2156. package/dist/esm/internal/opCodes/cause.js +13 -0
  2157. package/dist/esm/internal/opCodes/cause.js.map +1 -0
  2158. package/dist/esm/internal/opCodes/channel.js +29 -0
  2159. package/dist/esm/internal/opCodes/channel.js.map +1 -0
  2160. package/dist/esm/internal/opCodes/channelChildExecutorDecision.js +7 -0
  2161. package/dist/esm/internal/opCodes/channelChildExecutorDecision.js.map +1 -0
  2162. package/dist/esm/internal/opCodes/channelMergeDecision.js +5 -0
  2163. package/dist/esm/internal/opCodes/channelMergeDecision.js.map +1 -0
  2164. package/dist/esm/internal/opCodes/channelMergeState.js +7 -0
  2165. package/dist/esm/internal/opCodes/channelMergeState.js.map +1 -0
  2166. package/dist/esm/internal/opCodes/channelMergeStrategy.js +5 -0
  2167. package/dist/esm/internal/opCodes/channelMergeStrategy.js.map +1 -0
  2168. package/dist/esm/internal/opCodes/channelState.js +9 -0
  2169. package/dist/esm/internal/opCodes/channelState.js.map +1 -0
  2170. package/dist/esm/internal/opCodes/channelUpstreamPullRequest.js +5 -0
  2171. package/dist/esm/internal/opCodes/channelUpstreamPullRequest.js.map +1 -0
  2172. package/dist/esm/internal/opCodes/channelUpstreamPullStrategy.js +5 -0
  2173. package/dist/esm/internal/opCodes/channelUpstreamPullStrategy.js.map +1 -0
  2174. package/dist/esm/internal/opCodes/config.js +23 -0
  2175. package/dist/esm/internal/opCodes/config.js.map +1 -0
  2176. package/dist/esm/internal/opCodes/configError.js +13 -0
  2177. package/dist/esm/internal/opCodes/configError.js.map +1 -0
  2178. package/dist/esm/internal/opCodes/continuation.js +5 -0
  2179. package/dist/esm/internal/opCodes/continuation.js.map +1 -0
  2180. package/dist/esm/internal/opCodes/deferred.js +5 -0
  2181. package/dist/esm/internal/opCodes/deferred.js.map +1 -0
  2182. package/dist/esm/internal/opCodes/effect.js +31 -0
  2183. package/dist/esm/internal/opCodes/effect.js.map +1 -0
  2184. package/dist/esm/internal/opCodes/layer.js +21 -0
  2185. package/dist/esm/internal/opCodes/layer.js.map +1 -0
  2186. package/dist/esm/internal/opCodes/streamHaltStrategy.js +9 -0
  2187. package/dist/esm/internal/opCodes/streamHaltStrategy.js.map +1 -0
  2188. package/dist/esm/internal/option.js +70 -0
  2189. package/dist/esm/internal/option.js.map +1 -0
  2190. package/dist/esm/internal/pool.js +276 -0
  2191. package/dist/esm/internal/pool.js.map +1 -0
  2192. package/dist/esm/internal/pubsub.js +1263 -0
  2193. package/dist/esm/internal/pubsub.js.map +1 -0
  2194. package/dist/esm/internal/query.js +93 -0
  2195. package/dist/esm/internal/query.js.map +1 -0
  2196. package/dist/esm/internal/queue.js +486 -0
  2197. package/dist/esm/internal/queue.js.map +1 -0
  2198. package/dist/esm/internal/random.js +119 -0
  2199. package/dist/esm/internal/random.js.map +1 -0
  2200. package/dist/esm/internal/rateLimiter.js +43 -0
  2201. package/dist/esm/internal/rateLimiter.js.map +1 -0
  2202. package/dist/esm/internal/rcMap.js +173 -0
  2203. package/dist/esm/internal/rcMap.js.map +1 -0
  2204. package/dist/esm/internal/rcRef.js +129 -0
  2205. package/dist/esm/internal/rcRef.js.map +1 -0
  2206. package/dist/esm/internal/redBlackTree/iterator.js +191 -0
  2207. package/dist/esm/internal/redBlackTree/iterator.js.map +1 -0
  2208. package/dist/esm/internal/redBlackTree/node.js +50 -0
  2209. package/dist/esm/internal/redBlackTree/node.js.map +1 -0
  2210. package/dist/esm/internal/redBlackTree.js +1069 -0
  2211. package/dist/esm/internal/redBlackTree.js.map +1 -0
  2212. package/dist/esm/internal/redacted.js +56 -0
  2213. package/dist/esm/internal/redacted.js.map +1 -0
  2214. package/dist/esm/internal/ref.js +110 -0
  2215. package/dist/esm/internal/ref.js.map +1 -0
  2216. package/dist/esm/internal/reloadable.js +42 -0
  2217. package/dist/esm/internal/reloadable.js.map +1 -0
  2218. package/dist/esm/internal/request.js +91 -0
  2219. package/dist/esm/internal/request.js.map +1 -0
  2220. package/dist/esm/internal/resource.js +38 -0
  2221. package/dist/esm/internal/resource.js.map +1 -0
  2222. package/dist/esm/internal/ringBuffer.js +56 -0
  2223. package/dist/esm/internal/ringBuffer.js.map +1 -0
  2224. package/dist/esm/internal/runtime.js +307 -0
  2225. package/dist/esm/internal/runtime.js.map +1 -0
  2226. package/dist/esm/internal/runtimeFlags.js +107 -0
  2227. package/dist/esm/internal/runtimeFlags.js.map +1 -0
  2228. package/dist/esm/internal/runtimeFlagsPatch.js +38 -0
  2229. package/dist/esm/internal/runtimeFlagsPatch.js.map +1 -0
  2230. package/dist/esm/internal/schedule/decision.js +33 -0
  2231. package/dist/esm/internal/schedule/decision.js.map +1 -0
  2232. package/dist/esm/internal/schedule/interval.js +70 -0
  2233. package/dist/esm/internal/schedule/interval.js.map +1 -0
  2234. package/dist/esm/internal/schedule/intervals.js +122 -0
  2235. package/dist/esm/internal/schedule/intervals.js.map +1 -0
  2236. package/dist/esm/internal/schedule.js +832 -0
  2237. package/dist/esm/internal/schedule.js.map +1 -0
  2238. package/dist/esm/internal/schema/errors.js +86 -0
  2239. package/dist/esm/internal/schema/errors.js.map +1 -0
  2240. package/dist/esm/internal/schema/schemaId.js +43 -0
  2241. package/dist/esm/internal/schema/schemaId.js.map +1 -0
  2242. package/dist/esm/internal/schema/util.js +35 -0
  2243. package/dist/esm/internal/schema/util.js.map +1 -0
  2244. package/dist/esm/internal/scopedCache.js +382 -0
  2245. package/dist/esm/internal/scopedCache.js.map +1 -0
  2246. package/dist/esm/internal/scopedRef.js +43 -0
  2247. package/dist/esm/internal/scopedRef.js.map +1 -0
  2248. package/dist/esm/internal/secret.js +77 -0
  2249. package/dist/esm/internal/secret.js.map +1 -0
  2250. package/dist/esm/internal/singleShotGen.js +30 -0
  2251. package/dist/esm/internal/singleShotGen.js.map +1 -0
  2252. package/dist/esm/internal/sink.js +801 -0
  2253. package/dist/esm/internal/sink.js.map +1 -0
  2254. package/dist/esm/internal/stack.js +5 -0
  2255. package/dist/esm/internal/stack.js.map +1 -0
  2256. package/dist/esm/internal/stm/core.js +501 -0
  2257. package/dist/esm/internal/stm/core.js.map +1 -0
  2258. package/dist/esm/internal/stm/entry.js +42 -0
  2259. package/dist/esm/internal/stm/entry.js.map +1 -0
  2260. package/dist/esm/internal/stm/journal.js +89 -0
  2261. package/dist/esm/internal/stm/journal.js.map +1 -0
  2262. package/dist/esm/internal/stm/opCodes/stm.js +25 -0
  2263. package/dist/esm/internal/stm/opCodes/stm.js.map +1 -0
  2264. package/dist/esm/internal/stm/opCodes/stmState.js +7 -0
  2265. package/dist/esm/internal/stm/opCodes/stmState.js.map +1 -0
  2266. package/dist/esm/internal/stm/opCodes/strategy.js +7 -0
  2267. package/dist/esm/internal/stm/opCodes/strategy.js.map +1 -0
  2268. package/dist/esm/internal/stm/opCodes/tExit.js +11 -0
  2269. package/dist/esm/internal/stm/opCodes/tExit.js.map +1 -0
  2270. package/dist/esm/internal/stm/opCodes/tryCommit.js +5 -0
  2271. package/dist/esm/internal/stm/opCodes/tryCommit.js.map +1 -0
  2272. package/dist/esm/internal/stm/stm.js +478 -0
  2273. package/dist/esm/internal/stm/stm.js.map +1 -0
  2274. package/dist/esm/internal/stm/stmState.js +89 -0
  2275. package/dist/esm/internal/stm/stmState.js.map +1 -0
  2276. package/dist/esm/internal/stm/tArray.js +243 -0
  2277. package/dist/esm/internal/stm/tArray.js.map +1 -0
  2278. package/dist/esm/internal/stm/tDeferred.js +41 -0
  2279. package/dist/esm/internal/stm/tDeferred.js.map +1 -0
  2280. package/dist/esm/internal/stm/tExit.js +101 -0
  2281. package/dist/esm/internal/stm/tExit.js.map +1 -0
  2282. package/dist/esm/internal/stm/tMap.js +430 -0
  2283. package/dist/esm/internal/stm/tMap.js.map +1 -0
  2284. package/dist/esm/internal/stm/tPriorityQueue.js +143 -0
  2285. package/dist/esm/internal/stm/tPriorityQueue.js.map +1 -0
  2286. package/dist/esm/internal/stm/tPubSub.js +376 -0
  2287. package/dist/esm/internal/stm/tPubSub.js.map +1 -0
  2288. package/dist/esm/internal/stm/tQueue.js +258 -0
  2289. package/dist/esm/internal/stm/tQueue.js.map +1 -0
  2290. package/dist/esm/internal/stm/tRandom.js +82 -0
  2291. package/dist/esm/internal/stm/tRandom.js.map +1 -0
  2292. package/dist/esm/internal/stm/tReentrantLock.js +192 -0
  2293. package/dist/esm/internal/stm/tReentrantLock.js.map +1 -0
  2294. package/dist/esm/internal/stm/tRef.js +100 -0
  2295. package/dist/esm/internal/stm/tRef.js.map +1 -0
  2296. package/dist/esm/internal/stm/tSemaphore.js +59 -0
  2297. package/dist/esm/internal/stm/tSemaphore.js.map +1 -0
  2298. package/dist/esm/internal/stm/tSet.js +88 -0
  2299. package/dist/esm/internal/stm/tSet.js.map +1 -0
  2300. package/dist/esm/internal/stm/tSubscriptionRef.js +166 -0
  2301. package/dist/esm/internal/stm/tSubscriptionRef.js.map +1 -0
  2302. package/dist/esm/internal/stm/tryCommit.js +16 -0
  2303. package/dist/esm/internal/stm/tryCommit.js.map +1 -0
  2304. package/dist/esm/internal/stm/txnId.js +11 -0
  2305. package/dist/esm/internal/stm/txnId.js.map +1 -0
  2306. package/dist/esm/internal/stm/versioned.js +8 -0
  2307. package/dist/esm/internal/stm/versioned.js.map +1 -0
  2308. package/dist/esm/internal/stream/debounceState.js +21 -0
  2309. package/dist/esm/internal/stream/debounceState.js.map +1 -0
  2310. package/dist/esm/internal/stream/emit.js +120 -0
  2311. package/dist/esm/internal/stream/emit.js.map +1 -0
  2312. package/dist/esm/internal/stream/haltStrategy.js +63 -0
  2313. package/dist/esm/internal/stream/haltStrategy.js.map +1 -0
  2314. package/dist/esm/internal/stream/handoff.js +55 -0
  2315. package/dist/esm/internal/stream/handoff.js.map +1 -0
  2316. package/dist/esm/internal/stream/handoffSignal.js +22 -0
  2317. package/dist/esm/internal/stream/handoffSignal.js.map +1 -0
  2318. package/dist/esm/internal/stream/pull.js +20 -0
  2319. package/dist/esm/internal/stream/pull.js.map +1 -0
  2320. package/dist/esm/internal/stream/sinkEndReason.js +13 -0
  2321. package/dist/esm/internal/stream/sinkEndReason.js.map +1 -0
  2322. package/dist/esm/internal/stream/zipAllState.js +33 -0
  2323. package/dist/esm/internal/stream/zipAllState.js.map +1 -0
  2324. package/dist/esm/internal/stream/zipChunksState.js +21 -0
  2325. package/dist/esm/internal/stream/zipChunksState.js.map +1 -0
  2326. package/dist/esm/internal/stream.js +2867 -0
  2327. package/dist/esm/internal/stream.js.map +1 -0
  2328. package/dist/esm/internal/string-utils.js +77 -0
  2329. package/dist/esm/internal/string-utils.js.map +1 -0
  2330. package/dist/esm/internal/subscriptionRef.js +63 -0
  2331. package/dist/esm/internal/subscriptionRef.js.map +1 -0
  2332. package/dist/esm/internal/supervisor/patch.js +125 -0
  2333. package/dist/esm/internal/supervisor/patch.js.map +1 -0
  2334. package/dist/esm/internal/supervisor.js +207 -0
  2335. package/dist/esm/internal/supervisor.js.map +1 -0
  2336. package/dist/esm/internal/synchronizedRef.js +44 -0
  2337. package/dist/esm/internal/synchronizedRef.js.map +1 -0
  2338. package/dist/esm/internal/take.js +108 -0
  2339. package/dist/esm/internal/take.js.map +1 -0
  2340. package/dist/esm/internal/testing/sleep.js +7 -0
  2341. package/dist/esm/internal/testing/sleep.js.map +1 -0
  2342. package/dist/esm/internal/testing/suspendedWarningData.js +48 -0
  2343. package/dist/esm/internal/testing/suspendedWarningData.js.map +1 -0
  2344. package/dist/esm/internal/testing/warningData.js +49 -0
  2345. package/dist/esm/internal/testing/warningData.js.map +1 -0
  2346. package/dist/esm/internal/tracer.js +122 -0
  2347. package/dist/esm/internal/tracer.js.map +1 -0
  2348. package/dist/esm/internal/trie.js +547 -0
  2349. package/dist/esm/internal/trie.js.map +1 -0
  2350. package/dist/esm/internal/version.js +6 -0
  2351. package/dist/esm/internal/version.js.map +1 -0
  2352. package/dist/esm/package.json +4 -0
  2353. package/index/package.json +6 -0
  2354. package/package.json +1471 -0
  2355. package/src/Arbitrary.ts +1101 -0
  2356. package/src/Array.ts +6854 -0
  2357. package/src/BigDecimal.ts +2037 -0
  2358. package/src/BigInt.ts +1139 -0
  2359. package/src/Boolean.ts +560 -0
  2360. package/src/Brand.ts +360 -0
  2361. package/src/Cache.ts +281 -0
  2362. package/src/Cause.ts +2049 -0
  2363. package/src/Channel.ts +3051 -0
  2364. package/src/ChildExecutorDecision.ts +158 -0
  2365. package/src/Chunk.ts +2350 -0
  2366. package/src/Clock.ts +111 -0
  2367. package/src/Config.ts +743 -0
  2368. package/src/ConfigError.ts +286 -0
  2369. package/src/ConfigProvider.ts +421 -0
  2370. package/src/ConfigProviderPathPatch.ts +132 -0
  2371. package/src/Console.ts +255 -0
  2372. package/src/Context.ts +867 -0
  2373. package/src/Cron.ts +718 -0
  2374. package/src/Data.ts +765 -0
  2375. package/src/DateTime.ts +2715 -0
  2376. package/src/DefaultServices.ts +34 -0
  2377. package/src/Deferred.ts +471 -0
  2378. package/src/Differ.ts +512 -0
  2379. package/src/Duration.ts +1140 -0
  2380. package/src/Effect.ts +29096 -0
  2381. package/src/Effectable.ts +107 -0
  2382. package/src/Either.ts +1723 -0
  2383. package/src/Encoding.ts +195 -0
  2384. package/src/Equal.ts +98 -0
  2385. package/src/Equivalence.ts +259 -0
  2386. package/src/ExecutionPlan.ts +308 -0
  2387. package/src/ExecutionStrategy.ts +138 -0
  2388. package/src/Exit.ts +717 -0
  2389. package/src/FastCheck.ts +9 -0
  2390. package/src/Fiber.ts +926 -0
  2391. package/src/FiberHandle.ts +582 -0
  2392. package/src/FiberId.ts +219 -0
  2393. package/src/FiberMap.ts +779 -0
  2394. package/src/FiberRef.ts +511 -0
  2395. package/src/FiberRefs.ts +288 -0
  2396. package/src/FiberRefsPatch.ts +139 -0
  2397. package/src/FiberSet.ts +529 -0
  2398. package/src/FiberStatus.ts +108 -0
  2399. package/src/Function.ts +1378 -0
  2400. package/src/GlobalValue.ts +53 -0
  2401. package/src/Graph.ts +3764 -0
  2402. package/src/GroupBy.ts +141 -0
  2403. package/src/HKT.ts +45 -0
  2404. package/src/Hash.ts +203 -0
  2405. package/src/HashMap.ts +919 -0
  2406. package/src/HashRing.ts +387 -0
  2407. package/src/HashSet.ts +2346 -0
  2408. package/src/Inspectable.ts +287 -0
  2409. package/src/Iterable.ts +1606 -0
  2410. package/src/JSONSchema.ts +1044 -0
  2411. package/src/KeyedPool.ts +201 -0
  2412. package/src/Layer.ts +1671 -0
  2413. package/src/LayerMap.ts +436 -0
  2414. package/src/List.ts +1469 -0
  2415. package/src/LogLevel.ts +387 -0
  2416. package/src/LogSpan.ts +25 -0
  2417. package/src/Logger.ts +863 -0
  2418. package/src/Mailbox.ts +298 -0
  2419. package/src/ManagedRuntime.ts +180 -0
  2420. package/src/Match.ts +1493 -0
  2421. package/src/MergeDecision.ts +103 -0
  2422. package/src/MergeState.ts +180 -0
  2423. package/src/MergeStrategy.ts +124 -0
  2424. package/src/Metric.ts +1165 -0
  2425. package/src/MetricBoundaries.ts +69 -0
  2426. package/src/MetricHook.ts +175 -0
  2427. package/src/MetricKey.ts +266 -0
  2428. package/src/MetricKeyType.ts +262 -0
  2429. package/src/MetricLabel.ts +47 -0
  2430. package/src/MetricPair.ts +71 -0
  2431. package/src/MetricPolling.ts +182 -0
  2432. package/src/MetricRegistry.ts +48 -0
  2433. package/src/MetricState.ts +273 -0
  2434. package/src/Micro.ts +5556 -0
  2435. package/src/ModuleVersion.ts +18 -0
  2436. package/src/MutableHashMap.ts +518 -0
  2437. package/src/MutableHashSet.ts +706 -0
  2438. package/src/MutableList.ts +333 -0
  2439. package/src/MutableQueue.ts +289 -0
  2440. package/src/MutableRef.ts +258 -0
  2441. package/src/NonEmptyIterable.ts +32 -0
  2442. package/src/Number.ts +1440 -0
  2443. package/src/Option.ts +4028 -0
  2444. package/src/Order.ts +397 -0
  2445. package/src/Ordering.ts +173 -0
  2446. package/src/ParseResult.ts +2068 -0
  2447. package/src/PartitionedSemaphore.ts +200 -0
  2448. package/src/Pipeable.ts +574 -0
  2449. package/src/Pool.ts +220 -0
  2450. package/src/Predicate.ts +2344 -0
  2451. package/src/Pretty.ts +205 -0
  2452. package/src/PrimaryKey.ts +23 -0
  2453. package/src/PubSub.ts +210 -0
  2454. package/src/Queue.ts +748 -0
  2455. package/src/Random.ts +204 -0
  2456. package/src/RateLimiter.ts +138 -0
  2457. package/src/RcMap.ts +245 -0
  2458. package/src/RcRef.ts +122 -0
  2459. package/src/Readable.ts +104 -0
  2460. package/src/Record.ts +1990 -0
  2461. package/src/RedBlackTree.ts +725 -0
  2462. package/src/Redacted.ts +144 -0
  2463. package/src/Ref.ts +268 -0
  2464. package/src/RegExp.ts +38 -0
  2465. package/src/Reloadable.ts +127 -0
  2466. package/src/Request.ts +418 -0
  2467. package/src/RequestBlock.ts +118 -0
  2468. package/src/RequestResolver.ts +495 -0
  2469. package/src/Resource.ts +119 -0
  2470. package/src/Runtime.ts +631 -0
  2471. package/src/RuntimeFlags.ts +436 -0
  2472. package/src/RuntimeFlagsPatch.ts +295 -0
  2473. package/src/STM.ts +3091 -0
  2474. package/src/Schedule.ts +3740 -0
  2475. package/src/ScheduleDecision.ts +62 -0
  2476. package/src/ScheduleInterval.ts +219 -0
  2477. package/src/ScheduleIntervals.ts +172 -0
  2478. package/src/Scheduler.ts +364 -0
  2479. package/src/Schema.ts +11443 -0
  2480. package/src/SchemaAST.ts +3055 -0
  2481. package/src/Scope.ts +240 -0
  2482. package/src/ScopedCache.ts +151 -0
  2483. package/src/ScopedRef.ts +139 -0
  2484. package/src/Secret.ts +88 -0
  2485. package/src/SingleProducerAsyncInput.ts +67 -0
  2486. package/src/Sink.ts +1877 -0
  2487. package/src/SortedMap.ts +361 -0
  2488. package/src/SortedSet.ts +530 -0
  2489. package/src/Stream.ts +11561 -0
  2490. package/src/StreamEmit.ts +136 -0
  2491. package/src/StreamHaltStrategy.ts +140 -0
  2492. package/src/Streamable.ts +45 -0
  2493. package/src/String.ts +1026 -0
  2494. package/src/Struct.ts +335 -0
  2495. package/src/Subscribable.ts +114 -0
  2496. package/src/SubscriptionRef.ts +444 -0
  2497. package/src/Supervisor.ts +240 -0
  2498. package/src/Symbol.ts +29 -0
  2499. package/src/SynchronizedRef.ts +429 -0
  2500. package/src/TArray.ts +922 -0
  2501. package/src/TDeferred.ts +124 -0
  2502. package/src/TMap.ts +875 -0
  2503. package/src/TPriorityQueue.ts +283 -0
  2504. package/src/TPubSub.ts +228 -0
  2505. package/src/TQueue.ts +540 -0
  2506. package/src/TRandom.ts +129 -0
  2507. package/src/TReentrantLock.ts +260 -0
  2508. package/src/TRef.ts +266 -0
  2509. package/src/TSemaphore.ts +169 -0
  2510. package/src/TSet.ts +633 -0
  2511. package/src/TSubscriptionRef.ts +284 -0
  2512. package/src/Take.ts +309 -0
  2513. package/src/TestAnnotation.ts +158 -0
  2514. package/src/TestAnnotationMap.ts +163 -0
  2515. package/src/TestAnnotations.ts +117 -0
  2516. package/src/TestClock.ts +562 -0
  2517. package/src/TestConfig.ts +47 -0
  2518. package/src/TestContext.ts +36 -0
  2519. package/src/TestLive.ts +53 -0
  2520. package/src/TestServices.ts +454 -0
  2521. package/src/TestSized.ts +55 -0
  2522. package/src/Tracer.ts +182 -0
  2523. package/src/Trie.ts +1860 -0
  2524. package/src/Tuple.ts +483 -0
  2525. package/src/Types.ts +361 -0
  2526. package/src/Unify.ts +127 -0
  2527. package/src/UpstreamPullRequest.ts +129 -0
  2528. package/src/UpstreamPullStrategy.ts +133 -0
  2529. package/src/Utils.ts +809 -0
  2530. package/src/index.ts +1561 -0
  2531. package/src/internal/array.ts +8 -0
  2532. package/src/internal/blockedRequests.ts +520 -0
  2533. package/src/internal/cache.ts +733 -0
  2534. package/src/internal/cause.ts +1050 -0
  2535. package/src/internal/channel/channelExecutor.ts +1200 -0
  2536. package/src/internal/channel/channelState.ts +134 -0
  2537. package/src/internal/channel/childExecutorDecision.ts +96 -0
  2538. package/src/internal/channel/continuation.ts +200 -0
  2539. package/src/internal/channel/mergeDecision.ts +113 -0
  2540. package/src/internal/channel/mergeState.ts +120 -0
  2541. package/src/internal/channel/mergeStrategy.ts +72 -0
  2542. package/src/internal/channel/singleProducerAsyncInput.ts +259 -0
  2543. package/src/internal/channel/subexecutor.ts +229 -0
  2544. package/src/internal/channel/upstreamPullRequest.ts +84 -0
  2545. package/src/internal/channel/upstreamPullStrategy.ts +87 -0
  2546. package/src/internal/channel.ts +2603 -0
  2547. package/src/internal/clock.ts +95 -0
  2548. package/src/internal/completedRequestMap.ts +9 -0
  2549. package/src/internal/concurrency.ts +54 -0
  2550. package/src/internal/config.ts +716 -0
  2551. package/src/internal/configError.ts +304 -0
  2552. package/src/internal/configProvider/pathPatch.ts +97 -0
  2553. package/src/internal/configProvider.ts +799 -0
  2554. package/src/internal/console.ts +153 -0
  2555. package/src/internal/context.ts +337 -0
  2556. package/src/internal/core-effect.ts +2293 -0
  2557. package/src/internal/core-stream.ts +998 -0
  2558. package/src/internal/core.ts +3166 -0
  2559. package/src/internal/data.ts +36 -0
  2560. package/src/internal/dataSource.ts +327 -0
  2561. package/src/internal/dateTime.ts +1277 -0
  2562. package/src/internal/defaultServices/console.ts +100 -0
  2563. package/src/internal/defaultServices.ts +163 -0
  2564. package/src/internal/deferred.ts +46 -0
  2565. package/src/internal/differ/chunkPatch.ts +211 -0
  2566. package/src/internal/differ/contextPatch.ts +232 -0
  2567. package/src/internal/differ/hashMapPatch.ts +220 -0
  2568. package/src/internal/differ/hashSetPatch.ts +176 -0
  2569. package/src/internal/differ/orPatch.ts +311 -0
  2570. package/src/internal/differ/readonlyArrayPatch.ts +210 -0
  2571. package/src/internal/differ.ts +200 -0
  2572. package/src/internal/doNotation.ts +80 -0
  2573. package/src/internal/effect/circular.ts +903 -0
  2574. package/src/internal/effectable.ts +131 -0
  2575. package/src/internal/either.ts +110 -0
  2576. package/src/internal/encoding/base64.ts +286 -0
  2577. package/src/internal/encoding/base64Url.ts +29 -0
  2578. package/src/internal/encoding/common.ts +51 -0
  2579. package/src/internal/encoding/hex.ts +315 -0
  2580. package/src/internal/errors.ts +7 -0
  2581. package/src/internal/executionPlan.ts +114 -0
  2582. package/src/internal/executionStrategy.ts +74 -0
  2583. package/src/internal/fiber.ts +388 -0
  2584. package/src/internal/fiberId.ts +267 -0
  2585. package/src/internal/fiberMessage.ts +82 -0
  2586. package/src/internal/fiberRefs/patch.ts +144 -0
  2587. package/src/internal/fiberRefs.ts +297 -0
  2588. package/src/internal/fiberRuntime.ts +3859 -0
  2589. package/src/internal/fiberScope.ts +71 -0
  2590. package/src/internal/fiberStatus.ts +119 -0
  2591. package/src/internal/groupBy.ts +530 -0
  2592. package/src/internal/hashMap/array.ts +49 -0
  2593. package/src/internal/hashMap/bitwise.ts +32 -0
  2594. package/src/internal/hashMap/config.ts +14 -0
  2595. package/src/internal/hashMap/keySet.ts +8 -0
  2596. package/src/internal/hashMap/node.ts +391 -0
  2597. package/src/internal/hashMap.ts +586 -0
  2598. package/src/internal/hashSet.ts +323 -0
  2599. package/src/internal/keyedPool.ts +244 -0
  2600. package/src/internal/layer/circular.ts +214 -0
  2601. package/src/internal/layer.ts +1483 -0
  2602. package/src/internal/logSpan.ts +20 -0
  2603. package/src/internal/logger-circular.ts +24 -0
  2604. package/src/internal/logger.ts +485 -0
  2605. package/src/internal/mailbox.ts +561 -0
  2606. package/src/internal/managedRuntime/circular.ts +6 -0
  2607. package/src/internal/managedRuntime.ts +137 -0
  2608. package/src/internal/matcher.ts +652 -0
  2609. package/src/internal/metric/boundaries.ts +75 -0
  2610. package/src/internal/metric/hook.ts +483 -0
  2611. package/src/internal/metric/key.ts +167 -0
  2612. package/src/internal/metric/keyType.ts +238 -0
  2613. package/src/internal/metric/label.ts +41 -0
  2614. package/src/internal/metric/pair.ts +48 -0
  2615. package/src/internal/metric/polling.ts +149 -0
  2616. package/src/internal/metric/registry.ts +187 -0
  2617. package/src/internal/metric/state.ts +290 -0
  2618. package/src/internal/metric.ts +577 -0
  2619. package/src/internal/opCodes/cause.ts +35 -0
  2620. package/src/internal/opCodes/channel.ts +83 -0
  2621. package/src/internal/opCodes/channelChildExecutorDecision.ts +17 -0
  2622. package/src/internal/opCodes/channelMergeDecision.ts +11 -0
  2623. package/src/internal/opCodes/channelMergeState.ts +17 -0
  2624. package/src/internal/opCodes/channelMergeStrategy.ts +11 -0
  2625. package/src/internal/opCodes/channelState.ts +23 -0
  2626. package/src/internal/opCodes/channelUpstreamPullRequest.ts +11 -0
  2627. package/src/internal/opCodes/channelUpstreamPullStrategy.ts +11 -0
  2628. package/src/internal/opCodes/config.ts +65 -0
  2629. package/src/internal/opCodes/configError.ts +35 -0
  2630. package/src/internal/opCodes/continuation.ts +11 -0
  2631. package/src/internal/opCodes/deferred.ts +11 -0
  2632. package/src/internal/opCodes/effect.ts +89 -0
  2633. package/src/internal/opCodes/layer.ts +59 -0
  2634. package/src/internal/opCodes/streamHaltStrategy.ts +23 -0
  2635. package/src/internal/option.ts +80 -0
  2636. package/src/internal/pool.ts +432 -0
  2637. package/src/internal/pubsub.ts +1762 -0
  2638. package/src/internal/query.ts +204 -0
  2639. package/src/internal/queue.ts +766 -0
  2640. package/src/internal/random.ts +161 -0
  2641. package/src/internal/rateLimiter.ts +93 -0
  2642. package/src/internal/rcMap.ts +285 -0
  2643. package/src/internal/rcRef.ts +192 -0
  2644. package/src/internal/redBlackTree/iterator.ts +200 -0
  2645. package/src/internal/redBlackTree/node.ts +68 -0
  2646. package/src/internal/redBlackTree.ts +1245 -0
  2647. package/src/internal/redacted.ts +73 -0
  2648. package/src/internal/ref.ts +171 -0
  2649. package/src/internal/reloadable.ts +140 -0
  2650. package/src/internal/request.ts +177 -0
  2651. package/src/internal/resource.ts +76 -0
  2652. package/src/internal/ringBuffer.ts +68 -0
  2653. package/src/internal/runtime.ts +558 -0
  2654. package/src/internal/runtimeFlags.ts +178 -0
  2655. package/src/internal/runtimeFlagsPatch.ts +103 -0
  2656. package/src/internal/schedule/decision.ts +47 -0
  2657. package/src/internal/schedule/interval.ts +101 -0
  2658. package/src/internal/schedule/intervals.ts +180 -0
  2659. package/src/internal/schedule.ts +2199 -0
  2660. package/src/internal/schema/errors.ts +191 -0
  2661. package/src/internal/schema/schemaId.ts +106 -0
  2662. package/src/internal/schema/util.ts +50 -0
  2663. package/src/internal/scopedCache.ts +644 -0
  2664. package/src/internal/scopedRef.ts +118 -0
  2665. package/src/internal/secret.ts +89 -0
  2666. package/src/internal/singleShotGen.ts +35 -0
  2667. package/src/internal/sink.ts +2120 -0
  2668. package/src/internal/stack.ts +10 -0
  2669. package/src/internal/stm/core.ts +817 -0
  2670. package/src/internal/stm/entry.ts +59 -0
  2671. package/src/internal/stm/journal.ts +123 -0
  2672. package/src/internal/stm/opCodes/stm.ts +71 -0
  2673. package/src/internal/stm/opCodes/stmState.ts +17 -0
  2674. package/src/internal/stm/opCodes/strategy.ts +17 -0
  2675. package/src/internal/stm/opCodes/tExit.ts +29 -0
  2676. package/src/internal/stm/opCodes/tryCommit.ts +11 -0
  2677. package/src/internal/stm/stm.ts +1453 -0
  2678. package/src/internal/stm/stmState.ts +136 -0
  2679. package/src/internal/stm/tArray.ts +550 -0
  2680. package/src/internal/stm/tDeferred.ts +81 -0
  2681. package/src/internal/stm/tExit.ts +190 -0
  2682. package/src/internal/stm/tMap.ts +824 -0
  2683. package/src/internal/stm/tPriorityQueue.ts +267 -0
  2684. package/src/internal/stm/tPubSub.ts +551 -0
  2685. package/src/internal/stm/tQueue.ts +393 -0
  2686. package/src/internal/stm/tRandom.ts +140 -0
  2687. package/src/internal/stm/tReentrantLock.ts +352 -0
  2688. package/src/internal/stm/tRef.ts +195 -0
  2689. package/src/internal/stm/tSemaphore.ts +113 -0
  2690. package/src/internal/stm/tSet.ts +259 -0
  2691. package/src/internal/stm/tSubscriptionRef.ts +286 -0
  2692. package/src/internal/stm/tryCommit.ts +34 -0
  2693. package/src/internal/stm/txnId.ts +14 -0
  2694. package/src/internal/stm/versioned.ts +4 -0
  2695. package/src/internal/stream/debounceState.ts +57 -0
  2696. package/src/internal/stream/emit.ts +123 -0
  2697. package/src/internal/stream/haltStrategy.ts +94 -0
  2698. package/src/internal/stream/handoff.ts +187 -0
  2699. package/src/internal/stream/handoffSignal.ts +59 -0
  2700. package/src/internal/stream/pull.ts +34 -0
  2701. package/src/internal/stream/sinkEndReason.ts +30 -0
  2702. package/src/internal/stream/zipAllState.ts +88 -0
  2703. package/src/internal/stream/zipChunksState.ts +56 -0
  2704. package/src/internal/stream.ts +8802 -0
  2705. package/src/internal/string-utils.ts +107 -0
  2706. package/src/internal/subscriptionRef.ts +138 -0
  2707. package/src/internal/supervisor/patch.ts +190 -0
  2708. package/src/internal/supervisor.ts +303 -0
  2709. package/src/internal/synchronizedRef.ts +114 -0
  2710. package/src/internal/take.ts +199 -0
  2711. package/src/internal/testing/sleep.ts +27 -0
  2712. package/src/internal/testing/suspendedWarningData.ts +85 -0
  2713. package/src/internal/testing/warningData.ts +94 -0
  2714. package/src/internal/tracer.ts +150 -0
  2715. package/src/internal/trie.ts +722 -0
  2716. package/src/internal/version.ts +7 -0
package/src/Option.ts ADDED
@@ -0,0 +1,4028 @@
1
+ /**
2
+ * @since 2.0.0
3
+ */
4
+ import type { Either } from "./Either.js"
5
+ import * as Equal from "./Equal.js"
6
+ import * as Equivalence from "./Equivalence.js"
7
+ import type { LazyArg } from "./Function.js"
8
+ import { constNull, constUndefined, dual, identity, isFunction } from "./Function.js"
9
+ import type { TypeLambda } from "./HKT.js"
10
+ import type { Inspectable } from "./Inspectable.js"
11
+ import * as doNotation from "./internal/doNotation.js"
12
+ import * as either from "./internal/either.js"
13
+ import * as option from "./internal/option.js"
14
+ import type { Order } from "./Order.js"
15
+ import * as order from "./Order.js"
16
+ import type { Pipeable } from "./Pipeable.js"
17
+ import type { Predicate, Refinement } from "./Predicate.js"
18
+ import type { Covariant, NoInfer, NotFunction } from "./Types.js"
19
+ import type * as Unify from "./Unify.js"
20
+ import * as Gen from "./Utils.js"
21
+
22
+ /**
23
+ * The `Option` data type represents optional values. An `Option<A>` can either
24
+ * be `Some<A>`, containing a value of type `A`, or `None`, representing the
25
+ * absence of a value.
26
+ *
27
+ * **When to Use**
28
+ *
29
+ * You can use `Option` in scenarios like:
30
+ *
31
+ * - Using it for initial values
32
+ * - Returning values from functions that are not defined for all possible
33
+ * inputs (referred to as “partial functions”)
34
+ * - Managing optional fields in data structures
35
+ * - Handling optional function arguments
36
+ *
37
+ * @category Models
38
+ * @since 2.0.0
39
+ */
40
+ export type Option<A> = None<A> | Some<A>
41
+
42
+ /**
43
+ * @category Symbols
44
+ * @since 2.0.0
45
+ */
46
+ export const TypeId: unique symbol = Symbol.for("effect/Option")
47
+
48
+ /**
49
+ * @category Symbols
50
+ * @since 2.0.0
51
+ */
52
+ export type TypeId = typeof TypeId
53
+
54
+ /**
55
+ * @category Models
56
+ * @since 2.0.0
57
+ */
58
+ export interface None<out A> extends Pipeable, Inspectable {
59
+ readonly _tag: "None"
60
+ readonly _op: "None"
61
+ readonly [TypeId]: {
62
+ readonly _A: Covariant<A>
63
+ }
64
+ [Unify.typeSymbol]?: unknown
65
+ [Unify.unifySymbol]?: OptionUnify<this>
66
+ [Unify.ignoreSymbol]?: OptionUnifyIgnore
67
+ }
68
+
69
+ /**
70
+ * @category Models
71
+ * @since 2.0.0
72
+ */
73
+ export interface Some<out A> extends Pipeable, Inspectable {
74
+ readonly _tag: "Some"
75
+ readonly _op: "Some"
76
+ readonly value: A
77
+ readonly [TypeId]: {
78
+ readonly _A: Covariant<A>
79
+ }
80
+ [Unify.typeSymbol]?: unknown
81
+ [Unify.unifySymbol]?: OptionUnify<this>
82
+ [Unify.ignoreSymbol]?: OptionUnifyIgnore
83
+ }
84
+
85
+ /**
86
+ * @category Models
87
+ * @since 2.0.0
88
+ */
89
+ export interface OptionUnify<A extends { [Unify.typeSymbol]?: any }> {
90
+ Option?: () => A[Unify.typeSymbol] extends Option<infer A0> | infer _ ? Option<A0> : never
91
+ }
92
+
93
+ /**
94
+ * @since 2.0.0
95
+ */
96
+ export declare namespace Option {
97
+ /**
98
+ * Extracts the type of the value contained in an `Option`.
99
+ *
100
+ * **Example** (Getting the Value Type of an Option)
101
+ *
102
+ * ```ts
103
+ * import { Option } from "effect"
104
+ *
105
+ * // Declare an Option holding a string
106
+ * declare const myOption: Option.Option<string>
107
+ *
108
+ * // Extract the type of the value within the Option
109
+ * //
110
+ * // ┌─── string
111
+ * // ▼
112
+ * type MyType = Option.Option.Value<typeof myOption>
113
+ * ```
114
+ *
115
+ * @since 2.0.0
116
+ * @category Type-level Utils
117
+ */
118
+ export type Value<T extends Option<any>> = [T] extends [Option<infer _A>] ? _A : never
119
+ }
120
+
121
+ /**
122
+ * @category Models
123
+ * @since 2.0.0
124
+ */
125
+ export interface OptionUnifyIgnore {}
126
+
127
+ /**
128
+ * @category Type Lambdas
129
+ * @since 2.0.0
130
+ */
131
+ export interface OptionTypeLambda extends TypeLambda {
132
+ readonly type: Option<this["Target"]>
133
+ }
134
+
135
+ /**
136
+ * Represents the absence of a value by creating an empty `Option`.
137
+ *
138
+ * `Option.none` returns an `Option<never>`, which is a subtype of `Option<A>`.
139
+ * This means you can use it in place of any `Option<A>` regardless of the type
140
+ * `A`.
141
+ *
142
+ * **Example** (Creating an Option with No Value)
143
+ *
144
+ * ```ts
145
+ * import { Option } from "effect"
146
+ *
147
+ * // An Option holding no value
148
+ * //
149
+ * // ┌─── Option<never>
150
+ * // ▼
151
+ * const noValue = Option.none()
152
+ *
153
+ * console.log(noValue)
154
+ * // Output: { _id: 'Option', _tag: 'None' }
155
+ * ```
156
+ *
157
+ * @see {@link some} for the opposite operation.
158
+ *
159
+ * @category Constructors
160
+ * @since 2.0.0
161
+ */
162
+ export const none = <A = never>(): Option<A> => option.none
163
+
164
+ /**
165
+ * Wraps the given value into an `Option` to represent its presence.
166
+ *
167
+ * **Example** (Creating an Option with a Value)
168
+ *
169
+ * ```ts
170
+ * import { Option } from "effect"
171
+ *
172
+ * // An Option holding the number 1
173
+ * //
174
+ * // ┌─── Option<number>
175
+ * // ▼
176
+ * const value = Option.some(1)
177
+ *
178
+ * console.log(value)
179
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
180
+ * ```
181
+ *
182
+ * @see {@link none} for the opposite operation.
183
+ *
184
+ * @category Constructors
185
+ * @since 2.0.0
186
+ */
187
+ export const some: <A>(value: A) => Option<A> = option.some
188
+
189
+ /**
190
+ * Determines whether the given value is an `Option`.
191
+ *
192
+ * **Details**
193
+ *
194
+ * This function checks if a value is an instance of `Option`. It returns `true`
195
+ * if the value is either `Option.some` or `Option.none`, and `false` otherwise.
196
+ * This is particularly useful when working with unknown values or when you need
197
+ * to ensure type safety in your code.
198
+ *
199
+ * @example
200
+ * ```ts
201
+ * import { Option } from "effect"
202
+ *
203
+ * console.log(Option.isOption(Option.some(1)))
204
+ * // Output: true
205
+ *
206
+ * console.log(Option.isOption(Option.none()))
207
+ * // Output: true
208
+ *
209
+ * console.log(Option.isOption({}))
210
+ * // Output: false
211
+ * ```
212
+ *
213
+ * @category Guards
214
+ * @since 2.0.0
215
+ */
216
+ export const isOption: (input: unknown) => input is Option<unknown> = option.isOption
217
+
218
+ /**
219
+ * Checks whether an `Option` represents the absence of a value (`None`).
220
+ *
221
+ * @example
222
+ * ```ts
223
+ * import { Option } from "effect"
224
+ *
225
+ * console.log(Option.isNone(Option.some(1)))
226
+ * // Output: false
227
+ *
228
+ * console.log(Option.isNone(Option.none()))
229
+ * // Output: true
230
+ * ```
231
+ *
232
+ * @see {@link isSome} for the opposite check.
233
+ *
234
+ * @category Guards
235
+ * @since 2.0.0
236
+ */
237
+ export const isNone: <A>(self: Option<A>) => self is None<A> = option.isNone
238
+
239
+ /**
240
+ * Checks whether an `Option` contains a value (`Some`).
241
+ *
242
+ * @example
243
+ * ```ts
244
+ * import { Option } from "effect"
245
+ *
246
+ * console.log(Option.isSome(Option.some(1)))
247
+ * // Output: true
248
+ *
249
+ * console.log(Option.isSome(Option.none()))
250
+ * // Output: false
251
+ * ```
252
+ *
253
+ * @see {@link isNone} for the opposite check.
254
+ *
255
+ * @category Guards
256
+ * @since 2.0.0
257
+ */
258
+ export const isSome: <A>(self: Option<A>) => self is Some<A> = option.isSome
259
+
260
+ /**
261
+ * Performs pattern matching on an `Option` to handle both `Some` and `None`
262
+ * cases.
263
+ *
264
+ * **Details**
265
+ *
266
+ * This function allows you to match against an `Option` and handle both
267
+ * scenarios: when the `Option` is `None` (i.e., contains no value), and when
268
+ * the `Option` is `Some` (i.e., contains a value). It executes one of the
269
+ * provided functions based on the case:
270
+ *
271
+ * - If the `Option` is `None`, the `onNone` function is executed and its result
272
+ * is returned.
273
+ * - If the `Option` is `Some`, the `onSome` function is executed with the
274
+ * contained value, and its result is returned.
275
+ *
276
+ * This function provides a concise and functional way to handle optional values
277
+ * without resorting to `if` or manual checks, making your code more declarative
278
+ * and readable.
279
+ *
280
+ * **Example** (Pattern Matching with Option)
281
+ *
282
+ * ```ts
283
+ * import { Option } from "effect"
284
+ *
285
+ * const foo = Option.some(1)
286
+ *
287
+ * const message = Option.match(foo, {
288
+ * onNone: () => "Option is empty",
289
+ * onSome: (value) => `Option has a value: ${value}`
290
+ * })
291
+ *
292
+ * console.log(message)
293
+ * // Output: "Option has a value: 1"
294
+ * ```
295
+ *
296
+ * @category Pattern matching
297
+ * @since 2.0.0
298
+ */
299
+ export const match: {
300
+ /**
301
+ * Performs pattern matching on an `Option` to handle both `Some` and `None`
302
+ * cases.
303
+ *
304
+ * **Details**
305
+ *
306
+ * This function allows you to match against an `Option` and handle both
307
+ * scenarios: when the `Option` is `None` (i.e., contains no value), and when
308
+ * the `Option` is `Some` (i.e., contains a value). It executes one of the
309
+ * provided functions based on the case:
310
+ *
311
+ * - If the `Option` is `None`, the `onNone` function is executed and its result
312
+ * is returned.
313
+ * - If the `Option` is `Some`, the `onSome` function is executed with the
314
+ * contained value, and its result is returned.
315
+ *
316
+ * This function provides a concise and functional way to handle optional values
317
+ * without resorting to `if` or manual checks, making your code more declarative
318
+ * and readable.
319
+ *
320
+ * **Example** (Pattern Matching with Option)
321
+ *
322
+ * ```ts
323
+ * import { Option } from "effect"
324
+ *
325
+ * const foo = Option.some(1)
326
+ *
327
+ * const message = Option.match(foo, {
328
+ * onNone: () => "Option is empty",
329
+ * onSome: (value) => `Option has a value: ${value}`
330
+ * })
331
+ *
332
+ * console.log(message)
333
+ * // Output: "Option has a value: 1"
334
+ * ```
335
+ *
336
+ * @category Pattern matching
337
+ * @since 2.0.0
338
+ */
339
+ <B, A, C = B>(
340
+ options: {
341
+ readonly onNone: LazyArg<B>
342
+ readonly onSome: (a: A) => C
343
+ }
344
+ ): (self: Option<A>) => B | C
345
+ /**
346
+ * Performs pattern matching on an `Option` to handle both `Some` and `None`
347
+ * cases.
348
+ *
349
+ * **Details**
350
+ *
351
+ * This function allows you to match against an `Option` and handle both
352
+ * scenarios: when the `Option` is `None` (i.e., contains no value), and when
353
+ * the `Option` is `Some` (i.e., contains a value). It executes one of the
354
+ * provided functions based on the case:
355
+ *
356
+ * - If the `Option` is `None`, the `onNone` function is executed and its result
357
+ * is returned.
358
+ * - If the `Option` is `Some`, the `onSome` function is executed with the
359
+ * contained value, and its result is returned.
360
+ *
361
+ * This function provides a concise and functional way to handle optional values
362
+ * without resorting to `if` or manual checks, making your code more declarative
363
+ * and readable.
364
+ *
365
+ * **Example** (Pattern Matching with Option)
366
+ *
367
+ * ```ts
368
+ * import { Option } from "effect"
369
+ *
370
+ * const foo = Option.some(1)
371
+ *
372
+ * const message = Option.match(foo, {
373
+ * onNone: () => "Option is empty",
374
+ * onSome: (value) => `Option has a value: ${value}`
375
+ * })
376
+ *
377
+ * console.log(message)
378
+ * // Output: "Option has a value: 1"
379
+ * ```
380
+ *
381
+ * @category Pattern matching
382
+ * @since 2.0.0
383
+ */
384
+ <A, B, C = B>(
385
+ self: Option<A>,
386
+ options: {
387
+ readonly onNone: LazyArg<B>
388
+ readonly onSome: (a: A) => C
389
+ }
390
+ ): B | C
391
+ } = dual(
392
+ 2,
393
+ <A, B, C = B>(self: Option<A>, { onNone, onSome }: {
394
+ readonly onNone: LazyArg<B>
395
+ readonly onSome: (a: A) => C
396
+ }): B | C => isNone(self) ? onNone() : onSome(self.value)
397
+ )
398
+
399
+ /**
400
+ * Converts an `Option`-returning function into a type guard.
401
+ *
402
+ * **Details**
403
+ *
404
+ * This function transforms a function that returns an `Option` into a type
405
+ * guard, ensuring type safety when validating or narrowing types. The returned
406
+ * type guard function checks whether the input satisfies the condition defined
407
+ * in the original `Option`-returning function.
408
+ *
409
+ * If the original function returns `Option.some`, the type guard evaluates to
410
+ * `true`, confirming the input is of the desired type. If the function returns
411
+ * `Option.none`, the type guard evaluates to `false`.
412
+ *
413
+ * This utility is especially useful for validating types in union types,
414
+ * filtering arrays, or ensuring safe handling of specific subtypes.
415
+ *
416
+ * @example
417
+ * ```ts
418
+ * import { Option } from "effect"
419
+ *
420
+ * type MyData = string | number
421
+ *
422
+ * const parseString = (data: MyData): Option.Option<string> =>
423
+ * typeof data === "string" ? Option.some(data) : Option.none()
424
+ *
425
+ * // ┌─── (a: MyData) => a is string
426
+ * // ▼
427
+ * const isString = Option.toRefinement(parseString)
428
+ *
429
+ * console.log(isString("a"))
430
+ * // Output: true
431
+ *
432
+ * console.log(isString(1))
433
+ * // Output: false
434
+ * ```
435
+ *
436
+ * @category Conversions
437
+ * @since 2.0.0
438
+ */
439
+ export const toRefinement = <A, B extends A>(f: (a: A) => Option<B>): (a: A) => a is B => (a: A): a is B => isSome(f(a))
440
+
441
+ /**
442
+ * Converts an `Iterable` into an `Option`, wrapping the first element if it
443
+ * exists.
444
+ *
445
+ * **Details**
446
+ *
447
+ * This function takes an `Iterable` (e.g., an array, a generator, or any object
448
+ * implementing the `Iterable` interface) and returns an `Option` based on its
449
+ * content:
450
+ *
451
+ * - If the `Iterable` contains at least one element, the first element is
452
+ * wrapped in a `Some` and returned.
453
+ * - If the `Iterable` is empty, `None` is returned, representing the absence of
454
+ * a value.
455
+ *
456
+ * This utility is useful for safely handling collections that might be empty,
457
+ * ensuring you explicitly handle both cases where a value exists or doesn't.
458
+ *
459
+ * @example
460
+ * ```ts
461
+ * import { Option } from "effect"
462
+ *
463
+ * console.log(Option.fromIterable([1, 2, 3]))
464
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
465
+ *
466
+ * console.log(Option.fromIterable([]))
467
+ * // Output: { _id: 'Option', _tag: 'None' }
468
+ * ```
469
+ *
470
+ * @category Constructors
471
+ * @since 2.0.0
472
+ */
473
+ export const fromIterable = <A>(collection: Iterable<A>): Option<A> => {
474
+ for (const a of collection) {
475
+ return some(a)
476
+ }
477
+ return none()
478
+ }
479
+
480
+ /**
481
+ * Converts an `Either` into an `Option` by discarding the error and extracting
482
+ * the right value.
483
+ *
484
+ * **Details**
485
+ *
486
+ * This function takes an `Either` and returns an `Option` based on its value:
487
+ *
488
+ * - If the `Either` is a `Right`, its value is wrapped in a `Some` and
489
+ * returned.
490
+ * - If the `Either` is a `Left`, the error is discarded, and `None` is
491
+ * returned.
492
+ *
493
+ * This is particularly useful when you only care about the success case
494
+ * (`Right`) of an `Either` and want to handle the result using `Option`. By
495
+ * using this function, you can convert `Either` into a simpler structure for
496
+ * cases where error handling is not required.
497
+ *
498
+ * @example
499
+ * ```ts
500
+ * import { Either, Option } from "effect"
501
+ *
502
+ * console.log(Option.getRight(Either.right("ok")))
503
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'ok' }
504
+ *
505
+ * console.log(Option.getRight(Either.left("err")))
506
+ * // Output: { _id: 'Option', _tag: 'None' }
507
+ * ```
508
+ *
509
+ * @see {@link getLeft} for the opposite operation.
510
+ *
511
+ * @category Conversions
512
+ * @since 2.0.0
513
+ */
514
+ export const getRight: <R, L>(self: Either<R, L>) => Option<R> = either.getRight
515
+
516
+ /**
517
+ * Converts an `Either` into an `Option` by discarding the right value and
518
+ * extracting the left value.
519
+ *
520
+ * **Details**
521
+ *
522
+ * This function transforms an `Either` into an `Option` as follows:
523
+ *
524
+ * - If the `Either` is a `Left`, its value is wrapped in a `Some` and returned.
525
+ * - If the `Either` is a `Right`, the value is discarded, and `None` is
526
+ * returned.
527
+ *
528
+ * This utility is useful when you only care about the error case (`Left`) of an
529
+ * `Either` and want to handle it as an `Option`. By discarding the right value,
530
+ * it simplifies error-focused workflows.
531
+ *
532
+ * @example
533
+ * ```ts
534
+ * import { Either, Option } from "effect"
535
+ *
536
+ * console.log(Option.getLeft(Either.right("ok")))
537
+ * // Output: { _id: 'Option', _tag: 'None' }
538
+ *
539
+ * console.log(Option.getLeft(Either.left("err")))
540
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'err' }
541
+ * ```
542
+ *
543
+ * @see {@link getRight} for the opposite operation.
544
+ *
545
+ * @category Conversions
546
+ * @since 2.0.0
547
+ */
548
+ export const getLeft: <R, L>(self: Either<R, L>) => Option<L> = either.getLeft
549
+
550
+ /**
551
+ * Returns the value contained in the `Option` if it is `Some`, otherwise
552
+ * evaluates and returns the result of `onNone`.
553
+ *
554
+ * **Details**
555
+ *
556
+ * This function allows you to provide a fallback value or computation for when
557
+ * an `Option` is `None`. If the `Option` contains a value (`Some`), that value
558
+ * is returned. If it is empty (`None`), the `onNone` function is executed, and
559
+ * its result is returned instead.
560
+ *
561
+ * This utility is helpful for safely handling `Option` values by ensuring you
562
+ * always receive a meaningful result, whether or not the `Option` contains a
563
+ * value. It is particularly useful for providing default values or alternative
564
+ * logic when working with optional values.
565
+ *
566
+ * @example
567
+ * ```ts
568
+ * import { Option } from "effect"
569
+ *
570
+ * console.log(Option.some(1).pipe(Option.getOrElse(() => 0)))
571
+ * // Output: 1
572
+ *
573
+ * console.log(Option.none().pipe(Option.getOrElse(() => 0)))
574
+ * // Output: 0
575
+ * ```
576
+ *
577
+ * @see {@link getOrNull} for a version that returns `null` instead of executing a function.
578
+ * @see {@link getOrUndefined} for a version that returns `undefined` instead of executing a function.
579
+ *
580
+ * @category Getters
581
+ * @since 2.0.0
582
+ */
583
+ export const getOrElse: {
584
+ /**
585
+ * Returns the value contained in the `Option` if it is `Some`, otherwise
586
+ * evaluates and returns the result of `onNone`.
587
+ *
588
+ * **Details**
589
+ *
590
+ * This function allows you to provide a fallback value or computation for when
591
+ * an `Option` is `None`. If the `Option` contains a value (`Some`), that value
592
+ * is returned. If it is empty (`None`), the `onNone` function is executed, and
593
+ * its result is returned instead.
594
+ *
595
+ * This utility is helpful for safely handling `Option` values by ensuring you
596
+ * always receive a meaningful result, whether or not the `Option` contains a
597
+ * value. It is particularly useful for providing default values or alternative
598
+ * logic when working with optional values.
599
+ *
600
+ * @example
601
+ * ```ts
602
+ * import { Option } from "effect"
603
+ *
604
+ * console.log(Option.some(1).pipe(Option.getOrElse(() => 0)))
605
+ * // Output: 1
606
+ *
607
+ * console.log(Option.none().pipe(Option.getOrElse(() => 0)))
608
+ * // Output: 0
609
+ * ```
610
+ *
611
+ * @see {@link getOrNull} for a version that returns `null` instead of executing a function.
612
+ * @see {@link getOrUndefined} for a version that returns `undefined` instead of executing a function.
613
+ *
614
+ * @category Getters
615
+ * @since 2.0.0
616
+ */
617
+ <B>(onNone: LazyArg<B>): <A>(self: Option<A>) => B | A
618
+ /**
619
+ * Returns the value contained in the `Option` if it is `Some`, otherwise
620
+ * evaluates and returns the result of `onNone`.
621
+ *
622
+ * **Details**
623
+ *
624
+ * This function allows you to provide a fallback value or computation for when
625
+ * an `Option` is `None`. If the `Option` contains a value (`Some`), that value
626
+ * is returned. If it is empty (`None`), the `onNone` function is executed, and
627
+ * its result is returned instead.
628
+ *
629
+ * This utility is helpful for safely handling `Option` values by ensuring you
630
+ * always receive a meaningful result, whether or not the `Option` contains a
631
+ * value. It is particularly useful for providing default values or alternative
632
+ * logic when working with optional values.
633
+ *
634
+ * @example
635
+ * ```ts
636
+ * import { Option } from "effect"
637
+ *
638
+ * console.log(Option.some(1).pipe(Option.getOrElse(() => 0)))
639
+ * // Output: 1
640
+ *
641
+ * console.log(Option.none().pipe(Option.getOrElse(() => 0)))
642
+ * // Output: 0
643
+ * ```
644
+ *
645
+ * @see {@link getOrNull} for a version that returns `null` instead of executing a function.
646
+ * @see {@link getOrUndefined} for a version that returns `undefined` instead of executing a function.
647
+ *
648
+ * @category Getters
649
+ * @since 2.0.0
650
+ */
651
+ <A, B>(self: Option<A>, onNone: LazyArg<B>): A | B
652
+ } = dual(
653
+ 2,
654
+ <A, B>(self: Option<A>, onNone: LazyArg<B>): A | B => isNone(self) ? onNone() : self.value
655
+ )
656
+
657
+ /**
658
+ * Returns the provided `Option` `that` if the current `Option` (`self`) is
659
+ * `None`; otherwise, it returns `self`.
660
+ *
661
+ * **Details**
662
+ *
663
+ * This function provides a fallback mechanism for `Option` values. If the
664
+ * current `Option` is `None` (i.e., it contains no value), the `that` function
665
+ * is evaluated, and its resulting `Option` is returned. If the current `Option`
666
+ * is `Some` (i.e., it contains a value), the original `Option` is returned
667
+ * unchanged.
668
+ *
669
+ * This is particularly useful for chaining fallback values or computations,
670
+ * allowing you to provide alternative `Option` values when the first one is
671
+ * empty.
672
+ *
673
+ * @example
674
+ * ```ts
675
+ * import { Option } from "effect"
676
+ *
677
+ * console.log(Option.none().pipe(Option.orElse(() => Option.none())))
678
+ * // Output: { _id: 'Option', _tag: 'None' }
679
+ *
680
+ * console.log(Option.some("a").pipe(Option.orElse(() => Option.none())))
681
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
682
+ *
683
+ * console.log(Option.none().pipe(Option.orElse(() => Option.some("b"))))
684
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }
685
+ *
686
+ * console.log(Option.some("a").pipe(Option.orElse(() => Option.some("b"))))
687
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
688
+ * ```
689
+ *
690
+ * @category Error handling
691
+ * @since 2.0.0
692
+ */
693
+ export const orElse: {
694
+ /**
695
+ * Returns the provided `Option` `that` if the current `Option` (`self`) is
696
+ * `None`; otherwise, it returns `self`.
697
+ *
698
+ * **Details**
699
+ *
700
+ * This function provides a fallback mechanism for `Option` values. If the
701
+ * current `Option` is `None` (i.e., it contains no value), the `that` function
702
+ * is evaluated, and its resulting `Option` is returned. If the current `Option`
703
+ * is `Some` (i.e., it contains a value), the original `Option` is returned
704
+ * unchanged.
705
+ *
706
+ * This is particularly useful for chaining fallback values or computations,
707
+ * allowing you to provide alternative `Option` values when the first one is
708
+ * empty.
709
+ *
710
+ * @example
711
+ * ```ts
712
+ * import { Option } from "effect"
713
+ *
714
+ * console.log(Option.none().pipe(Option.orElse(() => Option.none())))
715
+ * // Output: { _id: 'Option', _tag: 'None' }
716
+ *
717
+ * console.log(Option.some("a").pipe(Option.orElse(() => Option.none())))
718
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
719
+ *
720
+ * console.log(Option.none().pipe(Option.orElse(() => Option.some("b"))))
721
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }
722
+ *
723
+ * console.log(Option.some("a").pipe(Option.orElse(() => Option.some("b"))))
724
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
725
+ * ```
726
+ *
727
+ * @category Error handling
728
+ * @since 2.0.0
729
+ */
730
+ <B>(that: LazyArg<Option<B>>): <A>(self: Option<A>) => Option<B | A>
731
+ /**
732
+ * Returns the provided `Option` `that` if the current `Option` (`self`) is
733
+ * `None`; otherwise, it returns `self`.
734
+ *
735
+ * **Details**
736
+ *
737
+ * This function provides a fallback mechanism for `Option` values. If the
738
+ * current `Option` is `None` (i.e., it contains no value), the `that` function
739
+ * is evaluated, and its resulting `Option` is returned. If the current `Option`
740
+ * is `Some` (i.e., it contains a value), the original `Option` is returned
741
+ * unchanged.
742
+ *
743
+ * This is particularly useful for chaining fallback values or computations,
744
+ * allowing you to provide alternative `Option` values when the first one is
745
+ * empty.
746
+ *
747
+ * @example
748
+ * ```ts
749
+ * import { Option } from "effect"
750
+ *
751
+ * console.log(Option.none().pipe(Option.orElse(() => Option.none())))
752
+ * // Output: { _id: 'Option', _tag: 'None' }
753
+ *
754
+ * console.log(Option.some("a").pipe(Option.orElse(() => Option.none())))
755
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
756
+ *
757
+ * console.log(Option.none().pipe(Option.orElse(() => Option.some("b"))))
758
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }
759
+ *
760
+ * console.log(Option.some("a").pipe(Option.orElse(() => Option.some("b"))))
761
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
762
+ * ```
763
+ *
764
+ * @category Error handling
765
+ * @since 2.0.0
766
+ */
767
+ <A, B>(self: Option<A>, that: LazyArg<Option<B>>): Option<A | B>
768
+ } = dual(
769
+ 2,
770
+ <A, B>(self: Option<A>, that: LazyArg<Option<B>>): Option<A | B> => isNone(self) ? that() : self
771
+ )
772
+
773
+ /**
774
+ * Returns the provided default value wrapped in `Some` if the current `Option`
775
+ * (`self`) is `None`; otherwise, returns `self`.
776
+ *
777
+ * **Details**
778
+ *
779
+ * This function provides a way to supply a default value for cases where an
780
+ * `Option` is `None`. If the current `Option` is empty (`None`), the `onNone`
781
+ * function is executed to compute the default value, which is then wrapped in a
782
+ * `Some`. If the current `Option` contains a value (`Some`), it is returned as
783
+ * is.
784
+ *
785
+ * This is particularly useful for handling optional values where a fallback
786
+ * default needs to be provided explicitly in case of absence.
787
+ *
788
+ * @example
789
+ * ```ts
790
+ * import { Option } from "effect"
791
+ *
792
+ * console.log(Option.none().pipe(Option.orElseSome(() => "b")))
793
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }
794
+ *
795
+ * console.log(Option.some("a").pipe(Option.orElseSome(() => "b")))
796
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
797
+ * ```
798
+ *
799
+ * @category Error handling
800
+ * @since 2.0.0
801
+ */
802
+ export const orElseSome: {
803
+ /**
804
+ * Returns the provided default value wrapped in `Some` if the current `Option`
805
+ * (`self`) is `None`; otherwise, returns `self`.
806
+ *
807
+ * **Details**
808
+ *
809
+ * This function provides a way to supply a default value for cases where an
810
+ * `Option` is `None`. If the current `Option` is empty (`None`), the `onNone`
811
+ * function is executed to compute the default value, which is then wrapped in a
812
+ * `Some`. If the current `Option` contains a value (`Some`), it is returned as
813
+ * is.
814
+ *
815
+ * This is particularly useful for handling optional values where a fallback
816
+ * default needs to be provided explicitly in case of absence.
817
+ *
818
+ * @example
819
+ * ```ts
820
+ * import { Option } from "effect"
821
+ *
822
+ * console.log(Option.none().pipe(Option.orElseSome(() => "b")))
823
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }
824
+ *
825
+ * console.log(Option.some("a").pipe(Option.orElseSome(() => "b")))
826
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
827
+ * ```
828
+ *
829
+ * @category Error handling
830
+ * @since 2.0.0
831
+ */
832
+ <B>(onNone: LazyArg<B>): <A>(self: Option<A>) => Option<B | A>
833
+ /**
834
+ * Returns the provided default value wrapped in `Some` if the current `Option`
835
+ * (`self`) is `None`; otherwise, returns `self`.
836
+ *
837
+ * **Details**
838
+ *
839
+ * This function provides a way to supply a default value for cases where an
840
+ * `Option` is `None`. If the current `Option` is empty (`None`), the `onNone`
841
+ * function is executed to compute the default value, which is then wrapped in a
842
+ * `Some`. If the current `Option` contains a value (`Some`), it is returned as
843
+ * is.
844
+ *
845
+ * This is particularly useful for handling optional values where a fallback
846
+ * default needs to be provided explicitly in case of absence.
847
+ *
848
+ * @example
849
+ * ```ts
850
+ * import { Option } from "effect"
851
+ *
852
+ * console.log(Option.none().pipe(Option.orElseSome(() => "b")))
853
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }
854
+ *
855
+ * console.log(Option.some("a").pipe(Option.orElseSome(() => "b")))
856
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
857
+ * ```
858
+ *
859
+ * @category Error handling
860
+ * @since 2.0.0
861
+ */
862
+ <A, B>(self: Option<A>, onNone: LazyArg<B>): Option<A | B>
863
+ } = dual(
864
+ 2,
865
+ <A, B>(self: Option<A>, onNone: LazyArg<B>): Option<A | B> => isNone(self) ? some(onNone()) : self
866
+ )
867
+
868
+ /**
869
+ * Similar to {@link orElse}, but returns an `Either` wrapped in an `Option` to
870
+ * indicate the source of the value.
871
+ *
872
+ * **Details**
873
+ *
874
+ * This function allows you to provide a fallback `Option` in case the current
875
+ * `Option` (`self`) is `None`. However, unlike `orElse`, it returns the value
876
+ * wrapped in an `Either` object, providing additional information about where
877
+ * the value came from:
878
+ *
879
+ * - If the value is from the fallback `Option` (`that`), it is wrapped in an
880
+ * `Either.right`.
881
+ * - If the value is from the original `Option` (`self`), it is wrapped in an
882
+ * `Either.left`.
883
+ *
884
+ * This is especially useful when you need to differentiate between values
885
+ * originating from the primary `Option` and those coming from the fallback,
886
+ * while still maintaining the `Option`-style handling.
887
+ *
888
+ * @category Error handling
889
+ * @since 2.0.0
890
+ */
891
+ export const orElseEither: {
892
+ /**
893
+ * Similar to {@link orElse}, but returns an `Either` wrapped in an `Option` to
894
+ * indicate the source of the value.
895
+ *
896
+ * **Details**
897
+ *
898
+ * This function allows you to provide a fallback `Option` in case the current
899
+ * `Option` (`self`) is `None`. However, unlike `orElse`, it returns the value
900
+ * wrapped in an `Either` object, providing additional information about where
901
+ * the value came from:
902
+ *
903
+ * - If the value is from the fallback `Option` (`that`), it is wrapped in an
904
+ * `Either.right`.
905
+ * - If the value is from the original `Option` (`self`), it is wrapped in an
906
+ * `Either.left`.
907
+ *
908
+ * This is especially useful when you need to differentiate between values
909
+ * originating from the primary `Option` and those coming from the fallback,
910
+ * while still maintaining the `Option`-style handling.
911
+ *
912
+ * @category Error handling
913
+ * @since 2.0.0
914
+ */
915
+ <B>(that: LazyArg<Option<B>>): <A>(self: Option<A>) => Option<Either<B, A>>
916
+ /**
917
+ * Similar to {@link orElse}, but returns an `Either` wrapped in an `Option` to
918
+ * indicate the source of the value.
919
+ *
920
+ * **Details**
921
+ *
922
+ * This function allows you to provide a fallback `Option` in case the current
923
+ * `Option` (`self`) is `None`. However, unlike `orElse`, it returns the value
924
+ * wrapped in an `Either` object, providing additional information about where
925
+ * the value came from:
926
+ *
927
+ * - If the value is from the fallback `Option` (`that`), it is wrapped in an
928
+ * `Either.right`.
929
+ * - If the value is from the original `Option` (`self`), it is wrapped in an
930
+ * `Either.left`.
931
+ *
932
+ * This is especially useful when you need to differentiate between values
933
+ * originating from the primary `Option` and those coming from the fallback,
934
+ * while still maintaining the `Option`-style handling.
935
+ *
936
+ * @category Error handling
937
+ * @since 2.0.0
938
+ */
939
+ <A, B>(self: Option<A>, that: LazyArg<Option<B>>): Option<Either<B, A>>
940
+ } = dual(
941
+ 2,
942
+ <A, B>(self: Option<A>, that: LazyArg<Option<B>>): Option<Either<B, A>> =>
943
+ isNone(self) ? map(that(), either.right) : map(self, either.left)
944
+ )
945
+
946
+ /**
947
+ * Returns the first `Some` value found in an `Iterable` collection of
948
+ * `Option`s, or `None` if no `Some` is found.
949
+ *
950
+ * **Details**
951
+ *
952
+ * This function iterates over a collection of `Option` values and returns the
953
+ * first `Some` it encounters. If the collection contains only `None` values,
954
+ * the result will also be `None`. This utility is useful for efficiently
955
+ * finding the first valid value in a sequence of potentially empty or invalid
956
+ * options.
957
+ *
958
+ * The iteration stops as soon as a `Some` is found, making this function
959
+ * efficient for large collections.
960
+ *
961
+ * @example
962
+ * ```ts
963
+ * import { Option } from "effect"
964
+ *
965
+ * console.log(Option.firstSomeOf([
966
+ * Option.none(),
967
+ * Option.some(1),
968
+ * Option.some(2)
969
+ * ]))
970
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
971
+ * ```
972
+ *
973
+ * @category Error handling
974
+ * @since 2.0.0
975
+ */
976
+ export const firstSomeOf = <T, C extends Iterable<Option<T>> = Iterable<Option<T>>>(
977
+ collection: C
978
+ ): [C] extends [Iterable<Option<infer A>>] ? Option<A> : never => {
979
+ let out: Option<unknown> = none()
980
+ for (out of collection) {
981
+ if (isSome(out)) {
982
+ return out as any
983
+ }
984
+ }
985
+ return out as any
986
+ }
987
+
988
+ /**
989
+ * Converts a nullable value into an `Option`. Returns `None` if the value is
990
+ * `null` or `undefined`, otherwise wraps the value in a `Some`.
991
+ *
992
+ * @example
993
+ * ```ts
994
+ * import { Option } from "effect"
995
+ *
996
+ * console.log(Option.fromNullable(undefined))
997
+ * // Output: { _id: 'Option', _tag: 'None' }
998
+ *
999
+ * console.log(Option.fromNullable(null))
1000
+ * // Output: { _id: 'Option', _tag: 'None' }
1001
+ *
1002
+ * console.log(Option.fromNullable(1))
1003
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
1004
+ * ```
1005
+ *
1006
+ * @category Conversions
1007
+ * @since 2.0.0
1008
+ */
1009
+ export const fromNullable = <A>(
1010
+ nullableValue: A
1011
+ ): Option<NonNullable<A>> => (nullableValue == null ? none() : some(nullableValue as NonNullable<A>))
1012
+
1013
+ /**
1014
+ * Lifts a function that returns `null` or `undefined` into the `Option`
1015
+ * context.
1016
+ *
1017
+ * **Details**
1018
+ *
1019
+ * This function takes a function `f` that might return `null` or `undefined`
1020
+ * and transforms it into a function that returns an `Option`. The resulting
1021
+ * function will return:
1022
+ * - `Some` if the original function produces a non-null, non-undefined value.
1023
+ * - `None` if the original function produces `null` or `undefined`.
1024
+ *
1025
+ * @example
1026
+ * ```ts
1027
+ * import { Option } from "effect"
1028
+ *
1029
+ * const parse = (s: string): number | undefined => {
1030
+ * const n = parseFloat(s)
1031
+ * return isNaN(n) ? undefined : n
1032
+ * }
1033
+ *
1034
+ * const parseOption = Option.liftNullable(parse)
1035
+ *
1036
+ * console.log(parseOption("1"))
1037
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
1038
+ *
1039
+ * console.log(parseOption("not a number"))
1040
+ * // Output: { _id: 'Option', _tag: 'None' }
1041
+ * ```
1042
+ *
1043
+ * @category Conversions
1044
+ * @since 2.0.0
1045
+ */
1046
+ export const liftNullable = <A extends ReadonlyArray<unknown>, B>(
1047
+ f: (...a: A) => B | null | undefined
1048
+ ): (...a: A) => Option<NonNullable<B>> =>
1049
+ (...a) => fromNullable(f(...a))
1050
+
1051
+ /**
1052
+ * Returns the value contained in the `Option` if it is `Some`; otherwise,
1053
+ * returns `null`.
1054
+ *
1055
+ * **Details**
1056
+ *
1057
+ * This function provides a way to extract the value of an `Option` while
1058
+ * falling back to `null` if the `Option` is `None`.
1059
+ *
1060
+ * It is particularly useful in scenarios where `null` is an acceptable
1061
+ * placeholder for the absence of a value, such as when interacting with APIs or
1062
+ * systems that use `null` as a default for missing values.
1063
+ *
1064
+ * @example
1065
+ * ```ts
1066
+ * import { Option } from "effect"
1067
+ *
1068
+ * console.log(Option.getOrNull(Option.some(1)))
1069
+ * // Output: 1
1070
+ *
1071
+ * console.log(Option.getOrNull(Option.none()))
1072
+ * // Output: null
1073
+ * ```
1074
+ *
1075
+ * @category Getters
1076
+ * @since 2.0.0
1077
+ */
1078
+ export const getOrNull: <A>(self: Option<A>) => A | null = getOrElse(constNull)
1079
+
1080
+ /**
1081
+ * Returns the value contained in the `Option` if it is `Some`; otherwise,
1082
+ * returns `undefined`.
1083
+ *
1084
+ * **Details**
1085
+ *
1086
+ * This function provides a way to extract the value of an `Option` while
1087
+ * falling back to `undefined` if the `Option` is `None`.
1088
+ *
1089
+ * It is particularly useful in scenarios where `undefined` is an acceptable
1090
+ * placeholder for the absence of a value, such as when interacting with APIs or
1091
+ * systems that use `undefined` as a default for missing values.
1092
+ *
1093
+ * @example
1094
+ * ```ts
1095
+ * import { Option } from "effect"
1096
+ *
1097
+ * console.log(Option.getOrUndefined(Option.some(1)))
1098
+ * // Output: 1
1099
+ *
1100
+ * console.log(Option.getOrUndefined(Option.none()))
1101
+ * // Output: undefined
1102
+ * ```
1103
+ *
1104
+ * @category Getters
1105
+ * @since 2.0.0
1106
+ */
1107
+ export const getOrUndefined: <A>(self: Option<A>) => A | undefined = getOrElse(constUndefined)
1108
+
1109
+ /**
1110
+ * Lifts a function that throws exceptions into a function that returns an
1111
+ * `Option`.
1112
+ *
1113
+ * **Details**
1114
+ *
1115
+ * This utility function takes a function `f` that might throw an exception and
1116
+ * transforms it into a safer function that returns an `Option`. If the original
1117
+ * function executes successfully, the result is wrapped in a `Some`. If an
1118
+ * exception is thrown, the result is `None`, allowing the developer to handle
1119
+ * errors in a functional, type-safe way.
1120
+ *
1121
+ * @example
1122
+ * ```ts
1123
+ * import { Option } from "effect"
1124
+ *
1125
+ * const parse = Option.liftThrowable(JSON.parse)
1126
+ *
1127
+ * console.log(parse("1"))
1128
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
1129
+ *
1130
+ * console.log(parse(""))
1131
+ * // Output: { _id: 'Option', _tag: 'None' }
1132
+ * ```
1133
+ *
1134
+ * @category Conversions
1135
+ * @since 2.0.0
1136
+ */
1137
+ export const liftThrowable = <A extends ReadonlyArray<unknown>, B>(
1138
+ f: (...a: A) => B
1139
+ ): (...a: A) => Option<B> =>
1140
+ (...a) => {
1141
+ try {
1142
+ return some(f(...a))
1143
+ } catch {
1144
+ return none()
1145
+ }
1146
+ }
1147
+
1148
+ /**
1149
+ * Extracts the value of an `Option` or throws an error if the `Option` is
1150
+ * `None`, using a custom error factory.
1151
+ *
1152
+ * **Details**
1153
+ *
1154
+ * This function allows you to extract the value of an `Option` when it is
1155
+ * `Some`. If the `Option` is `None`, it throws an error generated by the
1156
+ * provided `onNone` function. This utility is particularly useful when you need
1157
+ * a fail-fast behavior for empty `Option` values and want to provide a custom
1158
+ * error message or object.
1159
+ *
1160
+ * @example
1161
+ * ```ts
1162
+ * import * as assert from "node:assert"
1163
+ * import { Option } from "effect"
1164
+ *
1165
+ * assert.deepStrictEqual(
1166
+ * Option.getOrThrowWith(Option.some(1), () => new Error('Unexpected None')),
1167
+ * 1
1168
+ * )
1169
+ * assert.throws(() => Option.getOrThrowWith(Option.none(), () => new Error('Unexpected None')))
1170
+ * ```
1171
+ *
1172
+ * @see {@link getOrThrow} for a version that throws a default error.
1173
+ *
1174
+ * @category Conversions
1175
+ * @since 2.0.0
1176
+ */
1177
+ export const getOrThrowWith: {
1178
+ /**
1179
+ * Extracts the value of an `Option` or throws an error if the `Option` is
1180
+ * `None`, using a custom error factory.
1181
+ *
1182
+ * **Details**
1183
+ *
1184
+ * This function allows you to extract the value of an `Option` when it is
1185
+ * `Some`. If the `Option` is `None`, it throws an error generated by the
1186
+ * provided `onNone` function. This utility is particularly useful when you need
1187
+ * a fail-fast behavior for empty `Option` values and want to provide a custom
1188
+ * error message or object.
1189
+ *
1190
+ * @example
1191
+ * ```ts
1192
+ * import * as assert from "node:assert"
1193
+ * import { Option } from "effect"
1194
+ *
1195
+ * assert.deepStrictEqual(
1196
+ * Option.getOrThrowWith(Option.some(1), () => new Error('Unexpected None')),
1197
+ * 1
1198
+ * )
1199
+ * assert.throws(() => Option.getOrThrowWith(Option.none(), () => new Error('Unexpected None')))
1200
+ * ```
1201
+ *
1202
+ * @see {@link getOrThrow} for a version that throws a default error.
1203
+ *
1204
+ * @category Conversions
1205
+ * @since 2.0.0
1206
+ */
1207
+ (onNone: () => unknown): <A>(self: Option<A>) => A
1208
+ /**
1209
+ * Extracts the value of an `Option` or throws an error if the `Option` is
1210
+ * `None`, using a custom error factory.
1211
+ *
1212
+ * **Details**
1213
+ *
1214
+ * This function allows you to extract the value of an `Option` when it is
1215
+ * `Some`. If the `Option` is `None`, it throws an error generated by the
1216
+ * provided `onNone` function. This utility is particularly useful when you need
1217
+ * a fail-fast behavior for empty `Option` values and want to provide a custom
1218
+ * error message or object.
1219
+ *
1220
+ * @example
1221
+ * ```ts
1222
+ * import * as assert from "node:assert"
1223
+ * import { Option } from "effect"
1224
+ *
1225
+ * assert.deepStrictEqual(
1226
+ * Option.getOrThrowWith(Option.some(1), () => new Error('Unexpected None')),
1227
+ * 1
1228
+ * )
1229
+ * assert.throws(() => Option.getOrThrowWith(Option.none(), () => new Error('Unexpected None')))
1230
+ * ```
1231
+ *
1232
+ * @see {@link getOrThrow} for a version that throws a default error.
1233
+ *
1234
+ * @category Conversions
1235
+ * @since 2.0.0
1236
+ */
1237
+ <A>(self: Option<A>, onNone: () => unknown): A
1238
+ } = dual(2, <A>(self: Option<A>, onNone: () => unknown): A => {
1239
+ if (isSome(self)) {
1240
+ return self.value
1241
+ }
1242
+ throw onNone()
1243
+ })
1244
+
1245
+ /**
1246
+ * Extracts the value of an `Option` or throws a default error if the `Option`
1247
+ * is `None`.
1248
+ *
1249
+ * **Details**
1250
+ *
1251
+ * This function extracts the value from an `Option` if it is `Some`. If the
1252
+ * `Option` is `None`, it throws a default error. It is useful for fail-fast
1253
+ * scenarios where the absence of a value is treated as an exceptional case and
1254
+ * a default error is sufficient.
1255
+ *
1256
+ * @example
1257
+ * ```ts
1258
+ * import * as assert from "node:assert"
1259
+ * import { Option } from "effect"
1260
+ *
1261
+ * assert.deepStrictEqual(Option.getOrThrow(Option.some(1)), 1)
1262
+ * assert.throws(() => Option.getOrThrow(Option.none()))
1263
+ * ```
1264
+ *
1265
+ * @see {@link getOrThrowWith} for a version that allows you to provide a custom error.
1266
+ *
1267
+ * @category Conversions
1268
+ * @since 2.0.0
1269
+ */
1270
+ export const getOrThrow: <A>(self: Option<A>) => A = getOrThrowWith(() => new Error("getOrThrow called on a None"))
1271
+
1272
+ /**
1273
+ * Transforms the value inside a `Some` to a new value using the provided
1274
+ * function, while leaving `None` unchanged.
1275
+ *
1276
+ * **Details**
1277
+ *
1278
+ * This function applies a mapping function `f` to the value inside an `Option`
1279
+ * if it is a `Some`. If the `Option` is `None`, it remains unchanged. The
1280
+ * result is a new `Option` with the transformed value (if it was a `Some`) or
1281
+ * still `None`.
1282
+ *
1283
+ * This utility is particularly useful for chaining transformations in a
1284
+ * functional way without needing to manually handle `None` cases.
1285
+ *
1286
+ * @example
1287
+ * ```ts
1288
+ * import { Option } from "effect"
1289
+ *
1290
+ * // Mapping over a `Some`
1291
+ * const someValue = Option.some(2)
1292
+ *
1293
+ * console.log(Option.map(someValue, (n) => n * 2))
1294
+ * // Output: { _id: 'Option', _tag: 'Some', value: 4 }
1295
+ *
1296
+ * // Mapping over a `None`
1297
+ * const noneValue = Option.none<number>()
1298
+ *
1299
+ * console.log(Option.map(noneValue, (n) => n * 2))
1300
+ * // Output: { _id: 'Option', _tag: 'None' }
1301
+ * ```
1302
+ *
1303
+ * @category Mapping
1304
+ * @since 2.0.0
1305
+ */
1306
+ export const map: {
1307
+ /**
1308
+ * Transforms the value inside a `Some` to a new value using the provided
1309
+ * function, while leaving `None` unchanged.
1310
+ *
1311
+ * **Details**
1312
+ *
1313
+ * This function applies a mapping function `f` to the value inside an `Option`
1314
+ * if it is a `Some`. If the `Option` is `None`, it remains unchanged. The
1315
+ * result is a new `Option` with the transformed value (if it was a `Some`) or
1316
+ * still `None`.
1317
+ *
1318
+ * This utility is particularly useful for chaining transformations in a
1319
+ * functional way without needing to manually handle `None` cases.
1320
+ *
1321
+ * @example
1322
+ * ```ts
1323
+ * import { Option } from "effect"
1324
+ *
1325
+ * // Mapping over a `Some`
1326
+ * const someValue = Option.some(2)
1327
+ *
1328
+ * console.log(Option.map(someValue, (n) => n * 2))
1329
+ * // Output: { _id: 'Option', _tag: 'Some', value: 4 }
1330
+ *
1331
+ * // Mapping over a `None`
1332
+ * const noneValue = Option.none<number>()
1333
+ *
1334
+ * console.log(Option.map(noneValue, (n) => n * 2))
1335
+ * // Output: { _id: 'Option', _tag: 'None' }
1336
+ * ```
1337
+ *
1338
+ * @category Mapping
1339
+ * @since 2.0.0
1340
+ */
1341
+ <A, B>(f: (a: A) => B): (self: Option<A>) => Option<B>
1342
+ /**
1343
+ * Transforms the value inside a `Some` to a new value using the provided
1344
+ * function, while leaving `None` unchanged.
1345
+ *
1346
+ * **Details**
1347
+ *
1348
+ * This function applies a mapping function `f` to the value inside an `Option`
1349
+ * if it is a `Some`. If the `Option` is `None`, it remains unchanged. The
1350
+ * result is a new `Option` with the transformed value (if it was a `Some`) or
1351
+ * still `None`.
1352
+ *
1353
+ * This utility is particularly useful for chaining transformations in a
1354
+ * functional way without needing to manually handle `None` cases.
1355
+ *
1356
+ * @example
1357
+ * ```ts
1358
+ * import { Option } from "effect"
1359
+ *
1360
+ * // Mapping over a `Some`
1361
+ * const someValue = Option.some(2)
1362
+ *
1363
+ * console.log(Option.map(someValue, (n) => n * 2))
1364
+ * // Output: { _id: 'Option', _tag: 'Some', value: 4 }
1365
+ *
1366
+ * // Mapping over a `None`
1367
+ * const noneValue = Option.none<number>()
1368
+ *
1369
+ * console.log(Option.map(noneValue, (n) => n * 2))
1370
+ * // Output: { _id: 'Option', _tag: 'None' }
1371
+ * ```
1372
+ *
1373
+ * @category Mapping
1374
+ * @since 2.0.0
1375
+ */
1376
+ <A, B>(self: Option<A>, f: (a: A) => B): Option<B>
1377
+ } = dual(
1378
+ 2,
1379
+ <A, B>(self: Option<A>, f: (a: A) => B): Option<B> => isNone(self) ? none() : some(f(self.value))
1380
+ )
1381
+
1382
+ /**
1383
+ * Replaces the value inside a `Some` with the specified constant value, leaving
1384
+ * `None` unchanged.
1385
+ *
1386
+ * **Details**
1387
+ *
1388
+ * This function transforms an `Option` by replacing the value inside a `Some`
1389
+ * with the given constant value `b`. If the `Option` is `None`, it remains
1390
+ * unchanged.
1391
+ *
1392
+ * This is useful when you want to preserve the presence of a value (`Some`) but
1393
+ * replace its content with a fixed value.
1394
+ *
1395
+ * @example
1396
+ * ```ts
1397
+ * import { Option } from "effect"
1398
+ *
1399
+ * // Replacing the value of a `Some`
1400
+ * const someValue = Option.some(42)
1401
+ *
1402
+ * console.log(Option.as(someValue, "new value"))
1403
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'new value' }
1404
+ *
1405
+ * // Replacing a `None` (no effect)
1406
+ * const noneValue = Option.none<number>()
1407
+ *
1408
+ * console.log(Option.as(noneValue, "new value"))
1409
+ * // Output: { _id: 'Option', _tag: 'None' }
1410
+ * ```
1411
+ *
1412
+ * @category Mapping
1413
+ * @since 2.0.0
1414
+ */
1415
+ export const as: {
1416
+ /**
1417
+ * Replaces the value inside a `Some` with the specified constant value, leaving
1418
+ * `None` unchanged.
1419
+ *
1420
+ * **Details**
1421
+ *
1422
+ * This function transforms an `Option` by replacing the value inside a `Some`
1423
+ * with the given constant value `b`. If the `Option` is `None`, it remains
1424
+ * unchanged.
1425
+ *
1426
+ * This is useful when you want to preserve the presence of a value (`Some`) but
1427
+ * replace its content with a fixed value.
1428
+ *
1429
+ * @example
1430
+ * ```ts
1431
+ * import { Option } from "effect"
1432
+ *
1433
+ * // Replacing the value of a `Some`
1434
+ * const someValue = Option.some(42)
1435
+ *
1436
+ * console.log(Option.as(someValue, "new value"))
1437
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'new value' }
1438
+ *
1439
+ * // Replacing a `None` (no effect)
1440
+ * const noneValue = Option.none<number>()
1441
+ *
1442
+ * console.log(Option.as(noneValue, "new value"))
1443
+ * // Output: { _id: 'Option', _tag: 'None' }
1444
+ * ```
1445
+ *
1446
+ * @category Mapping
1447
+ * @since 2.0.0
1448
+ */
1449
+ <B>(b: B): <X>(self: Option<X>) => Option<B>
1450
+ /**
1451
+ * Replaces the value inside a `Some` with the specified constant value, leaving
1452
+ * `None` unchanged.
1453
+ *
1454
+ * **Details**
1455
+ *
1456
+ * This function transforms an `Option` by replacing the value inside a `Some`
1457
+ * with the given constant value `b`. If the `Option` is `None`, it remains
1458
+ * unchanged.
1459
+ *
1460
+ * This is useful when you want to preserve the presence of a value (`Some`) but
1461
+ * replace its content with a fixed value.
1462
+ *
1463
+ * @example
1464
+ * ```ts
1465
+ * import { Option } from "effect"
1466
+ *
1467
+ * // Replacing the value of a `Some`
1468
+ * const someValue = Option.some(42)
1469
+ *
1470
+ * console.log(Option.as(someValue, "new value"))
1471
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'new value' }
1472
+ *
1473
+ * // Replacing a `None` (no effect)
1474
+ * const noneValue = Option.none<number>()
1475
+ *
1476
+ * console.log(Option.as(noneValue, "new value"))
1477
+ * // Output: { _id: 'Option', _tag: 'None' }
1478
+ * ```
1479
+ *
1480
+ * @category Mapping
1481
+ * @since 2.0.0
1482
+ */
1483
+ <X, B>(self: Option<X>, b: B): Option<B>
1484
+ } = dual(2, <X, B>(self: Option<X>, b: B): Option<B> => map(self, () => b))
1485
+
1486
+ /**
1487
+ * Replaces the value inside a `Some` with the constant value `void`, leaving
1488
+ * `None` unchanged.
1489
+ *
1490
+ * **Details**
1491
+ *
1492
+ * This function transforms an `Option` by replacing the value inside a `Some`
1493
+ * with `void`. If the `Option` is `None`, it remains unchanged.
1494
+ *
1495
+ * This is particularly useful in scenarios where the presence or absence of a
1496
+ * value is significant, but the actual content of the value is irrelevant.
1497
+ *
1498
+ * @category Mapping
1499
+ * @since 2.0.0
1500
+ */
1501
+ export const asVoid: <_>(self: Option<_>) => Option<void> = as(undefined)
1502
+
1503
+ const void_: Option<void> = some(undefined)
1504
+ export {
1505
+ /**
1506
+ * @since 2.0.0
1507
+ */
1508
+ void_ as void
1509
+ }
1510
+
1511
+ /**
1512
+ * Applies a function to the value of a `Some` and flattens the resulting
1513
+ * `Option`. If the input is `None`, it remains `None`.
1514
+ *
1515
+ * **Details**
1516
+ *
1517
+ * This function allows you to chain computations that return `Option` values.
1518
+ * If the input `Option` is `Some`, the provided function `f` is applied to the
1519
+ * contained value, and the resulting `Option` is returned. If the input is
1520
+ * `None`, the function is not applied, and the result remains `None`.
1521
+ *
1522
+ * This utility is particularly useful for sequencing operations that may fail
1523
+ * or produce optional results, enabling clean and concise workflows for
1524
+ * handling such cases.
1525
+ *
1526
+ * @example
1527
+ * ```ts
1528
+ * import { Option } from "effect"
1529
+ *
1530
+ * interface Address {
1531
+ * readonly city: string
1532
+ * readonly street: Option.Option<string>
1533
+ * }
1534
+ *
1535
+ * interface User {
1536
+ * readonly id: number
1537
+ * readonly username: string
1538
+ * readonly email: Option.Option<string>
1539
+ * readonly address: Option.Option<Address>
1540
+ * }
1541
+ *
1542
+ * const user: User = {
1543
+ * id: 1,
1544
+ * username: "john_doe",
1545
+ * email: Option.some("john.doe@example.com"),
1546
+ * address: Option.some({
1547
+ * city: "New York",
1548
+ * street: Option.some("123 Main St")
1549
+ * })
1550
+ * }
1551
+ *
1552
+ * // Use flatMap to extract the street value
1553
+ * const street = user.address.pipe(
1554
+ * Option.flatMap((address) => address.street)
1555
+ * )
1556
+ *
1557
+ * console.log(street)
1558
+ * // Output: { _id: 'Option', _tag: 'Some', value: '123 Main St' }
1559
+ * ```
1560
+ *
1561
+ * @category Sequencing
1562
+ * @since 2.0.0
1563
+ */
1564
+ export const flatMap: {
1565
+ /**
1566
+ * Applies a function to the value of a `Some` and flattens the resulting
1567
+ * `Option`. If the input is `None`, it remains `None`.
1568
+ *
1569
+ * **Details**
1570
+ *
1571
+ * This function allows you to chain computations that return `Option` values.
1572
+ * If the input `Option` is `Some`, the provided function `f` is applied to the
1573
+ * contained value, and the resulting `Option` is returned. If the input is
1574
+ * `None`, the function is not applied, and the result remains `None`.
1575
+ *
1576
+ * This utility is particularly useful for sequencing operations that may fail
1577
+ * or produce optional results, enabling clean and concise workflows for
1578
+ * handling such cases.
1579
+ *
1580
+ * @example
1581
+ * ```ts
1582
+ * import { Option } from "effect"
1583
+ *
1584
+ * interface Address {
1585
+ * readonly city: string
1586
+ * readonly street: Option.Option<string>
1587
+ * }
1588
+ *
1589
+ * interface User {
1590
+ * readonly id: number
1591
+ * readonly username: string
1592
+ * readonly email: Option.Option<string>
1593
+ * readonly address: Option.Option<Address>
1594
+ * }
1595
+ *
1596
+ * const user: User = {
1597
+ * id: 1,
1598
+ * username: "john_doe",
1599
+ * email: Option.some("john.doe@example.com"),
1600
+ * address: Option.some({
1601
+ * city: "New York",
1602
+ * street: Option.some("123 Main St")
1603
+ * })
1604
+ * }
1605
+ *
1606
+ * // Use flatMap to extract the street value
1607
+ * const street = user.address.pipe(
1608
+ * Option.flatMap((address) => address.street)
1609
+ * )
1610
+ *
1611
+ * console.log(street)
1612
+ * // Output: { _id: 'Option', _tag: 'Some', value: '123 Main St' }
1613
+ * ```
1614
+ *
1615
+ * @category Sequencing
1616
+ * @since 2.0.0
1617
+ */
1618
+ <A, B>(f: (a: A) => Option<B>): (self: Option<A>) => Option<B>
1619
+ /**
1620
+ * Applies a function to the value of a `Some` and flattens the resulting
1621
+ * `Option`. If the input is `None`, it remains `None`.
1622
+ *
1623
+ * **Details**
1624
+ *
1625
+ * This function allows you to chain computations that return `Option` values.
1626
+ * If the input `Option` is `Some`, the provided function `f` is applied to the
1627
+ * contained value, and the resulting `Option` is returned. If the input is
1628
+ * `None`, the function is not applied, and the result remains `None`.
1629
+ *
1630
+ * This utility is particularly useful for sequencing operations that may fail
1631
+ * or produce optional results, enabling clean and concise workflows for
1632
+ * handling such cases.
1633
+ *
1634
+ * @example
1635
+ * ```ts
1636
+ * import { Option } from "effect"
1637
+ *
1638
+ * interface Address {
1639
+ * readonly city: string
1640
+ * readonly street: Option.Option<string>
1641
+ * }
1642
+ *
1643
+ * interface User {
1644
+ * readonly id: number
1645
+ * readonly username: string
1646
+ * readonly email: Option.Option<string>
1647
+ * readonly address: Option.Option<Address>
1648
+ * }
1649
+ *
1650
+ * const user: User = {
1651
+ * id: 1,
1652
+ * username: "john_doe",
1653
+ * email: Option.some("john.doe@example.com"),
1654
+ * address: Option.some({
1655
+ * city: "New York",
1656
+ * street: Option.some("123 Main St")
1657
+ * })
1658
+ * }
1659
+ *
1660
+ * // Use flatMap to extract the street value
1661
+ * const street = user.address.pipe(
1662
+ * Option.flatMap((address) => address.street)
1663
+ * )
1664
+ *
1665
+ * console.log(street)
1666
+ * // Output: { _id: 'Option', _tag: 'Some', value: '123 Main St' }
1667
+ * ```
1668
+ *
1669
+ * @category Sequencing
1670
+ * @since 2.0.0
1671
+ */
1672
+ <A, B>(self: Option<A>, f: (a: A) => Option<B>): Option<B>
1673
+ } = dual(
1674
+ 2,
1675
+ <A, B>(self: Option<A>, f: (a: A) => Option<B>): Option<B> => isNone(self) ? none() : f(self.value)
1676
+ )
1677
+
1678
+ /**
1679
+ * Chains two `Option`s together. The second `Option` can either be a static
1680
+ * value or depend on the result of the first `Option`.
1681
+ *
1682
+ * **Details**
1683
+ *
1684
+ * This function enables sequencing of two `Option` computations. If the first
1685
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1686
+ * either:
1687
+ *
1688
+ * - Be a static `Option` value.
1689
+ * - Be a function that produces an `Option`, optionally based on the value of
1690
+ * the first `Option`.
1691
+ *
1692
+ * If the first `Option` is `None`, the function skips the evaluation of the
1693
+ * second `Option` and directly returns `None`.
1694
+ *
1695
+ * @category Sequencing
1696
+ * @since 2.0.0
1697
+ */
1698
+ export const andThen: {
1699
+ /**
1700
+ * Chains two `Option`s together. The second `Option` can either be a static
1701
+ * value or depend on the result of the first `Option`.
1702
+ *
1703
+ * **Details**
1704
+ *
1705
+ * This function enables sequencing of two `Option` computations. If the first
1706
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1707
+ * either:
1708
+ *
1709
+ * - Be a static `Option` value.
1710
+ * - Be a function that produces an `Option`, optionally based on the value of
1711
+ * the first `Option`.
1712
+ *
1713
+ * If the first `Option` is `None`, the function skips the evaluation of the
1714
+ * second `Option` and directly returns `None`.
1715
+ *
1716
+ * @category Sequencing
1717
+ * @since 2.0.0
1718
+ */
1719
+ <A, B>(f: (a: A) => Option<B>): (self: Option<A>) => Option<B>
1720
+ /**
1721
+ * Chains two `Option`s together. The second `Option` can either be a static
1722
+ * value or depend on the result of the first `Option`.
1723
+ *
1724
+ * **Details**
1725
+ *
1726
+ * This function enables sequencing of two `Option` computations. If the first
1727
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1728
+ * either:
1729
+ *
1730
+ * - Be a static `Option` value.
1731
+ * - Be a function that produces an `Option`, optionally based on the value of
1732
+ * the first `Option`.
1733
+ *
1734
+ * If the first `Option` is `None`, the function skips the evaluation of the
1735
+ * second `Option` and directly returns `None`.
1736
+ *
1737
+ * @category Sequencing
1738
+ * @since 2.0.0
1739
+ */
1740
+ <B>(f: Option<B>): <A>(self: Option<A>) => Option<B>
1741
+ /**
1742
+ * Chains two `Option`s together. The second `Option` can either be a static
1743
+ * value or depend on the result of the first `Option`.
1744
+ *
1745
+ * **Details**
1746
+ *
1747
+ * This function enables sequencing of two `Option` computations. If the first
1748
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1749
+ * either:
1750
+ *
1751
+ * - Be a static `Option` value.
1752
+ * - Be a function that produces an `Option`, optionally based on the value of
1753
+ * the first `Option`.
1754
+ *
1755
+ * If the first `Option` is `None`, the function skips the evaluation of the
1756
+ * second `Option` and directly returns `None`.
1757
+ *
1758
+ * @category Sequencing
1759
+ * @since 2.0.0
1760
+ */
1761
+ <A, B>(f: (a: A) => B): (self: Option<A>) => Option<B>
1762
+ /**
1763
+ * Chains two `Option`s together. The second `Option` can either be a static
1764
+ * value or depend on the result of the first `Option`.
1765
+ *
1766
+ * **Details**
1767
+ *
1768
+ * This function enables sequencing of two `Option` computations. If the first
1769
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1770
+ * either:
1771
+ *
1772
+ * - Be a static `Option` value.
1773
+ * - Be a function that produces an `Option`, optionally based on the value of
1774
+ * the first `Option`.
1775
+ *
1776
+ * If the first `Option` is `None`, the function skips the evaluation of the
1777
+ * second `Option` and directly returns `None`.
1778
+ *
1779
+ * @category Sequencing
1780
+ * @since 2.0.0
1781
+ */
1782
+ <B>(f: NotFunction<B>): <A>(self: Option<A>) => Option<B>
1783
+ /**
1784
+ * Chains two `Option`s together. The second `Option` can either be a static
1785
+ * value or depend on the result of the first `Option`.
1786
+ *
1787
+ * **Details**
1788
+ *
1789
+ * This function enables sequencing of two `Option` computations. If the first
1790
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1791
+ * either:
1792
+ *
1793
+ * - Be a static `Option` value.
1794
+ * - Be a function that produces an `Option`, optionally based on the value of
1795
+ * the first `Option`.
1796
+ *
1797
+ * If the first `Option` is `None`, the function skips the evaluation of the
1798
+ * second `Option` and directly returns `None`.
1799
+ *
1800
+ * @category Sequencing
1801
+ * @since 2.0.0
1802
+ */
1803
+ <A, B>(self: Option<A>, f: (a: A) => Option<B>): Option<B>
1804
+ /**
1805
+ * Chains two `Option`s together. The second `Option` can either be a static
1806
+ * value or depend on the result of the first `Option`.
1807
+ *
1808
+ * **Details**
1809
+ *
1810
+ * This function enables sequencing of two `Option` computations. If the first
1811
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1812
+ * either:
1813
+ *
1814
+ * - Be a static `Option` value.
1815
+ * - Be a function that produces an `Option`, optionally based on the value of
1816
+ * the first `Option`.
1817
+ *
1818
+ * If the first `Option` is `None`, the function skips the evaluation of the
1819
+ * second `Option` and directly returns `None`.
1820
+ *
1821
+ * @category Sequencing
1822
+ * @since 2.0.0
1823
+ */
1824
+ <A, B>(self: Option<A>, f: Option<B>): Option<B>
1825
+ /**
1826
+ * Chains two `Option`s together. The second `Option` can either be a static
1827
+ * value or depend on the result of the first `Option`.
1828
+ *
1829
+ * **Details**
1830
+ *
1831
+ * This function enables sequencing of two `Option` computations. If the first
1832
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1833
+ * either:
1834
+ *
1835
+ * - Be a static `Option` value.
1836
+ * - Be a function that produces an `Option`, optionally based on the value of
1837
+ * the first `Option`.
1838
+ *
1839
+ * If the first `Option` is `None`, the function skips the evaluation of the
1840
+ * second `Option` and directly returns `None`.
1841
+ *
1842
+ * @category Sequencing
1843
+ * @since 2.0.0
1844
+ */
1845
+ <A, B>(self: Option<A>, f: (a: A) => B): Option<B>
1846
+ /**
1847
+ * Chains two `Option`s together. The second `Option` can either be a static
1848
+ * value or depend on the result of the first `Option`.
1849
+ *
1850
+ * **Details**
1851
+ *
1852
+ * This function enables sequencing of two `Option` computations. If the first
1853
+ * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can
1854
+ * either:
1855
+ *
1856
+ * - Be a static `Option` value.
1857
+ * - Be a function that produces an `Option`, optionally based on the value of
1858
+ * the first `Option`.
1859
+ *
1860
+ * If the first `Option` is `None`, the function skips the evaluation of the
1861
+ * second `Option` and directly returns `None`.
1862
+ *
1863
+ * @category Sequencing
1864
+ * @since 2.0.0
1865
+ */
1866
+ <A, B>(self: Option<A>, f: NotFunction<B>): Option<B>
1867
+ } = dual(
1868
+ 2,
1869
+ <A, B>(self: Option<A>, f: (a: A) => Option<B> | Option<B>): Option<B> =>
1870
+ flatMap(self, (a) => {
1871
+ const b = isFunction(f) ? f(a) : f
1872
+ return isOption(b) ? b : some(b)
1873
+ })
1874
+ )
1875
+
1876
+ /**
1877
+ * Combines `flatMap` and `fromNullable`, transforming the value inside a `Some`
1878
+ * using a function that may return `null` or `undefined`.
1879
+ *
1880
+ * **Details**
1881
+ *
1882
+ * This function applies a transformation function `f` to the value inside a
1883
+ * `Some`. The function `f` may return a value, `null`, or `undefined`. If `f`
1884
+ * returns a value, it is wrapped in a `Some`. If `f` returns `null` or
1885
+ * `undefined`, the result is `None`. If the input `Option` is `None`, the
1886
+ * function is not applied, and `None` is returned.
1887
+ *
1888
+ * This utility is particularly useful when working with deeply nested optional
1889
+ * values or chaining computations that may result in `null` or `undefined` at
1890
+ * some point.
1891
+ *
1892
+ * @example
1893
+ * ```ts
1894
+ * import { Option } from "effect"
1895
+ *
1896
+ * interface Employee {
1897
+ * company?: {
1898
+ * address?: {
1899
+ * street?: {
1900
+ * name?: string
1901
+ * }
1902
+ * }
1903
+ * }
1904
+ * }
1905
+ *
1906
+ * const employee1: Employee = { company: { address: { street: { name: "high street" } } } }
1907
+ *
1908
+ * // Extracting a deeply nested property
1909
+ * console.log(
1910
+ * Option.some(employee1)
1911
+ * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))
1912
+ * )
1913
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'high street' }
1914
+ *
1915
+ * const employee2: Employee = { company: { address: { street: {} } } }
1916
+ *
1917
+ * // Property does not exist
1918
+ * console.log(
1919
+ * Option.some(employee2)
1920
+ * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))
1921
+ * )
1922
+ * // Output: { _id: 'Option', _tag: 'None' }
1923
+ * ```
1924
+ *
1925
+ * @category Sequencing
1926
+ * @since 2.0.0
1927
+ */
1928
+ export const flatMapNullable: {
1929
+ /**
1930
+ * Combines `flatMap` and `fromNullable`, transforming the value inside a `Some`
1931
+ * using a function that may return `null` or `undefined`.
1932
+ *
1933
+ * **Details**
1934
+ *
1935
+ * This function applies a transformation function `f` to the value inside a
1936
+ * `Some`. The function `f` may return a value, `null`, or `undefined`. If `f`
1937
+ * returns a value, it is wrapped in a `Some`. If `f` returns `null` or
1938
+ * `undefined`, the result is `None`. If the input `Option` is `None`, the
1939
+ * function is not applied, and `None` is returned.
1940
+ *
1941
+ * This utility is particularly useful when working with deeply nested optional
1942
+ * values or chaining computations that may result in `null` or `undefined` at
1943
+ * some point.
1944
+ *
1945
+ * @example
1946
+ * ```ts
1947
+ * import { Option } from "effect"
1948
+ *
1949
+ * interface Employee {
1950
+ * company?: {
1951
+ * address?: {
1952
+ * street?: {
1953
+ * name?: string
1954
+ * }
1955
+ * }
1956
+ * }
1957
+ * }
1958
+ *
1959
+ * const employee1: Employee = { company: { address: { street: { name: "high street" } } } }
1960
+ *
1961
+ * // Extracting a deeply nested property
1962
+ * console.log(
1963
+ * Option.some(employee1)
1964
+ * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))
1965
+ * )
1966
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'high street' }
1967
+ *
1968
+ * const employee2: Employee = { company: { address: { street: {} } } }
1969
+ *
1970
+ * // Property does not exist
1971
+ * console.log(
1972
+ * Option.some(employee2)
1973
+ * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))
1974
+ * )
1975
+ * // Output: { _id: 'Option', _tag: 'None' }
1976
+ * ```
1977
+ *
1978
+ * @category Sequencing
1979
+ * @since 2.0.0
1980
+ */
1981
+ <A, B>(f: (a: A) => B | null | undefined): (self: Option<A>) => Option<NonNullable<B>>
1982
+ /**
1983
+ * Combines `flatMap` and `fromNullable`, transforming the value inside a `Some`
1984
+ * using a function that may return `null` or `undefined`.
1985
+ *
1986
+ * **Details**
1987
+ *
1988
+ * This function applies a transformation function `f` to the value inside a
1989
+ * `Some`. The function `f` may return a value, `null`, or `undefined`. If `f`
1990
+ * returns a value, it is wrapped in a `Some`. If `f` returns `null` or
1991
+ * `undefined`, the result is `None`. If the input `Option` is `None`, the
1992
+ * function is not applied, and `None` is returned.
1993
+ *
1994
+ * This utility is particularly useful when working with deeply nested optional
1995
+ * values or chaining computations that may result in `null` or `undefined` at
1996
+ * some point.
1997
+ *
1998
+ * @example
1999
+ * ```ts
2000
+ * import { Option } from "effect"
2001
+ *
2002
+ * interface Employee {
2003
+ * company?: {
2004
+ * address?: {
2005
+ * street?: {
2006
+ * name?: string
2007
+ * }
2008
+ * }
2009
+ * }
2010
+ * }
2011
+ *
2012
+ * const employee1: Employee = { company: { address: { street: { name: "high street" } } } }
2013
+ *
2014
+ * // Extracting a deeply nested property
2015
+ * console.log(
2016
+ * Option.some(employee1)
2017
+ * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))
2018
+ * )
2019
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'high street' }
2020
+ *
2021
+ * const employee2: Employee = { company: { address: { street: {} } } }
2022
+ *
2023
+ * // Property does not exist
2024
+ * console.log(
2025
+ * Option.some(employee2)
2026
+ * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))
2027
+ * )
2028
+ * // Output: { _id: 'Option', _tag: 'None' }
2029
+ * ```
2030
+ *
2031
+ * @category Sequencing
2032
+ * @since 2.0.0
2033
+ */
2034
+ <A, B>(self: Option<A>, f: (a: A) => B | null | undefined): Option<NonNullable<B>>
2035
+ } = dual(
2036
+ 2,
2037
+ <A, B>(self: Option<A>, f: (a: A) => B | null | undefined): Option<NonNullable<B>> =>
2038
+ isNone(self) ? none() : fromNullable(f(self.value))
2039
+ )
2040
+
2041
+ /**
2042
+ * Flattens an `Option` of `Option` into a single `Option`.
2043
+ *
2044
+ * **Details**
2045
+ *
2046
+ * This function takes an `Option` that wraps another `Option` and flattens it
2047
+ * into a single `Option`. If the outer `Option` is `Some`, the function
2048
+ * extracts the inner `Option`. If the outer `Option` is `None`, the result
2049
+ * remains `None`.
2050
+ *
2051
+ * This is useful for simplifying nested `Option` structures that may arise
2052
+ * during functional operations.
2053
+ *
2054
+ * @category Sequencing
2055
+ * @since 2.0.0
2056
+ */
2057
+ export const flatten: <A>(self: Option<Option<A>>) => Option<A> = flatMap(identity)
2058
+
2059
+ /**
2060
+ * Combines two `Option`s, keeping the value from the second `Option` if both
2061
+ * are `Some`.
2062
+ *
2063
+ * **Details**
2064
+ *
2065
+ * This function takes two `Option`s and returns the second one if the first is
2066
+ * `Some`. If the first `Option` is `None`, the result will also be `None`,
2067
+ * regardless of the second `Option`. It effectively "zips" the two `Option`s
2068
+ * while discarding the value from the first `Option`.
2069
+ *
2070
+ * This is particularly useful when sequencing computations where the result of
2071
+ * the first computation is not needed, and you only care about the result of
2072
+ * the second computation.
2073
+ *
2074
+ * @category Zipping
2075
+ * @since 2.0.0
2076
+ */
2077
+ export const zipRight: {
2078
+ /**
2079
+ * Combines two `Option`s, keeping the value from the second `Option` if both
2080
+ * are `Some`.
2081
+ *
2082
+ * **Details**
2083
+ *
2084
+ * This function takes two `Option`s and returns the second one if the first is
2085
+ * `Some`. If the first `Option` is `None`, the result will also be `None`,
2086
+ * regardless of the second `Option`. It effectively "zips" the two `Option`s
2087
+ * while discarding the value from the first `Option`.
2088
+ *
2089
+ * This is particularly useful when sequencing computations where the result of
2090
+ * the first computation is not needed, and you only care about the result of
2091
+ * the second computation.
2092
+ *
2093
+ * @category Zipping
2094
+ * @since 2.0.0
2095
+ */
2096
+ <B>(that: Option<B>): <_>(self: Option<_>) => Option<B>
2097
+ /**
2098
+ * Combines two `Option`s, keeping the value from the second `Option` if both
2099
+ * are `Some`.
2100
+ *
2101
+ * **Details**
2102
+ *
2103
+ * This function takes two `Option`s and returns the second one if the first is
2104
+ * `Some`. If the first `Option` is `None`, the result will also be `None`,
2105
+ * regardless of the second `Option`. It effectively "zips" the two `Option`s
2106
+ * while discarding the value from the first `Option`.
2107
+ *
2108
+ * This is particularly useful when sequencing computations where the result of
2109
+ * the first computation is not needed, and you only care about the result of
2110
+ * the second computation.
2111
+ *
2112
+ * @category Zipping
2113
+ * @since 2.0.0
2114
+ */
2115
+ <X, B>(self: Option<X>, that: Option<B>): Option<B>
2116
+ } = dual(2, <X, B>(self: Option<X>, that: Option<B>): Option<B> => flatMap(self, () => that))
2117
+
2118
+ /**
2119
+ * Combines two `Option`s, keeping the value from the first `Option` if both are
2120
+ * `Some`.
2121
+ *
2122
+ * **Details**
2123
+ *
2124
+ * This function takes two `Option`s and returns the first one if it is `Some`.
2125
+ * If either the first `Option` or the second `Option` is `None`, the result
2126
+ * will be `None`. This operation "zips" the two `Option`s while discarding the
2127
+ * value from the second `Option`.
2128
+ *
2129
+ * This is useful when sequencing computations where the second `Option`
2130
+ * represents a dependency or condition that must hold, but its value is
2131
+ * irrelevant.
2132
+ *
2133
+ * @category Zipping
2134
+ * @since 2.0.0
2135
+ */
2136
+ export const zipLeft: {
2137
+ /**
2138
+ * Combines two `Option`s, keeping the value from the first `Option` if both are
2139
+ * `Some`.
2140
+ *
2141
+ * **Details**
2142
+ *
2143
+ * This function takes two `Option`s and returns the first one if it is `Some`.
2144
+ * If either the first `Option` or the second `Option` is `None`, the result
2145
+ * will be `None`. This operation "zips" the two `Option`s while discarding the
2146
+ * value from the second `Option`.
2147
+ *
2148
+ * This is useful when sequencing computations where the second `Option`
2149
+ * represents a dependency or condition that must hold, but its value is
2150
+ * irrelevant.
2151
+ *
2152
+ * @category Zipping
2153
+ * @since 2.0.0
2154
+ */
2155
+ <_>(that: Option<_>): <A>(self: Option<A>) => Option<A>
2156
+ /**
2157
+ * Combines two `Option`s, keeping the value from the first `Option` if both are
2158
+ * `Some`.
2159
+ *
2160
+ * **Details**
2161
+ *
2162
+ * This function takes two `Option`s and returns the first one if it is `Some`.
2163
+ * If either the first `Option` or the second `Option` is `None`, the result
2164
+ * will be `None`. This operation "zips" the two `Option`s while discarding the
2165
+ * value from the second `Option`.
2166
+ *
2167
+ * This is useful when sequencing computations where the second `Option`
2168
+ * represents a dependency or condition that must hold, but its value is
2169
+ * irrelevant.
2170
+ *
2171
+ * @category Zipping
2172
+ * @since 2.0.0
2173
+ */
2174
+ <A, X>(self: Option<A>, that: Option<X>): Option<A>
2175
+ } = dual(2, <A, X>(self: Option<A>, that: Option<X>): Option<A> => tap(self, () => that))
2176
+
2177
+ /**
2178
+ * Composes two functions that return `Option` values, creating a new function
2179
+ * that chains them together.
2180
+ *
2181
+ * **Details**
2182
+ *
2183
+ * This function allows you to compose two computations, each represented by a
2184
+ * function that returns an `Option`. The result of the first function is passed
2185
+ * to the second function if it is `Some`. If the first function returns `None`,
2186
+ * the composed function short-circuits and returns `None` without invoking the
2187
+ * second function.
2188
+ *
2189
+ * @example
2190
+ * ```ts
2191
+ * import { Option } from "effect"
2192
+ *
2193
+ * const parse = (s: string): Option.Option<number> => isNaN(Number(s)) ? Option.none() : Option.some(Number(s))
2194
+ *
2195
+ * const double = (n: number): Option.Option<number> => n > 0 ? Option.some(n * 2) : Option.none()
2196
+ *
2197
+ * const parseAndDouble = Option.composeK(parse, double)
2198
+ *
2199
+ * console.log(parseAndDouble("42"))
2200
+ * // Output: { _id: 'Option', _tag: 'Some', value: 84 }
2201
+ *
2202
+ * console.log(parseAndDouble("not a number"))
2203
+ * // Output: { _id: 'Option', _tag: 'None' }
2204
+ * ```
2205
+ *
2206
+ * @category Sequencing
2207
+ * @since 2.0.0
2208
+ */
2209
+ export const composeK: {
2210
+ /**
2211
+ * Composes two functions that return `Option` values, creating a new function
2212
+ * that chains them together.
2213
+ *
2214
+ * **Details**
2215
+ *
2216
+ * This function allows you to compose two computations, each represented by a
2217
+ * function that returns an `Option`. The result of the first function is passed
2218
+ * to the second function if it is `Some`. If the first function returns `None`,
2219
+ * the composed function short-circuits and returns `None` without invoking the
2220
+ * second function.
2221
+ *
2222
+ * @example
2223
+ * ```ts
2224
+ * import { Option } from "effect"
2225
+ *
2226
+ * const parse = (s: string): Option.Option<number> => isNaN(Number(s)) ? Option.none() : Option.some(Number(s))
2227
+ *
2228
+ * const double = (n: number): Option.Option<number> => n > 0 ? Option.some(n * 2) : Option.none()
2229
+ *
2230
+ * const parseAndDouble = Option.composeK(parse, double)
2231
+ *
2232
+ * console.log(parseAndDouble("42"))
2233
+ * // Output: { _id: 'Option', _tag: 'Some', value: 84 }
2234
+ *
2235
+ * console.log(parseAndDouble("not a number"))
2236
+ * // Output: { _id: 'Option', _tag: 'None' }
2237
+ * ```
2238
+ *
2239
+ * @category Sequencing
2240
+ * @since 2.0.0
2241
+ */
2242
+ <B, C>(bfc: (b: B) => Option<C>): <A>(afb: (a: A) => Option<B>) => (a: A) => Option<C>
2243
+ /**
2244
+ * Composes two functions that return `Option` values, creating a new function
2245
+ * that chains them together.
2246
+ *
2247
+ * **Details**
2248
+ *
2249
+ * This function allows you to compose two computations, each represented by a
2250
+ * function that returns an `Option`. The result of the first function is passed
2251
+ * to the second function if it is `Some`. If the first function returns `None`,
2252
+ * the composed function short-circuits and returns `None` without invoking the
2253
+ * second function.
2254
+ *
2255
+ * @example
2256
+ * ```ts
2257
+ * import { Option } from "effect"
2258
+ *
2259
+ * const parse = (s: string): Option.Option<number> => isNaN(Number(s)) ? Option.none() : Option.some(Number(s))
2260
+ *
2261
+ * const double = (n: number): Option.Option<number> => n > 0 ? Option.some(n * 2) : Option.none()
2262
+ *
2263
+ * const parseAndDouble = Option.composeK(parse, double)
2264
+ *
2265
+ * console.log(parseAndDouble("42"))
2266
+ * // Output: { _id: 'Option', _tag: 'Some', value: 84 }
2267
+ *
2268
+ * console.log(parseAndDouble("not a number"))
2269
+ * // Output: { _id: 'Option', _tag: 'None' }
2270
+ * ```
2271
+ *
2272
+ * @category Sequencing
2273
+ * @since 2.0.0
2274
+ */
2275
+ <A, B, C>(afb: (a: A) => Option<B>, bfc: (b: B) => Option<C>): (a: A) => Option<C>
2276
+ } = dual(2, <A, B, C>(afb: (a: A) => Option<B>, bfc: (b: B) => Option<C>) => (a: A): Option<C> => flatMap(afb(a), bfc))
2277
+
2278
+ /**
2279
+ * Applies the provided function `f` to the value of the `Option` if it is
2280
+ * `Some` and returns the original `Option`, unless `f` returns `None`, in which
2281
+ * case it returns `None`.
2282
+ *
2283
+ * **Details**
2284
+ *
2285
+ * This function allows you to perform additional computations on the value of
2286
+ * an `Option` without modifying its original value. If the `Option` is `Some`,
2287
+ * the provided function `f` is executed with the value, and its result
2288
+ * determines whether the original `Option` is returned (`Some`) or the result
2289
+ * is `None` if `f` returns `None`. If the input `Option` is `None`, the
2290
+ * function is not executed, and `None` is returned.
2291
+ *
2292
+ * This is particularly useful for applying side conditions or performing
2293
+ * validation checks while retaining the original `Option`'s value.
2294
+ *
2295
+ * @example
2296
+ * ```ts
2297
+ * import { Option } from "effect"
2298
+ *
2299
+ * const getInteger = (n: number) => Number.isInteger(n) ? Option.some(n) : Option.none()
2300
+ *
2301
+ * console.log(Option.tap(Option.none(), getInteger))
2302
+ * // Output: { _id: 'Option', _tag: 'None' }
2303
+ *
2304
+ * console.log(Option.tap(Option.some(1), getInteger))
2305
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
2306
+ *
2307
+ * console.log(Option.tap(Option.some(1.14), getInteger))
2308
+ * // Output: { _id: 'Option', _tag: 'None' }
2309
+ * ```
2310
+ *
2311
+ * @category Sequencing
2312
+ * @since 2.0.0
2313
+ */
2314
+ export const tap: {
2315
+ /**
2316
+ * Applies the provided function `f` to the value of the `Option` if it is
2317
+ * `Some` and returns the original `Option`, unless `f` returns `None`, in which
2318
+ * case it returns `None`.
2319
+ *
2320
+ * **Details**
2321
+ *
2322
+ * This function allows you to perform additional computations on the value of
2323
+ * an `Option` without modifying its original value. If the `Option` is `Some`,
2324
+ * the provided function `f` is executed with the value, and its result
2325
+ * determines whether the original `Option` is returned (`Some`) or the result
2326
+ * is `None` if `f` returns `None`. If the input `Option` is `None`, the
2327
+ * function is not executed, and `None` is returned.
2328
+ *
2329
+ * This is particularly useful for applying side conditions or performing
2330
+ * validation checks while retaining the original `Option`'s value.
2331
+ *
2332
+ * @example
2333
+ * ```ts
2334
+ * import { Option } from "effect"
2335
+ *
2336
+ * const getInteger = (n: number) => Number.isInteger(n) ? Option.some(n) : Option.none()
2337
+ *
2338
+ * console.log(Option.tap(Option.none(), getInteger))
2339
+ * // Output: { _id: 'Option', _tag: 'None' }
2340
+ *
2341
+ * console.log(Option.tap(Option.some(1), getInteger))
2342
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
2343
+ *
2344
+ * console.log(Option.tap(Option.some(1.14), getInteger))
2345
+ * // Output: { _id: 'Option', _tag: 'None' }
2346
+ * ```
2347
+ *
2348
+ * @category Sequencing
2349
+ * @since 2.0.0
2350
+ */
2351
+ <A, X>(f: (a: A) => Option<X>): (self: Option<A>) => Option<A>
2352
+ /**
2353
+ * Applies the provided function `f` to the value of the `Option` if it is
2354
+ * `Some` and returns the original `Option`, unless `f` returns `None`, in which
2355
+ * case it returns `None`.
2356
+ *
2357
+ * **Details**
2358
+ *
2359
+ * This function allows you to perform additional computations on the value of
2360
+ * an `Option` without modifying its original value. If the `Option` is `Some`,
2361
+ * the provided function `f` is executed with the value, and its result
2362
+ * determines whether the original `Option` is returned (`Some`) or the result
2363
+ * is `None` if `f` returns `None`. If the input `Option` is `None`, the
2364
+ * function is not executed, and `None` is returned.
2365
+ *
2366
+ * This is particularly useful for applying side conditions or performing
2367
+ * validation checks while retaining the original `Option`'s value.
2368
+ *
2369
+ * @example
2370
+ * ```ts
2371
+ * import { Option } from "effect"
2372
+ *
2373
+ * const getInteger = (n: number) => Number.isInteger(n) ? Option.some(n) : Option.none()
2374
+ *
2375
+ * console.log(Option.tap(Option.none(), getInteger))
2376
+ * // Output: { _id: 'Option', _tag: 'None' }
2377
+ *
2378
+ * console.log(Option.tap(Option.some(1), getInteger))
2379
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
2380
+ *
2381
+ * console.log(Option.tap(Option.some(1.14), getInteger))
2382
+ * // Output: { _id: 'Option', _tag: 'None' }
2383
+ * ```
2384
+ *
2385
+ * @category Sequencing
2386
+ * @since 2.0.0
2387
+ */
2388
+ <A, X>(self: Option<A>, f: (a: A) => Option<X>): Option<A>
2389
+ } = dual(2, <A, X>(self: Option<A>, f: (a: A) => Option<X>): Option<A> => flatMap(self, (a) => map(f(a), () => a)))
2390
+
2391
+ /**
2392
+ * Combines two `Option` values into a single `Option` containing a tuple of
2393
+ * their values if both are `Some`.
2394
+ *
2395
+ * **Details**
2396
+ *
2397
+ * This function takes two `Option`s and combines their values into a tuple `[A,
2398
+ * B]` if both are `Some`. If either of the `Option`s is `None`, the result is
2399
+ * `None`. This is particularly useful for combining multiple `Option` values
2400
+ * into a single one, ensuring both contain valid values.
2401
+ *
2402
+ * @category Combining
2403
+ * @since 2.0.0
2404
+ */
2405
+ export const product = <A, B>(self: Option<A>, that: Option<B>): Option<[A, B]> =>
2406
+ isSome(self) && isSome(that) ? some([self.value, that.value]) : none()
2407
+
2408
+ /**
2409
+ * Combines an `Option` with a collection of `Option`s into a single `Option`
2410
+ * containing a tuple of their values if all are `Some`.
2411
+ *
2412
+ * **Details**
2413
+ *
2414
+ * This function takes a primary `Option` and a collection of `Option`s and
2415
+ * combines their values into a tuple `[A, ...Array<A>]` if all are `Some`. If
2416
+ * the primary `Option` or any `Option` in the collection is `None`, the result
2417
+ * is `None`.
2418
+ *
2419
+ * @category Combining
2420
+ * @since 2.0.0
2421
+ */
2422
+ export const productMany = <A>(
2423
+ self: Option<A>,
2424
+ collection: Iterable<Option<A>>
2425
+ ): Option<[A, ...Array<A>]> => {
2426
+ if (isNone(self)) {
2427
+ return none()
2428
+ }
2429
+ const out: [A, ...Array<A>] = [self.value]
2430
+ for (const o of collection) {
2431
+ if (isNone(o)) {
2432
+ return none()
2433
+ }
2434
+ out.push(o.value)
2435
+ }
2436
+ return some(out)
2437
+ }
2438
+
2439
+ /**
2440
+ * Combines a structure of `Option`s into a single `Option` containing the
2441
+ * values with the same structure.
2442
+ *
2443
+ * **Details**
2444
+ *
2445
+ * This function takes a structure of `Option`s (a tuple, struct, or iterable)
2446
+ * and produces a single `Option` that contains the values from the input
2447
+ * structure if all `Option`s are `Some`. If any `Option` in the input is
2448
+ * `None`, the result is `None`. The structure of the input is preserved in the
2449
+ * output.
2450
+ *
2451
+ * - If the input is a tuple (e.g., an array), the result will be an `Option`
2452
+ * containing a tuple with the same length.
2453
+ * - If the input is a struct (e.g., an object), the result will be an `Option`
2454
+ * containing a struct with the same keys.
2455
+ * - If the input is an iterable, the result will be an `Option` containing an
2456
+ * array.
2457
+ *
2458
+ * @example
2459
+ * ```ts
2460
+ * import { Option } from "effect"
2461
+ *
2462
+ * const maybeName: Option.Option<string> = Option.some("John")
2463
+ * const maybeAge: Option.Option<number> = Option.some(25)
2464
+ *
2465
+ * // ┌─── Option<[string, number]>
2466
+ * // ▼
2467
+ * const tuple = Option.all([maybeName, maybeAge])
2468
+ * console.log(tuple)
2469
+ * // Output:
2470
+ * // { _id: 'Option', _tag: 'Some', value: [ 'John', 25 ] }
2471
+ *
2472
+ * // ┌─── Option<{ name: string; age: number; }>
2473
+ * // ▼
2474
+ * const struct = Option.all({ name: maybeName, age: maybeAge })
2475
+ * console.log(struct)
2476
+ * // Output:
2477
+ * // { _id: 'Option', _tag: 'Some', value: { name: 'John', age: 25 } }
2478
+ * ```
2479
+ *
2480
+ * @category Combining
2481
+ * @since 2.0.0
2482
+ */
2483
+ // @ts-expect-error
2484
+ export const all: <const I extends Iterable<Option<any>> | Record<string, Option<any>>>(
2485
+ input: I
2486
+ ) => [I] extends [ReadonlyArray<Option<any>>] ? Option<
2487
+ { -readonly [K in keyof I]: [I[K]] extends [Option<infer A>] ? A : never }
2488
+ >
2489
+ : [I] extends [Iterable<Option<infer A>>] ? Option<Array<A>>
2490
+ : Option<{ -readonly [K in keyof I]: [I[K]] extends [Option<infer A>] ? A : never }> = (
2491
+ input: Iterable<Option<any>> | Record<string, Option<any>>
2492
+ ): Option<any> => {
2493
+ if (Symbol.iterator in input) {
2494
+ const out: Array<Option<any>> = []
2495
+ for (const o of (input as Iterable<Option<any>>)) {
2496
+ if (isNone(o)) {
2497
+ return none()
2498
+ }
2499
+ out.push(o.value)
2500
+ }
2501
+ return some(out)
2502
+ }
2503
+
2504
+ const out: Record<string, any> = {}
2505
+ for (const key of Object.keys(input)) {
2506
+ const o = input[key]
2507
+ if (isNone(o)) {
2508
+ return none()
2509
+ }
2510
+ out[key] = o.value
2511
+ }
2512
+ return some(out)
2513
+ }
2514
+
2515
+ /**
2516
+ * Combines two `Option` values into a new `Option` by applying a provided
2517
+ * function to their values.
2518
+ *
2519
+ * **Details**
2520
+ *
2521
+ * This function takes two `Option` values (`self` and `that`) and a combining
2522
+ * function `f`. If both `Option` values are `Some`, the function `f` is applied
2523
+ * to their values, and the result is wrapped in a new `Some`. If either
2524
+ * `Option` is `None`, the result is `None`.
2525
+ *
2526
+ * This utility is useful for combining two optional computations into a single
2527
+ * result while maintaining type safety and avoiding explicit checks for `None`.
2528
+ *
2529
+ * @example
2530
+ * ```ts
2531
+ * import { Option } from "effect"
2532
+ *
2533
+ * const maybeName: Option.Option<string> = Option.some("John")
2534
+ * const maybeAge: Option.Option<number> = Option.some(25)
2535
+ *
2536
+ * // Combine the name and age into a person object
2537
+ * const person = Option.zipWith(maybeName, maybeAge, (name, age) => ({
2538
+ * name: name.toUpperCase(),
2539
+ * age
2540
+ * }))
2541
+ *
2542
+ * console.log(person)
2543
+ * // Output:
2544
+ * // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }
2545
+ * ```
2546
+ *
2547
+ * @category Zipping
2548
+ * @since 2.0.0
2549
+ */
2550
+ export const zipWith: {
2551
+ /**
2552
+ * Combines two `Option` values into a new `Option` by applying a provided
2553
+ * function to their values.
2554
+ *
2555
+ * **Details**
2556
+ *
2557
+ * This function takes two `Option` values (`self` and `that`) and a combining
2558
+ * function `f`. If both `Option` values are `Some`, the function `f` is applied
2559
+ * to their values, and the result is wrapped in a new `Some`. If either
2560
+ * `Option` is `None`, the result is `None`.
2561
+ *
2562
+ * This utility is useful for combining two optional computations into a single
2563
+ * result while maintaining type safety and avoiding explicit checks for `None`.
2564
+ *
2565
+ * @example
2566
+ * ```ts
2567
+ * import { Option } from "effect"
2568
+ *
2569
+ * const maybeName: Option.Option<string> = Option.some("John")
2570
+ * const maybeAge: Option.Option<number> = Option.some(25)
2571
+ *
2572
+ * // Combine the name and age into a person object
2573
+ * const person = Option.zipWith(maybeName, maybeAge, (name, age) => ({
2574
+ * name: name.toUpperCase(),
2575
+ * age
2576
+ * }))
2577
+ *
2578
+ * console.log(person)
2579
+ * // Output:
2580
+ * // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }
2581
+ * ```
2582
+ *
2583
+ * @category Zipping
2584
+ * @since 2.0.0
2585
+ */
2586
+ <B, A, C>(that: Option<B>, f: (a: A, b: B) => C): (self: Option<A>) => Option<C>
2587
+ /**
2588
+ * Combines two `Option` values into a new `Option` by applying a provided
2589
+ * function to their values.
2590
+ *
2591
+ * **Details**
2592
+ *
2593
+ * This function takes two `Option` values (`self` and `that`) and a combining
2594
+ * function `f`. If both `Option` values are `Some`, the function `f` is applied
2595
+ * to their values, and the result is wrapped in a new `Some`. If either
2596
+ * `Option` is `None`, the result is `None`.
2597
+ *
2598
+ * This utility is useful for combining two optional computations into a single
2599
+ * result while maintaining type safety and avoiding explicit checks for `None`.
2600
+ *
2601
+ * @example
2602
+ * ```ts
2603
+ * import { Option } from "effect"
2604
+ *
2605
+ * const maybeName: Option.Option<string> = Option.some("John")
2606
+ * const maybeAge: Option.Option<number> = Option.some(25)
2607
+ *
2608
+ * // Combine the name and age into a person object
2609
+ * const person = Option.zipWith(maybeName, maybeAge, (name, age) => ({
2610
+ * name: name.toUpperCase(),
2611
+ * age
2612
+ * }))
2613
+ *
2614
+ * console.log(person)
2615
+ * // Output:
2616
+ * // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }
2617
+ * ```
2618
+ *
2619
+ * @category Zipping
2620
+ * @since 2.0.0
2621
+ */
2622
+ <A, B, C>(self: Option<A>, that: Option<B>, f: (a: A, b: B) => C): Option<C>
2623
+ } = dual(
2624
+ 3,
2625
+ <A, B, C>(self: Option<A>, that: Option<B>, f: (a: A, b: B) => C): Option<C> =>
2626
+ map(product(self, that), ([a, b]) => f(a, b))
2627
+ )
2628
+
2629
+ /**
2630
+ * Applies a function inside a `Some` to a value inside another `Some`,
2631
+ * combining them into a new `Option`.
2632
+ *
2633
+ * **Details**
2634
+ *
2635
+ * This function allows you to apply a function wrapped in an `Option` (`self`)
2636
+ * to a value wrapped in another `Option` (`that`). If both `Option`s are
2637
+ * `Some`, the function is applied to the value, and the result is wrapped in a
2638
+ * new `Some`. If either `Option` is `None`, the result is `None`.
2639
+ *
2640
+ * @category Combining
2641
+ * @since 2.0.0
2642
+ */
2643
+ export const ap: {
2644
+ /**
2645
+ * Applies a function inside a `Some` to a value inside another `Some`,
2646
+ * combining them into a new `Option`.
2647
+ *
2648
+ * **Details**
2649
+ *
2650
+ * This function allows you to apply a function wrapped in an `Option` (`self`)
2651
+ * to a value wrapped in another `Option` (`that`). If both `Option`s are
2652
+ * `Some`, the function is applied to the value, and the result is wrapped in a
2653
+ * new `Some`. If either `Option` is `None`, the result is `None`.
2654
+ *
2655
+ * @category Combining
2656
+ * @since 2.0.0
2657
+ */
2658
+ <A>(that: Option<A>): <B>(self: Option<(a: A) => B>) => Option<B>
2659
+ /**
2660
+ * Applies a function inside a `Some` to a value inside another `Some`,
2661
+ * combining them into a new `Option`.
2662
+ *
2663
+ * **Details**
2664
+ *
2665
+ * This function allows you to apply a function wrapped in an `Option` (`self`)
2666
+ * to a value wrapped in another `Option` (`that`). If both `Option`s are
2667
+ * `Some`, the function is applied to the value, and the result is wrapped in a
2668
+ * new `Some`. If either `Option` is `None`, the result is `None`.
2669
+ *
2670
+ * @category Combining
2671
+ * @since 2.0.0
2672
+ */
2673
+ <A, B>(self: Option<(a: A) => B>, that: Option<A>): Option<B>
2674
+ } = dual(2, <A, B>(self: Option<(a: A) => B>, that: Option<A>): Option<B> => zipWith(self, that, (f, a) => f(a)))
2675
+
2676
+ /**
2677
+ * Reduces an `Iterable` of `Option<A>` to a single value of type `B`, ignoring
2678
+ * elements that are `None`.
2679
+ *
2680
+ * **Details**
2681
+ *
2682
+ * This function takes an initial value of type `B` and a reducing function `f`
2683
+ * that combines the accumulator with values of type `A`. It processes an
2684
+ * iterable of `Option<A>`, applying `f` only to the `Some` values while
2685
+ * ignoring the `None` values. The result is a single value of type `B`.
2686
+ *
2687
+ * This utility is particularly useful for aggregating values from an iterable
2688
+ * of `Option`s while skipping the absent (`None`) values.
2689
+ *
2690
+ * @example
2691
+ * ```ts
2692
+ * import { Option, pipe } from "effect"
2693
+ *
2694
+ * const iterable = [Option.some(1), Option.none(), Option.some(2), Option.none()]
2695
+ *
2696
+ * console.log(pipe(iterable, Option.reduceCompact(0, (b, a) => b + a)))
2697
+ * // Output: 3
2698
+ * ```
2699
+ *
2700
+ * @category Reducing
2701
+ * @since 2.0.0
2702
+ */
2703
+ export const reduceCompact: {
2704
+ /**
2705
+ * Reduces an `Iterable` of `Option<A>` to a single value of type `B`, ignoring
2706
+ * elements that are `None`.
2707
+ *
2708
+ * **Details**
2709
+ *
2710
+ * This function takes an initial value of type `B` and a reducing function `f`
2711
+ * that combines the accumulator with values of type `A`. It processes an
2712
+ * iterable of `Option<A>`, applying `f` only to the `Some` values while
2713
+ * ignoring the `None` values. The result is a single value of type `B`.
2714
+ *
2715
+ * This utility is particularly useful for aggregating values from an iterable
2716
+ * of `Option`s while skipping the absent (`None`) values.
2717
+ *
2718
+ * @example
2719
+ * ```ts
2720
+ * import { Option, pipe } from "effect"
2721
+ *
2722
+ * const iterable = [Option.some(1), Option.none(), Option.some(2), Option.none()]
2723
+ *
2724
+ * console.log(pipe(iterable, Option.reduceCompact(0, (b, a) => b + a)))
2725
+ * // Output: 3
2726
+ * ```
2727
+ *
2728
+ * @category Reducing
2729
+ * @since 2.0.0
2730
+ */
2731
+ <B, A>(b: B, f: (b: B, a: A) => B): (self: Iterable<Option<A>>) => B
2732
+ /**
2733
+ * Reduces an `Iterable` of `Option<A>` to a single value of type `B`, ignoring
2734
+ * elements that are `None`.
2735
+ *
2736
+ * **Details**
2737
+ *
2738
+ * This function takes an initial value of type `B` and a reducing function `f`
2739
+ * that combines the accumulator with values of type `A`. It processes an
2740
+ * iterable of `Option<A>`, applying `f` only to the `Some` values while
2741
+ * ignoring the `None` values. The result is a single value of type `B`.
2742
+ *
2743
+ * This utility is particularly useful for aggregating values from an iterable
2744
+ * of `Option`s while skipping the absent (`None`) values.
2745
+ *
2746
+ * @example
2747
+ * ```ts
2748
+ * import { Option, pipe } from "effect"
2749
+ *
2750
+ * const iterable = [Option.some(1), Option.none(), Option.some(2), Option.none()]
2751
+ *
2752
+ * console.log(pipe(iterable, Option.reduceCompact(0, (b, a) => b + a)))
2753
+ * // Output: 3
2754
+ * ```
2755
+ *
2756
+ * @category Reducing
2757
+ * @since 2.0.0
2758
+ */
2759
+ <A, B>(self: Iterable<Option<A>>, b: B, f: (b: B, a: A) => B): B
2760
+ } = dual(
2761
+ 3,
2762
+ <A, B>(self: Iterable<Option<A>>, b: B, f: (b: B, a: A) => B): B => {
2763
+ let out: B = b
2764
+ for (const oa of self) {
2765
+ if (isSome(oa)) {
2766
+ out = f(out, oa.value)
2767
+ }
2768
+ }
2769
+ return out
2770
+ }
2771
+ )
2772
+
2773
+ /**
2774
+ * Converts an `Option` into an `Array`.
2775
+ * If the input is `None`, an empty array is returned.
2776
+ * If the input is `Some`, its value is wrapped in a single-element array.
2777
+ *
2778
+ * @example
2779
+ * ```ts
2780
+ * import { Option } from "effect"
2781
+ *
2782
+ * console.log(Option.toArray(Option.some(1)))
2783
+ * // Output: [1]
2784
+ *
2785
+ * console.log(Option.toArray(Option.none()))
2786
+ * // Output: []
2787
+ * ```
2788
+ *
2789
+ * @category Conversions
2790
+ * @since 2.0.0
2791
+ */
2792
+ export const toArray = <A>(self: Option<A>): Array<A> => isNone(self) ? [] : [self.value]
2793
+
2794
+ /**
2795
+ * Splits an `Option` into two `Option`s based on the result of a mapping
2796
+ * function that produces an `Either`.
2797
+ *
2798
+ * **Details**
2799
+ *
2800
+ * This function takes an `Option` and a mapping function `f` that converts its
2801
+ * value into an `Either`. It returns a tuple of two `Option`s:
2802
+ *
2803
+ * - The first `Option` (`left`) contains the value from the `Left` side of the
2804
+ * `Either` if it exists, otherwise `None`.
2805
+ * - The second `Option` (`right`) contains the value from the `Right` side of
2806
+ * the `Either` if it exists, otherwise `None`.
2807
+ *
2808
+ * If the input `Option` is `None`, both returned `Option`s are `None`.
2809
+ *
2810
+ * This utility is useful for filtering and categorizing the contents of an
2811
+ * `Option` based on a bifurcating computation.
2812
+ *
2813
+ * @category Filtering
2814
+ * @since 2.0.0
2815
+ */
2816
+ export const partitionMap: {
2817
+ /**
2818
+ * Splits an `Option` into two `Option`s based on the result of a mapping
2819
+ * function that produces an `Either`.
2820
+ *
2821
+ * **Details**
2822
+ *
2823
+ * This function takes an `Option` and a mapping function `f` that converts its
2824
+ * value into an `Either`. It returns a tuple of two `Option`s:
2825
+ *
2826
+ * - The first `Option` (`left`) contains the value from the `Left` side of the
2827
+ * `Either` if it exists, otherwise `None`.
2828
+ * - The second `Option` (`right`) contains the value from the `Right` side of
2829
+ * the `Either` if it exists, otherwise `None`.
2830
+ *
2831
+ * If the input `Option` is `None`, both returned `Option`s are `None`.
2832
+ *
2833
+ * This utility is useful for filtering and categorizing the contents of an
2834
+ * `Option` based on a bifurcating computation.
2835
+ *
2836
+ * @category Filtering
2837
+ * @since 2.0.0
2838
+ */
2839
+ <A, B, C>(f: (a: A) => Either<C, B>): (self: Option<A>) => [left: Option<B>, right: Option<C>]
2840
+ /**
2841
+ * Splits an `Option` into two `Option`s based on the result of a mapping
2842
+ * function that produces an `Either`.
2843
+ *
2844
+ * **Details**
2845
+ *
2846
+ * This function takes an `Option` and a mapping function `f` that converts its
2847
+ * value into an `Either`. It returns a tuple of two `Option`s:
2848
+ *
2849
+ * - The first `Option` (`left`) contains the value from the `Left` side of the
2850
+ * `Either` if it exists, otherwise `None`.
2851
+ * - The second `Option` (`right`) contains the value from the `Right` side of
2852
+ * the `Either` if it exists, otherwise `None`.
2853
+ *
2854
+ * If the input `Option` is `None`, both returned `Option`s are `None`.
2855
+ *
2856
+ * This utility is useful for filtering and categorizing the contents of an
2857
+ * `Option` based on a bifurcating computation.
2858
+ *
2859
+ * @category Filtering
2860
+ * @since 2.0.0
2861
+ */
2862
+ <A, B, C>(self: Option<A>, f: (a: A) => Either<C, B>): [left: Option<B>, right: Option<C>]
2863
+ } = dual(2, <A, B, C>(
2864
+ self: Option<A>,
2865
+ f: (a: A) => Either<C, B>
2866
+ ): [excluded: Option<B>, satisfying: Option<C>] => {
2867
+ if (isNone(self)) {
2868
+ return [none(), none()]
2869
+ }
2870
+ const e = f(self.value)
2871
+ return either.isLeft(e) ? [some(e.left), none()] : [none(), some(e.right)]
2872
+ })
2873
+
2874
+ // TODO(4.0): remove?
2875
+ /**
2876
+ * Alias of {@link flatMap}.
2877
+ *
2878
+ * @example
2879
+ * ```ts
2880
+ * import { Option } from "effect"
2881
+ *
2882
+ * // Transform and filter numbers
2883
+ * const transformEven = (n: Option.Option<number>): Option.Option<string> =>
2884
+ * Option.filterMap(n, (n) => (n % 2 === 0 ? Option.some(`Even: ${n}`) : Option.none()))
2885
+ *
2886
+ * console.log(transformEven(Option.none()))
2887
+ * // Output: { _id: 'Option', _tag: 'None' }
2888
+ *
2889
+ * console.log(transformEven(Option.some(1)))
2890
+ * // Output: { _id: 'Option', _tag: 'None' }
2891
+ *
2892
+ * console.log(transformEven(Option.some(2)))
2893
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'Even: 2' }
2894
+ * ```
2895
+ *
2896
+ * @category Filtering
2897
+ * @since 2.0.0
2898
+ */
2899
+ export const filterMap: {
2900
+ // TODO(4.0): remove?
2901
+ /**
2902
+ * Alias of {@link flatMap}.
2903
+ *
2904
+ * @example
2905
+ * ```ts
2906
+ * import { Option } from "effect"
2907
+ *
2908
+ * // Transform and filter numbers
2909
+ * const transformEven = (n: Option.Option<number>): Option.Option<string> =>
2910
+ * Option.filterMap(n, (n) => (n % 2 === 0 ? Option.some(`Even: ${n}`) : Option.none()))
2911
+ *
2912
+ * console.log(transformEven(Option.none()))
2913
+ * // Output: { _id: 'Option', _tag: 'None' }
2914
+ *
2915
+ * console.log(transformEven(Option.some(1)))
2916
+ * // Output: { _id: 'Option', _tag: 'None' }
2917
+ *
2918
+ * console.log(transformEven(Option.some(2)))
2919
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'Even: 2' }
2920
+ * ```
2921
+ *
2922
+ * @category Filtering
2923
+ * @since 2.0.0
2924
+ */
2925
+ <A, B>(f: (a: A) => Option<B>): (self: Option<A>) => Option<B>
2926
+ // TODO(4.0): remove?
2927
+ /**
2928
+ * Alias of {@link flatMap}.
2929
+ *
2930
+ * @example
2931
+ * ```ts
2932
+ * import { Option } from "effect"
2933
+ *
2934
+ * // Transform and filter numbers
2935
+ * const transformEven = (n: Option.Option<number>): Option.Option<string> =>
2936
+ * Option.filterMap(n, (n) => (n % 2 === 0 ? Option.some(`Even: ${n}`) : Option.none()))
2937
+ *
2938
+ * console.log(transformEven(Option.none()))
2939
+ * // Output: { _id: 'Option', _tag: 'None' }
2940
+ *
2941
+ * console.log(transformEven(Option.some(1)))
2942
+ * // Output: { _id: 'Option', _tag: 'None' }
2943
+ *
2944
+ * console.log(transformEven(Option.some(2)))
2945
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'Even: 2' }
2946
+ * ```
2947
+ *
2948
+ * @category Filtering
2949
+ * @since 2.0.0
2950
+ */
2951
+ <A, B>(self: Option<A>, f: (a: A) => Option<B>): Option<B>
2952
+ } = flatMap
2953
+
2954
+ /**
2955
+ * Filters an `Option` using a predicate. If the predicate is not satisfied or the `Option` is `None` returns `None`.
2956
+ *
2957
+ * If you need to change the type of the `Option` in addition to filtering, see `filterMap`.
2958
+ *
2959
+ * @example
2960
+ * ```ts
2961
+ * import { Option } from "effect"
2962
+ *
2963
+ * const removeEmptyString = (input: Option.Option<string>) =>
2964
+ * Option.filter(input, (value) => value !== "")
2965
+ *
2966
+ * console.log(removeEmptyString(Option.none()))
2967
+ * // Output: { _id: 'Option', _tag: 'None' }
2968
+ *
2969
+ * console.log(removeEmptyString(Option.some("")))
2970
+ * // Output: { _id: 'Option', _tag: 'None' }
2971
+ *
2972
+ * console.log(removeEmptyString(Option.some("a")))
2973
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
2974
+ * ```
2975
+ *
2976
+ * @category Filtering
2977
+ * @since 2.0.0
2978
+ */
2979
+ export const filter: {
2980
+ /**
2981
+ * Filters an `Option` using a predicate. If the predicate is not satisfied or the `Option` is `None` returns `None`.
2982
+ *
2983
+ * If you need to change the type of the `Option` in addition to filtering, see `filterMap`.
2984
+ *
2985
+ * @example
2986
+ * ```ts
2987
+ * import { Option } from "effect"
2988
+ *
2989
+ * const removeEmptyString = (input: Option.Option<string>) =>
2990
+ * Option.filter(input, (value) => value !== "")
2991
+ *
2992
+ * console.log(removeEmptyString(Option.none()))
2993
+ * // Output: { _id: 'Option', _tag: 'None' }
2994
+ *
2995
+ * console.log(removeEmptyString(Option.some("")))
2996
+ * // Output: { _id: 'Option', _tag: 'None' }
2997
+ *
2998
+ * console.log(removeEmptyString(Option.some("a")))
2999
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
3000
+ * ```
3001
+ *
3002
+ * @category Filtering
3003
+ * @since 2.0.0
3004
+ */
3005
+ <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Option<A>) => Option<B>
3006
+ /**
3007
+ * Filters an `Option` using a predicate. If the predicate is not satisfied or the `Option` is `None` returns `None`.
3008
+ *
3009
+ * If you need to change the type of the `Option` in addition to filtering, see `filterMap`.
3010
+ *
3011
+ * @example
3012
+ * ```ts
3013
+ * import { Option } from "effect"
3014
+ *
3015
+ * const removeEmptyString = (input: Option.Option<string>) =>
3016
+ * Option.filter(input, (value) => value !== "")
3017
+ *
3018
+ * console.log(removeEmptyString(Option.none()))
3019
+ * // Output: { _id: 'Option', _tag: 'None' }
3020
+ *
3021
+ * console.log(removeEmptyString(Option.some("")))
3022
+ * // Output: { _id: 'Option', _tag: 'None' }
3023
+ *
3024
+ * console.log(removeEmptyString(Option.some("a")))
3025
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
3026
+ * ```
3027
+ *
3028
+ * @category Filtering
3029
+ * @since 2.0.0
3030
+ */
3031
+ <A>(predicate: Predicate<NoInfer<A>>): (self: Option<A>) => Option<A>
3032
+ /**
3033
+ * Filters an `Option` using a predicate. If the predicate is not satisfied or the `Option` is `None` returns `None`.
3034
+ *
3035
+ * If you need to change the type of the `Option` in addition to filtering, see `filterMap`.
3036
+ *
3037
+ * @example
3038
+ * ```ts
3039
+ * import { Option } from "effect"
3040
+ *
3041
+ * const removeEmptyString = (input: Option.Option<string>) =>
3042
+ * Option.filter(input, (value) => value !== "")
3043
+ *
3044
+ * console.log(removeEmptyString(Option.none()))
3045
+ * // Output: { _id: 'Option', _tag: 'None' }
3046
+ *
3047
+ * console.log(removeEmptyString(Option.some("")))
3048
+ * // Output: { _id: 'Option', _tag: 'None' }
3049
+ *
3050
+ * console.log(removeEmptyString(Option.some("a")))
3051
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
3052
+ * ```
3053
+ *
3054
+ * @category Filtering
3055
+ * @since 2.0.0
3056
+ */
3057
+ <A, B extends A>(self: Option<A>, refinement: Refinement<A, B>): Option<B>
3058
+ /**
3059
+ * Filters an `Option` using a predicate. If the predicate is not satisfied or the `Option` is `None` returns `None`.
3060
+ *
3061
+ * If you need to change the type of the `Option` in addition to filtering, see `filterMap`.
3062
+ *
3063
+ * @example
3064
+ * ```ts
3065
+ * import { Option } from "effect"
3066
+ *
3067
+ * const removeEmptyString = (input: Option.Option<string>) =>
3068
+ * Option.filter(input, (value) => value !== "")
3069
+ *
3070
+ * console.log(removeEmptyString(Option.none()))
3071
+ * // Output: { _id: 'Option', _tag: 'None' }
3072
+ *
3073
+ * console.log(removeEmptyString(Option.some("")))
3074
+ * // Output: { _id: 'Option', _tag: 'None' }
3075
+ *
3076
+ * console.log(removeEmptyString(Option.some("a")))
3077
+ * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }
3078
+ * ```
3079
+ *
3080
+ * @category Filtering
3081
+ * @since 2.0.0
3082
+ */
3083
+ <A>(self: Option<A>, predicate: Predicate<A>): Option<A>
3084
+ } = dual(
3085
+ 2,
3086
+ <A>(self: Option<A>, predicate: Predicate<A>): Option<A> =>
3087
+ filterMap(self, (b) => (predicate(b) ? option.some(b) : option.none))
3088
+ )
3089
+
3090
+ /**
3091
+ * Creates an `Equivalence` instance for comparing `Option` values, using a
3092
+ * provided `Equivalence` for the inner type.
3093
+ *
3094
+ * **Details**
3095
+ *
3096
+ * This function takes an `Equivalence` instance for a specific type `A` and
3097
+ * produces an `Equivalence` instance for `Option<A>`. The resulting
3098
+ * `Equivalence` determines whether two `Option` values are equivalent:
3099
+ *
3100
+ * - Two `None`s are considered equivalent.
3101
+ * - A `Some` and a `None` are not equivalent.
3102
+ * - Two `Some` values are equivalent if their inner values are equivalent
3103
+ * according to the provided `Equivalence`.
3104
+ *
3105
+ * **Example** (Comparing Optional Numbers for Equivalence)
3106
+ *
3107
+ * ```ts
3108
+ * import { Number, Option } from "effect"
3109
+ *
3110
+ * const isEquivalent = Option.getEquivalence(Number.Equivalence)
3111
+ *
3112
+ * console.log(isEquivalent(Option.none(), Option.none()))
3113
+ * // Output: true
3114
+ *
3115
+ * console.log(isEquivalent(Option.none(), Option.some(1)))
3116
+ * // Output: false
3117
+ *
3118
+ * console.log(isEquivalent(Option.some(1), Option.none()))
3119
+ * // Output: false
3120
+ *
3121
+ * console.log(isEquivalent(Option.some(1), Option.some(2)))
3122
+ * // Output: false
3123
+ *
3124
+ * console.log(isEquivalent(Option.some(1), Option.some(1)))
3125
+ * // Output: true
3126
+ * ```
3127
+ *
3128
+ * @category Equivalence
3129
+ * @since 2.0.0
3130
+ */
3131
+ export const getEquivalence = <A>(isEquivalent: Equivalence.Equivalence<A>): Equivalence.Equivalence<Option<A>> =>
3132
+ Equivalence.make((x, y) => isNone(x) ? isNone(y) : isNone(y) ? false : isEquivalent(x.value, y.value))
3133
+
3134
+ /**
3135
+ * Creates an `Order` instance for comparing `Option` values, using a provided
3136
+ * `Order` for the inner type.
3137
+ *
3138
+ * **Details**
3139
+ *
3140
+ * This function produces an `Order` instance for `Option<A>`, allowing `Option`
3141
+ * values to be compared:
3142
+ *
3143
+ * - `None` is always considered less than any `Some` value.
3144
+ * - If both are `Some`, their inner values are compared using the provided
3145
+ * `Order` instance.
3146
+ *
3147
+ * @example
3148
+ * ```ts
3149
+ * import { Number, Option } from "effect"
3150
+ *
3151
+ * const order = Option.getOrder(Number.Order)
3152
+ *
3153
+ * console.log(order(Option.none(), Option.none()))
3154
+ * // Output: 0
3155
+ *
3156
+ * console.log(order(Option.none(), Option.some(1)))
3157
+ * // Output: -1
3158
+ *
3159
+ * console.log(order(Option.some(1), Option.none()))
3160
+ * // Output: 1
3161
+ *
3162
+ * console.log(order(Option.some(1), Option.some(2)))
3163
+ * // Output: -1
3164
+ *
3165
+ * console.log(order(Option.some(1), Option.some(1)))
3166
+ * // Output: 0
3167
+ * ```
3168
+ *
3169
+ * @category Sorting
3170
+ * @since 2.0.0
3171
+ */
3172
+ export const getOrder = <A>(O: Order<A>): Order<Option<A>> =>
3173
+ order.make((self, that) => isSome(self) ? (isSome(that) ? O(self.value, that.value) : 1) : -1)
3174
+
3175
+ /**
3176
+ * Lifts a binary function to work with `Option` values, allowing the function
3177
+ * to operate on two `Option`s.
3178
+ *
3179
+ * **Details**
3180
+ *
3181
+ * This function takes a binary function `f` and returns a new function that
3182
+ * applies `f` to the values of two `Option`s (`self` and `that`). If both
3183
+ * `Option`s are `Some`, the binary function `f` is applied to their values, and
3184
+ * the result is wrapped in a new `Some`. If either `Option` is `None`, the
3185
+ * result is `None`.
3186
+ *
3187
+ * @example
3188
+ * ```ts
3189
+ * import { Option } from "effect"
3190
+ *
3191
+ * // A binary function to add two numbers
3192
+ * const add = (a: number, b: number): number => a + b
3193
+ *
3194
+ * // Lift the `add` function to work with `Option` values
3195
+ * const addOptions = Option.lift2(add)
3196
+ *
3197
+ * // Both `Option`s are `Some`
3198
+ * console.log(addOptions(Option.some(2), Option.some(3)))
3199
+ * // Output: { _id: 'Option', _tag: 'Some', value: 5 }
3200
+ *
3201
+ * // One `Option` is `None`
3202
+ * console.log(addOptions(Option.some(2), Option.none()))
3203
+ * // Output: { _id: 'Option', _tag: 'None' }
3204
+ * ```
3205
+ *
3206
+ * @category Lifting
3207
+ * @since 2.0.0
3208
+ */
3209
+ export const lift2 = <A, B, C>(f: (a: A, b: B) => C): {
3210
+ (that: Option<B>): (self: Option<A>) => Option<C>
3211
+ (self: Option<A>, that: Option<B>): Option<C>
3212
+ } => dual(2, (self: Option<A>, that: Option<B>): Option<C> => zipWith(self, that, f))
3213
+
3214
+ /**
3215
+ * Lifts a `Predicate` or `Refinement` into the `Option` context, returning a
3216
+ * `Some` of the input value if the predicate is satisfied, or `None` otherwise.
3217
+ *
3218
+ * **Details**
3219
+ *
3220
+ * This function transforms a `Predicate` (or a more specific `Refinement`) into
3221
+ * a function that produces an `Option`. If the predicate evaluates to `true`,
3222
+ * the input value is wrapped in a `Some`. If the predicate evaluates to
3223
+ * `false`, the result is `None`.
3224
+ *
3225
+ * @example
3226
+ * ```ts
3227
+ * import { Option } from "effect"
3228
+ *
3229
+ * // Check if a number is positive
3230
+ * const isPositive = (n: number) => n > 0
3231
+ *
3232
+ * // ┌─── (b: number) => Option<number>
3233
+ * // ▼
3234
+ * const parsePositive = Option.liftPredicate(isPositive)
3235
+ *
3236
+ * console.log(parsePositive(1))
3237
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
3238
+ *
3239
+ * console.log(parsePositive(-1))
3240
+ * // OUtput: { _id: 'Option', _tag: 'None' }
3241
+ * ```
3242
+ *
3243
+ * @category Lifting
3244
+ * @since 2.0.0
3245
+ */
3246
+ export const liftPredicate: { // Note: I intentionally avoid using the NoInfer pattern here.
3247
+ <A, B extends A>(refinement: Refinement<A, B>): (a: A) => Option<B>
3248
+ /**
3249
+ * Lifts a `Predicate` or `Refinement` into the `Option` context, returning a
3250
+ * `Some` of the input value if the predicate is satisfied, or `None` otherwise.
3251
+ *
3252
+ * **Details**
3253
+ *
3254
+ * This function transforms a `Predicate` (or a more specific `Refinement`) into
3255
+ * a function that produces an `Option`. If the predicate evaluates to `true`,
3256
+ * the input value is wrapped in a `Some`. If the predicate evaluates to
3257
+ * `false`, the result is `None`.
3258
+ *
3259
+ * @example
3260
+ * ```ts
3261
+ * import { Option } from "effect"
3262
+ *
3263
+ * // Check if a number is positive
3264
+ * const isPositive = (n: number) => n > 0
3265
+ *
3266
+ * // ┌─── (b: number) => Option<number>
3267
+ * // ▼
3268
+ * const parsePositive = Option.liftPredicate(isPositive)
3269
+ *
3270
+ * console.log(parsePositive(1))
3271
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
3272
+ *
3273
+ * console.log(parsePositive(-1))
3274
+ * // OUtput: { _id: 'Option', _tag: 'None' }
3275
+ * ```
3276
+ *
3277
+ * @category Lifting
3278
+ * @since 2.0.0
3279
+ */
3280
+ <B extends A, A = B>(predicate: Predicate<A>): (b: B) => Option<B>
3281
+ /**
3282
+ * Lifts a `Predicate` or `Refinement` into the `Option` context, returning a
3283
+ * `Some` of the input value if the predicate is satisfied, or `None` otherwise.
3284
+ *
3285
+ * **Details**
3286
+ *
3287
+ * This function transforms a `Predicate` (or a more specific `Refinement`) into
3288
+ * a function that produces an `Option`. If the predicate evaluates to `true`,
3289
+ * the input value is wrapped in a `Some`. If the predicate evaluates to
3290
+ * `false`, the result is `None`.
3291
+ *
3292
+ * @example
3293
+ * ```ts
3294
+ * import { Option } from "effect"
3295
+ *
3296
+ * // Check if a number is positive
3297
+ * const isPositive = (n: number) => n > 0
3298
+ *
3299
+ * // ┌─── (b: number) => Option<number>
3300
+ * // ▼
3301
+ * const parsePositive = Option.liftPredicate(isPositive)
3302
+ *
3303
+ * console.log(parsePositive(1))
3304
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
3305
+ *
3306
+ * console.log(parsePositive(-1))
3307
+ * // OUtput: { _id: 'Option', _tag: 'None' }
3308
+ * ```
3309
+ *
3310
+ * @category Lifting
3311
+ * @since 2.0.0
3312
+ */
3313
+ <A, B extends A>(self: A, refinement: Refinement<A, B>): Option<B>
3314
+ /**
3315
+ * Lifts a `Predicate` or `Refinement` into the `Option` context, returning a
3316
+ * `Some` of the input value if the predicate is satisfied, or `None` otherwise.
3317
+ *
3318
+ * **Details**
3319
+ *
3320
+ * This function transforms a `Predicate` (or a more specific `Refinement`) into
3321
+ * a function that produces an `Option`. If the predicate evaluates to `true`,
3322
+ * the input value is wrapped in a `Some`. If the predicate evaluates to
3323
+ * `false`, the result is `None`.
3324
+ *
3325
+ * @example
3326
+ * ```ts
3327
+ * import { Option } from "effect"
3328
+ *
3329
+ * // Check if a number is positive
3330
+ * const isPositive = (n: number) => n > 0
3331
+ *
3332
+ * // ┌─── (b: number) => Option<number>
3333
+ * // ▼
3334
+ * const parsePositive = Option.liftPredicate(isPositive)
3335
+ *
3336
+ * console.log(parsePositive(1))
3337
+ * // Output: { _id: 'Option', _tag: 'Some', value: 1 }
3338
+ *
3339
+ * console.log(parsePositive(-1))
3340
+ * // OUtput: { _id: 'Option', _tag: 'None' }
3341
+ * ```
3342
+ *
3343
+ * @category Lifting
3344
+ * @since 2.0.0
3345
+ */
3346
+ <B extends A, A = B>(self: B, predicate: Predicate<A>): Option<B>
3347
+ } = dual(
3348
+ 2,
3349
+ <B extends A, A = B>(b: B, predicate: Predicate<A>): Option<B> => predicate(b) ? some(b) : none()
3350
+ )
3351
+
3352
+ /**
3353
+ * Returns a function that checks if an `Option` contains a specified value,
3354
+ * using a provided equivalence function.
3355
+ *
3356
+ * **Details**
3357
+ *
3358
+ * This function allows you to check whether an `Option` contains a specific
3359
+ * value. It uses an equivalence function `isEquivalent` to compare the value
3360
+ * inside the `Option` to the provided value. If the `Option` is `Some` and the
3361
+ * equivalence function returns `true`, the result is `true`. If the `Option` is
3362
+ * `None` or the values are not equivalent, the result is `false`.
3363
+ *
3364
+ * @example
3365
+ * ```ts
3366
+ * import { Number, Option } from "effect"
3367
+ *
3368
+ * const contains = Option.containsWith(Number.Equivalence)
3369
+ *
3370
+ * console.log(Option.some(2).pipe(contains(2)))
3371
+ * // Output: true
3372
+ *
3373
+ * console.log(Option.some(1).pipe(contains(2)))
3374
+ * // Output: false
3375
+ *
3376
+ * console.log(Option.none().pipe(contains(2)))
3377
+ * // Output: false
3378
+ * ```
3379
+ *
3380
+ * @see {@link contains} for a version that uses the default `Equivalence`.
3381
+ *
3382
+ * @category Elements
3383
+ * @since 2.0.0
3384
+ */
3385
+ export const containsWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
3386
+ (a: A): (self: Option<A>) => boolean
3387
+ (self: Option<A>, a: A): boolean
3388
+ } => dual(2, (self: Option<A>, a: A): boolean => isNone(self) ? false : isEquivalent(self.value, a))
3389
+
3390
+ const _equivalence = Equal.equivalence()
3391
+
3392
+ /**
3393
+ * Returns a function that checks if an `Option` contains a specified value
3394
+ * using the default `Equivalence`.
3395
+ *
3396
+ * **Details**
3397
+ *
3398
+ * This function allows you to check whether an `Option` contains a specific
3399
+ * value. It uses the default `Equivalence` for equality comparison. If the
3400
+ * `Option` is `Some` and its value is equivalent to the provided value, the
3401
+ * result is `true`. If the `Option` is `None` or the values are not equivalent,
3402
+ * the result is `false`.
3403
+ *
3404
+ * @example
3405
+ * ```ts
3406
+ * import { Option } from "effect"
3407
+ *
3408
+ * console.log(Option.some(2).pipe(Option.contains(2)))
3409
+ * // Output: true
3410
+ *
3411
+ * console.log(Option.some(1).pipe(Option.contains(2)))
3412
+ * // Output: false
3413
+ *
3414
+ * console.log(Option.none().pipe(Option.contains(2)))
3415
+ * // Output: false
3416
+ * ```
3417
+ *
3418
+ * @see {@link containsWith} for a version that allows you to specify a custom equivalence function.
3419
+ *
3420
+ * @category Elements
3421
+ * @since 2.0.0
3422
+ */
3423
+ export const contains: {
3424
+ /**
3425
+ * Returns a function that checks if an `Option` contains a specified value
3426
+ * using the default `Equivalence`.
3427
+ *
3428
+ * **Details**
3429
+ *
3430
+ * This function allows you to check whether an `Option` contains a specific
3431
+ * value. It uses the default `Equivalence` for equality comparison. If the
3432
+ * `Option` is `Some` and its value is equivalent to the provided value, the
3433
+ * result is `true`. If the `Option` is `None` or the values are not equivalent,
3434
+ * the result is `false`.
3435
+ *
3436
+ * @example
3437
+ * ```ts
3438
+ * import { Option } from "effect"
3439
+ *
3440
+ * console.log(Option.some(2).pipe(Option.contains(2)))
3441
+ * // Output: true
3442
+ *
3443
+ * console.log(Option.some(1).pipe(Option.contains(2)))
3444
+ * // Output: false
3445
+ *
3446
+ * console.log(Option.none().pipe(Option.contains(2)))
3447
+ * // Output: false
3448
+ * ```
3449
+ *
3450
+ * @see {@link containsWith} for a version that allows you to specify a custom equivalence function.
3451
+ *
3452
+ * @category Elements
3453
+ * @since 2.0.0
3454
+ */
3455
+ <A>(a: A): (self: Option<A>) => boolean
3456
+ /**
3457
+ * Returns a function that checks if an `Option` contains a specified value
3458
+ * using the default `Equivalence`.
3459
+ *
3460
+ * **Details**
3461
+ *
3462
+ * This function allows you to check whether an `Option` contains a specific
3463
+ * value. It uses the default `Equivalence` for equality comparison. If the
3464
+ * `Option` is `Some` and its value is equivalent to the provided value, the
3465
+ * result is `true`. If the `Option` is `None` or the values are not equivalent,
3466
+ * the result is `false`.
3467
+ *
3468
+ * @example
3469
+ * ```ts
3470
+ * import { Option } from "effect"
3471
+ *
3472
+ * console.log(Option.some(2).pipe(Option.contains(2)))
3473
+ * // Output: true
3474
+ *
3475
+ * console.log(Option.some(1).pipe(Option.contains(2)))
3476
+ * // Output: false
3477
+ *
3478
+ * console.log(Option.none().pipe(Option.contains(2)))
3479
+ * // Output: false
3480
+ * ```
3481
+ *
3482
+ * @see {@link containsWith} for a version that allows you to specify a custom equivalence function.
3483
+ *
3484
+ * @category Elements
3485
+ * @since 2.0.0
3486
+ */
3487
+ <A>(self: Option<A>, a: A): boolean
3488
+ } = containsWith(_equivalence)
3489
+
3490
+ /**
3491
+ * Checks if a value in an `Option` satisfies a given predicate or refinement.
3492
+ *
3493
+ * **Details**
3494
+ *
3495
+ * This function allows you to check if a value inside a `Some` meets a
3496
+ * specified condition. If the `Option` is `None`, the result is `false`. If the
3497
+ * `Option` is `Some`, the provided predicate or refinement is applied to the
3498
+ * value:
3499
+ *
3500
+ * - If the condition is met, the result is `true`.
3501
+ * - If the condition is not met, the result is `false`.
3502
+ *
3503
+ * @example
3504
+ * ```ts
3505
+ * import { Option } from "effect"
3506
+ *
3507
+ * const isEven = (n: number) => n % 2 === 0
3508
+ *
3509
+ * console.log(Option.some(2).pipe(Option.exists(isEven)))
3510
+ * // Output: true
3511
+ *
3512
+ * console.log(Option.some(1).pipe(Option.exists(isEven)))
3513
+ * // Output: false
3514
+ *
3515
+ * console.log(Option.none().pipe(Option.exists(isEven)))
3516
+ * // Output: false
3517
+ * ```
3518
+ *
3519
+ * @category Elements
3520
+ * @since 2.0.0
3521
+ */
3522
+ export const exists: {
3523
+ /**
3524
+ * Checks if a value in an `Option` satisfies a given predicate or refinement.
3525
+ *
3526
+ * **Details**
3527
+ *
3528
+ * This function allows you to check if a value inside a `Some` meets a
3529
+ * specified condition. If the `Option` is `None`, the result is `false`. If the
3530
+ * `Option` is `Some`, the provided predicate or refinement is applied to the
3531
+ * value:
3532
+ *
3533
+ * - If the condition is met, the result is `true`.
3534
+ * - If the condition is not met, the result is `false`.
3535
+ *
3536
+ * @example
3537
+ * ```ts
3538
+ * import { Option } from "effect"
3539
+ *
3540
+ * const isEven = (n: number) => n % 2 === 0
3541
+ *
3542
+ * console.log(Option.some(2).pipe(Option.exists(isEven)))
3543
+ * // Output: true
3544
+ *
3545
+ * console.log(Option.some(1).pipe(Option.exists(isEven)))
3546
+ * // Output: false
3547
+ *
3548
+ * console.log(Option.none().pipe(Option.exists(isEven)))
3549
+ * // Output: false
3550
+ * ```
3551
+ *
3552
+ * @category Elements
3553
+ * @since 2.0.0
3554
+ */
3555
+ <A, B extends A>(refinement: Refinement<NoInfer<A>, B>): (self: Option<A>) => self is Option<B>
3556
+ /**
3557
+ * Checks if a value in an `Option` satisfies a given predicate or refinement.
3558
+ *
3559
+ * **Details**
3560
+ *
3561
+ * This function allows you to check if a value inside a `Some` meets a
3562
+ * specified condition. If the `Option` is `None`, the result is `false`. If the
3563
+ * `Option` is `Some`, the provided predicate or refinement is applied to the
3564
+ * value:
3565
+ *
3566
+ * - If the condition is met, the result is `true`.
3567
+ * - If the condition is not met, the result is `false`.
3568
+ *
3569
+ * @example
3570
+ * ```ts
3571
+ * import { Option } from "effect"
3572
+ *
3573
+ * const isEven = (n: number) => n % 2 === 0
3574
+ *
3575
+ * console.log(Option.some(2).pipe(Option.exists(isEven)))
3576
+ * // Output: true
3577
+ *
3578
+ * console.log(Option.some(1).pipe(Option.exists(isEven)))
3579
+ * // Output: false
3580
+ *
3581
+ * console.log(Option.none().pipe(Option.exists(isEven)))
3582
+ * // Output: false
3583
+ * ```
3584
+ *
3585
+ * @category Elements
3586
+ * @since 2.0.0
3587
+ */
3588
+ <A>(predicate: Predicate<NoInfer<A>>): (self: Option<A>) => boolean
3589
+ /**
3590
+ * Checks if a value in an `Option` satisfies a given predicate or refinement.
3591
+ *
3592
+ * **Details**
3593
+ *
3594
+ * This function allows you to check if a value inside a `Some` meets a
3595
+ * specified condition. If the `Option` is `None`, the result is `false`. If the
3596
+ * `Option` is `Some`, the provided predicate or refinement is applied to the
3597
+ * value:
3598
+ *
3599
+ * - If the condition is met, the result is `true`.
3600
+ * - If the condition is not met, the result is `false`.
3601
+ *
3602
+ * @example
3603
+ * ```ts
3604
+ * import { Option } from "effect"
3605
+ *
3606
+ * const isEven = (n: number) => n % 2 === 0
3607
+ *
3608
+ * console.log(Option.some(2).pipe(Option.exists(isEven)))
3609
+ * // Output: true
3610
+ *
3611
+ * console.log(Option.some(1).pipe(Option.exists(isEven)))
3612
+ * // Output: false
3613
+ *
3614
+ * console.log(Option.none().pipe(Option.exists(isEven)))
3615
+ * // Output: false
3616
+ * ```
3617
+ *
3618
+ * @category Elements
3619
+ * @since 2.0.0
3620
+ */
3621
+ <A, B extends A>(self: Option<A>, refinement: Refinement<A, B>): self is Option<B>
3622
+ /**
3623
+ * Checks if a value in an `Option` satisfies a given predicate or refinement.
3624
+ *
3625
+ * **Details**
3626
+ *
3627
+ * This function allows you to check if a value inside a `Some` meets a
3628
+ * specified condition. If the `Option` is `None`, the result is `false`. If the
3629
+ * `Option` is `Some`, the provided predicate or refinement is applied to the
3630
+ * value:
3631
+ *
3632
+ * - If the condition is met, the result is `true`.
3633
+ * - If the condition is not met, the result is `false`.
3634
+ *
3635
+ * @example
3636
+ * ```ts
3637
+ * import { Option } from "effect"
3638
+ *
3639
+ * const isEven = (n: number) => n % 2 === 0
3640
+ *
3641
+ * console.log(Option.some(2).pipe(Option.exists(isEven)))
3642
+ * // Output: true
3643
+ *
3644
+ * console.log(Option.some(1).pipe(Option.exists(isEven)))
3645
+ * // Output: false
3646
+ *
3647
+ * console.log(Option.none().pipe(Option.exists(isEven)))
3648
+ * // Output: false
3649
+ * ```
3650
+ *
3651
+ * @category Elements
3652
+ * @since 2.0.0
3653
+ */
3654
+ <A>(self: Option<A>, predicate: Predicate<A>): boolean
3655
+ } = dual(
3656
+ 2,
3657
+ <A, B extends A>(self: Option<A>, refinement: Refinement<A, B>): self is Option<B> =>
3658
+ isNone(self) ? false : refinement(self.value)
3659
+ )
3660
+
3661
+ // -------------------------------------------------------------------------------------
3662
+ // do notation
3663
+ // -------------------------------------------------------------------------------------
3664
+
3665
+ /**
3666
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3667
+ *
3668
+ * Here's how the do simulation works:
3669
+ *
3670
+ * 1. Start the do simulation using the `Do` value
3671
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3672
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3673
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3674
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3675
+ *
3676
+ * @example
3677
+ * ```ts
3678
+ * import * as assert from "node:assert"
3679
+ * import { Option, pipe } from "effect"
3680
+ *
3681
+ * const result = pipe(
3682
+ * Option.Do,
3683
+ * Option.bind("x", () => Option.some(2)),
3684
+ * Option.bind("y", () => Option.some(3)),
3685
+ * Option.let("sum", ({ x, y }) => x + y),
3686
+ * Option.filter(({ x, y }) => x * y > 5)
3687
+ * )
3688
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3689
+ * ```
3690
+ *
3691
+ * @see {@link Do}
3692
+ * @see {@link bind}
3693
+ * @see {@link let_ let}
3694
+ *
3695
+ * @category Do notation
3696
+ * @since 2.0.0
3697
+ */
3698
+ export const bindTo: {
3699
+ // -------------------------------------------------------------------------------------
3700
+ // do notation
3701
+ // -------------------------------------------------------------------------------------
3702
+
3703
+ /**
3704
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3705
+ *
3706
+ * Here's how the do simulation works:
3707
+ *
3708
+ * 1. Start the do simulation using the `Do` value
3709
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3710
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3711
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3712
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3713
+ *
3714
+ * @example
3715
+ * ```ts
3716
+ * import * as assert from "node:assert"
3717
+ * import { Option, pipe } from "effect"
3718
+ *
3719
+ * const result = pipe(
3720
+ * Option.Do,
3721
+ * Option.bind("x", () => Option.some(2)),
3722
+ * Option.bind("y", () => Option.some(3)),
3723
+ * Option.let("sum", ({ x, y }) => x + y),
3724
+ * Option.filter(({ x, y }) => x * y > 5)
3725
+ * )
3726
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3727
+ * ```
3728
+ *
3729
+ * @see {@link Do}
3730
+ * @see {@link bind}
3731
+ * @see {@link let_ let}
3732
+ *
3733
+ * @category Do notation
3734
+ * @since 2.0.0
3735
+ */
3736
+ <N extends string>(name: N): <A>(self: Option<A>) => Option<{ [K in N]: A }>
3737
+ // -------------------------------------------------------------------------------------
3738
+ // do notation
3739
+ // -------------------------------------------------------------------------------------
3740
+
3741
+ /**
3742
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3743
+ *
3744
+ * Here's how the do simulation works:
3745
+ *
3746
+ * 1. Start the do simulation using the `Do` value
3747
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3748
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3749
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3750
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3751
+ *
3752
+ * @example
3753
+ * ```ts
3754
+ * import * as assert from "node:assert"
3755
+ * import { Option, pipe } from "effect"
3756
+ *
3757
+ * const result = pipe(
3758
+ * Option.Do,
3759
+ * Option.bind("x", () => Option.some(2)),
3760
+ * Option.bind("y", () => Option.some(3)),
3761
+ * Option.let("sum", ({ x, y }) => x + y),
3762
+ * Option.filter(({ x, y }) => x * y > 5)
3763
+ * )
3764
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3765
+ * ```
3766
+ *
3767
+ * @see {@link Do}
3768
+ * @see {@link bind}
3769
+ * @see {@link let_ let}
3770
+ *
3771
+ * @category Do notation
3772
+ * @since 2.0.0
3773
+ */
3774
+ <A, N extends string>(self: Option<A>, name: N): Option<{ [K in N]: A }>
3775
+ } = doNotation.bindTo<OptionTypeLambda>(map)
3776
+
3777
+ const let_: {
3778
+ <N extends string, A extends object, B>(
3779
+ name: Exclude<N, keyof A>,
3780
+ f: (a: NoInfer<A>) => B
3781
+ ): (self: Option<A>) => Option<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }>
3782
+ <A extends object, N extends string, B>(
3783
+ self: Option<A>,
3784
+ name: Exclude<N, keyof A>,
3785
+ f: (a: NoInfer<A>) => B
3786
+ ): Option<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }>
3787
+ } = doNotation.let_<OptionTypeLambda>(map)
3788
+
3789
+ export {
3790
+ /**
3791
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3792
+ *
3793
+ * Here's how the do simulation works:
3794
+ *
3795
+ * 1. Start the do simulation using the `Do` value
3796
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3797
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3798
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3799
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3800
+ *
3801
+ * @example
3802
+ * ```ts
3803
+ * import * as assert from "node:assert"
3804
+ * import { Option, pipe } from "effect"
3805
+ *
3806
+ * const result = pipe(
3807
+ * Option.Do,
3808
+ * Option.bind("x", () => Option.some(2)),
3809
+ * Option.bind("y", () => Option.some(3)),
3810
+ * Option.let("sum", ({ x, y }) => x + y),
3811
+ * Option.filter(({ x, y }) => x * y > 5)
3812
+ * )
3813
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3814
+ * ```
3815
+ *
3816
+ * @see {@link Do}
3817
+ * @see {@link bind}
3818
+ * @see {@link bindTo}
3819
+ *
3820
+ * @category Do notation
3821
+ * @since 2.0.0
3822
+ */
3823
+ let_ as let
3824
+ }
3825
+
3826
+ /**
3827
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3828
+ *
3829
+ * Here's how the do simulation works:
3830
+ *
3831
+ * 1. Start the do simulation using the `Do` value
3832
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3833
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3834
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3835
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3836
+ *
3837
+ * @example
3838
+ * ```ts
3839
+ * import * as assert from "node:assert"
3840
+ * import { Option, pipe } from "effect"
3841
+ *
3842
+ * const result = pipe(
3843
+ * Option.Do,
3844
+ * Option.bind("x", () => Option.some(2)),
3845
+ * Option.bind("y", () => Option.some(3)),
3846
+ * Option.let("sum", ({ x, y }) => x + y),
3847
+ * Option.filter(({ x, y }) => x * y > 5)
3848
+ * )
3849
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3850
+ * ```
3851
+ *
3852
+ * @see {@link Do}
3853
+ * @see {@link bindTo}
3854
+ * @see {@link let_ let}
3855
+ *
3856
+ * @category Do notation
3857
+ * @since 2.0.0
3858
+ */
3859
+ export const bind: {
3860
+ /**
3861
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3862
+ *
3863
+ * Here's how the do simulation works:
3864
+ *
3865
+ * 1. Start the do simulation using the `Do` value
3866
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3867
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3868
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3869
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3870
+ *
3871
+ * @example
3872
+ * ```ts
3873
+ * import * as assert from "node:assert"
3874
+ * import { Option, pipe } from "effect"
3875
+ *
3876
+ * const result = pipe(
3877
+ * Option.Do,
3878
+ * Option.bind("x", () => Option.some(2)),
3879
+ * Option.bind("y", () => Option.some(3)),
3880
+ * Option.let("sum", ({ x, y }) => x + y),
3881
+ * Option.filter(({ x, y }) => x * y > 5)
3882
+ * )
3883
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3884
+ * ```
3885
+ *
3886
+ * @see {@link Do}
3887
+ * @see {@link bindTo}
3888
+ * @see {@link let_ let}
3889
+ *
3890
+ * @category Do notation
3891
+ * @since 2.0.0
3892
+ */
3893
+ <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: NoInfer<A>) => Option<B>): (self: Option<A>) => Option<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }>
3894
+ /**
3895
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3896
+ *
3897
+ * Here's how the do simulation works:
3898
+ *
3899
+ * 1. Start the do simulation using the `Do` value
3900
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3901
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3902
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3903
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3904
+ *
3905
+ * @example
3906
+ * ```ts
3907
+ * import * as assert from "node:assert"
3908
+ * import { Option, pipe } from "effect"
3909
+ *
3910
+ * const result = pipe(
3911
+ * Option.Do,
3912
+ * Option.bind("x", () => Option.some(2)),
3913
+ * Option.bind("y", () => Option.some(3)),
3914
+ * Option.let("sum", ({ x, y }) => x + y),
3915
+ * Option.filter(({ x, y }) => x * y > 5)
3916
+ * )
3917
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3918
+ * ```
3919
+ *
3920
+ * @see {@link Do}
3921
+ * @see {@link bindTo}
3922
+ * @see {@link let_ let}
3923
+ *
3924
+ * @category Do notation
3925
+ * @since 2.0.0
3926
+ */
3927
+ <A extends object, N extends string, B>(
3928
+ self: Option<A>,
3929
+ name: Exclude<N, keyof A>,
3930
+ f: (a: NoInfer<A>) => Option<B>
3931
+ ): Option<{ [K in N | keyof A]: K extends keyof A ? A[K] : B }>
3932
+ } = doNotation.bind<OptionTypeLambda>(map, flatMap)
3933
+
3934
+ /**
3935
+ * The "do simulation" in Effect allows you to write code in a more declarative style, similar to the "do notation" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.
3936
+ *
3937
+ * Here's how the do simulation works:
3938
+ *
3939
+ * 1. Start the do simulation using the `Do` value
3940
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values
3941
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
3942
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
3943
+ * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
3944
+ *
3945
+ * @example
3946
+ * ```ts
3947
+ * import * as assert from "node:assert"
3948
+ * import { Option, pipe } from "effect"
3949
+ *
3950
+ * const result = pipe(
3951
+ * Option.Do,
3952
+ * Option.bind("x", () => Option.some(2)),
3953
+ * Option.bind("y", () => Option.some(3)),
3954
+ * Option.let("sum", ({ x, y }) => x + y),
3955
+ * Option.filter(({ x, y }) => x * y > 5)
3956
+ * )
3957
+ * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
3958
+ * ```
3959
+ *
3960
+ * @see {@link bindTo}
3961
+ * @see {@link bind}
3962
+ * @see {@link let_ let}
3963
+ *
3964
+ * @category Do notation
3965
+ * @since 2.0.0
3966
+ */
3967
+ export const Do: Option<{}> = some({})
3968
+
3969
+ const adapter = Gen.adapter<OptionTypeLambda>()
3970
+
3971
+ /**
3972
+ * Similar to `Effect.gen`, `Option.gen` provides a more readable,
3973
+ * generator-based syntax for working with `Option` values, making code that
3974
+ * involves `Option` easier to write and understand. This approach is similar to
3975
+ * using `async/await` but tailored for `Option`.
3976
+ *
3977
+ * **Example** (Using `Option.gen` to Create a Combined Value)
3978
+ *
3979
+ * ```ts
3980
+ * import { Option } from "effect"
3981
+ *
3982
+ * const maybeName: Option.Option<string> = Option.some("John")
3983
+ * const maybeAge: Option.Option<number> = Option.some(25)
3984
+ *
3985
+ * const person = Option.gen(function* () {
3986
+ * const name = (yield* maybeName).toUpperCase()
3987
+ * const age = yield* maybeAge
3988
+ * return { name, age }
3989
+ * })
3990
+ *
3991
+ * console.log(person)
3992
+ * // Output:
3993
+ * // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }
3994
+ * ```
3995
+ *
3996
+ * @category Generators
3997
+ * @since 2.0.0
3998
+ */
3999
+ export const gen: Gen.Gen<OptionTypeLambda, Gen.Adapter<OptionTypeLambda>> = (...args) => {
4000
+ const f = args.length === 1 ? args[0] : args[1].bind(args[0])
4001
+ const iterator = f(adapter)
4002
+ let state: IteratorResult<any> = iterator.next()
4003
+ while (!state.done) {
4004
+ const current = Gen.isGenKind(state.value)
4005
+ ? state.value.value
4006
+ : Gen.yieldWrapGet(state.value)
4007
+ if (isNone(current)) {
4008
+ return current
4009
+ }
4010
+ state = iterator.next(current.value as never)
4011
+ }
4012
+ return some(state.value)
4013
+ }
4014
+
4015
+ /**
4016
+ * Merges two optional values, applying a function if both exist.
4017
+ * Unlike {@link zipWith}, this function returns `None` only if both inputs are `None`.
4018
+ *
4019
+ * @internal
4020
+ */
4021
+ export const mergeWith = <A>(f: (a1: A, a2: A) => A) => (o1: Option<A>, o2: Option<A>): Option<A> => {
4022
+ if (isNone(o1)) {
4023
+ return o2
4024
+ } else if (isNone(o2)) {
4025
+ return o1
4026
+ }
4027
+ return some(f(o1.value, o2.value))
4028
+ }