effect 3.14.2 → 3.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Effect.js +1 -1
- package/dist/cjs/Function.js +33 -12
- package/dist/cjs/Function.js.map +1 -1
- package/dist/cjs/HashSet.js +1038 -7
- package/dist/cjs/HashSet.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Data.d.ts +4 -4
- package/dist/dts/Data.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +1 -1
- package/dist/dts/Function.d.ts +99 -36
- package/dist/dts/Function.d.ts.map +1 -1
- package/dist/dts/HashSet.d.ts +1824 -155
- package/dist/dts/HashSet.d.ts.map +1 -1
- package/dist/dts/index.d.ts +250 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/Effect.js +1 -1
- package/dist/esm/Function.js +33 -12
- package/dist/esm/Function.js.map +1 -1
- package/dist/esm/HashSet.js +1038 -7
- package/dist/esm/HashSet.js.map +1 -1
- package/dist/esm/index.js +250 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Data.ts +4 -4
- package/src/Effect.ts +1 -1
- package/src/Function.ts +99 -36
- package/src/HashSet.ts +1878 -163
- package/src/index.ts +250 -0
- package/src/internal/version.ts +1 -1
package/dist/esm/HashSet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HashSet.js","names":["HS","TypeId","HashSetTypeId","isHashSet","empty","fromIterable","make","has","some","every","isSubset","values","toValues","self","Array","from","size","beginMutation","endMutation","mutate","add","remove","difference","intersection","union","toggle","map","flatMap","forEach","reduce","filter","partition"],"sources":["../../src/HashSet.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"HashSet.js","names":["HS","TypeId","HashSetTypeId","isHashSet","empty","fromIterable","make","has","some","every","isSubset","values","toValues","self","Array","from","size","beginMutation","endMutation","mutate","add","remove","difference","intersection","union","toggle","map","flatMap","forEach","reduce","filter","partition"],"sources":["../../src/HashSet.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgQA,OAAO,KAAKA,EAAE,MAAM,uBAAuB;AAK3C,MAAMC,MAAM,GAAkBD,EAAE,CAACE,aAAuB;AA0BxD;;;;;AAKA,OAAO,MAAMC,SAAS,GAoDlBH,EAAE,CAACG,SAAS;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAO,MAAMC,KAAK,GAAgCJ,EAAE,CAACI,KAAK;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,OAAO,MAAMC,YAAY,GAA6CL,EAAE,CAACK,YAAY;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,OAAO,MAAMC,IAAI,GAA4EN,EAAE,CAACM,IAAI;AAEpG;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,OAAO,MAAMC,GAAG,GAkCZP,EAAE,CAACO,GAAG;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,OAAO,MAAMC,IAAI,GAkDbR,EAAE,CAACQ,IAAI;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;AA4BA,OAAO,MAAMC,KAAK,GA0EdxB,EAAE,CAACwB,KAAK;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,OAAO,MAAMC,MAAM,GAwDfzB,EAAE,CAACyB,MAAM;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,OAAO,MAAMC,GAAG,GAoCZ1B,EAAE,CAAC0B,GAAG;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,OAAO,MAAMC,OAAO,GAmChB3B,EAAE,CAAC2B,OAAO;AAEd;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,MAAMC,OAAO,GAuChB5B,EAAE,CAAC4B,OAAO;AAEd;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,MAAMC,MAAM,GAqCf7B,EAAE,CAAC6B,MAAM;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,OAAO,MAAMC,MAAM,GA+Ff9B,EAAE,CAAC8B,MAAM;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,OAAO,MAAMC,SAAS,GAgHlB/B,EAAE,CAAC+B,SAAS","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
|
@@ -307,6 +307,256 @@ export * as Hash from "./Hash.js";
|
|
|
307
307
|
*/
|
|
308
308
|
export * as HashMap from "./HashMap.js";
|
|
309
309
|
/**
|
|
310
|
+
* # HashSet
|
|
311
|
+
*
|
|
312
|
+
* An immutable `HashSet` provides a collection of unique values with efficient
|
|
313
|
+
* lookup, insertion and removal. Once created, a `HashSet` cannot be modified;
|
|
314
|
+
* any operation that would alter the set instead returns a new `HashSet` with
|
|
315
|
+
* the changes. This immutability offers benefits like predictable state
|
|
316
|
+
* management and easier reasoning about your code.
|
|
317
|
+
*
|
|
318
|
+
* ## What Problem Does It Solve?
|
|
319
|
+
*
|
|
320
|
+
* `HashSet` solves the problem of maintaining an unsorted collection where each
|
|
321
|
+
* value appears exactly once, with fast operations for checking membership and
|
|
322
|
+
* adding/removing values.
|
|
323
|
+
*
|
|
324
|
+
* ## When to Use
|
|
325
|
+
*
|
|
326
|
+
* Use `HashSet` when you need:
|
|
327
|
+
*
|
|
328
|
+
* - A collection with no duplicate values
|
|
329
|
+
* - Efficient membership testing (**`O(1)`** average complexity)
|
|
330
|
+
* - Set operations like union, intersection, and difference
|
|
331
|
+
* - An immutable data structure that preserves functional programming patterns
|
|
332
|
+
*
|
|
333
|
+
* ## Advanced Features
|
|
334
|
+
*
|
|
335
|
+
* HashSet provides operations for:
|
|
336
|
+
*
|
|
337
|
+
* - Transforming sets with map and flatMap
|
|
338
|
+
* - Filtering elements with filter
|
|
339
|
+
* - Combining sets with union, intersection and difference
|
|
340
|
+
* - Performance optimizations via mutable operations in controlled contexts
|
|
341
|
+
*
|
|
342
|
+
* ## Performance Characteristics
|
|
343
|
+
*
|
|
344
|
+
* - **Lookup** operations ({@linkcode HashSet.has}): **`O(1)`** average time
|
|
345
|
+
* complexity
|
|
346
|
+
* - **Insertion** operations ({@linkcode HashSet.add}): **`O(1)`** average time
|
|
347
|
+
* complexity
|
|
348
|
+
* - **Removal** operations ({@linkcode HashSet.remove}): **`O(1)`** average time
|
|
349
|
+
* complexity
|
|
350
|
+
* - **Set** operations ({@linkcode HashSet.union},
|
|
351
|
+
* {@linkcode HashSet.intersection}): **`O(n)`** where n is the size of the
|
|
352
|
+
* smaller set
|
|
353
|
+
* - **Iteration**: **`O(n)`** where n is the size of the set
|
|
354
|
+
*
|
|
355
|
+
* The HashSet data structure implements the following traits:
|
|
356
|
+
*
|
|
357
|
+
* - {@link Iterable}: allows iterating over the values in the set
|
|
358
|
+
* - {@link Equal}: allows comparing two sets for value-based equality
|
|
359
|
+
* - {@link Pipeable}: allows chaining operations with the pipe operator
|
|
360
|
+
* - {@link Inspectable}: allows inspecting the contents of the set
|
|
361
|
+
*
|
|
362
|
+
* ## Operations Reference
|
|
363
|
+
*
|
|
364
|
+
* | Category | Operation | Description | Complexity |
|
|
365
|
+
* | ------------ | -------------------------------- | ------------------------------------------- | ---------- |
|
|
366
|
+
* | constructors | {@linkcode HashSet.empty} | Creates an empty HashSet | O(1) |
|
|
367
|
+
* | constructors | {@linkcode HashSet.fromIterable} | Creates a HashSet from an iterable | O(n) |
|
|
368
|
+
* | constructors | {@linkcode HashSet.make} | Creates a HashSet from multiple values | O(n) |
|
|
369
|
+
* | | | | |
|
|
370
|
+
* | elements | {@linkcode HashSet.has} | Checks if a value exists in the set | O(1) avg |
|
|
371
|
+
* | elements | {@linkcode HashSet.some} | Checks if any element satisfies a predicate | O(n) |
|
|
372
|
+
* | elements | {@linkcode HashSet.every} | Checks if all elements satisfy a predicate | O(n) |
|
|
373
|
+
* | elements | {@linkcode HashSet.isSubset} | Checks if a set is a subset of another | O(n) |
|
|
374
|
+
* | | | | |
|
|
375
|
+
* | getters | {@linkcode HashSet.values} | Gets an iterator of all values | O(1) |
|
|
376
|
+
* | getters | {@linkcode HashSet.toValues} | Gets an array of all values | O(n) |
|
|
377
|
+
* | getters | {@linkcode HashSet.size} | Gets the number of elements | O(1) |
|
|
378
|
+
* | | | | |
|
|
379
|
+
* | mutations | {@linkcode HashSet.add} | Adds a value to the set | O(1) avg |
|
|
380
|
+
* | mutations | {@linkcode HashSet.remove} | Removes a value from the set | O(1) avg |
|
|
381
|
+
* | mutations | {@linkcode HashSet.toggle} | Toggles a value's presence | O(1) avg |
|
|
382
|
+
* | | | | |
|
|
383
|
+
* | operations | {@linkcode HashSet.difference} | Computes set difference (A - B) | O(n) |
|
|
384
|
+
* | operations | {@linkcode HashSet.intersection} | Computes set intersection (A ∩ B) | O(n) |
|
|
385
|
+
* | operations | {@linkcode HashSet.union} | Computes set union (A ∪ B) | O(n) |
|
|
386
|
+
* | | | | |
|
|
387
|
+
* | mapping | {@linkcode HashSet.map} | Transforms each element | O(n) |
|
|
388
|
+
* | | | | |
|
|
389
|
+
* | sequencing | {@linkcode HashSet.flatMap} | Transforms and flattens elements | O(n) |
|
|
390
|
+
* | | | | |
|
|
391
|
+
* | traversing | {@linkcode HashSet.forEach} | Applies a function to each element | O(n) |
|
|
392
|
+
* | | | | |
|
|
393
|
+
* | folding | {@linkcode HashSet.reduce} | Reduces the set to a single value | O(n) |
|
|
394
|
+
* | | | | |
|
|
395
|
+
* | filtering | {@linkcode HashSet.filter} | Keeps elements that satisfy a predicate | O(n) |
|
|
396
|
+
* | | | | |
|
|
397
|
+
* | partitioning | {@linkcode HashSet.partition} | Splits into two sets by a predicate | O(n) |
|
|
398
|
+
*
|
|
399
|
+
* ## Notes
|
|
400
|
+
*
|
|
401
|
+
* ### Composability with the Effect Ecosystem:
|
|
402
|
+
*
|
|
403
|
+
* This `HashSet` is designed to work seamlessly within the Effect ecosystem. It
|
|
404
|
+
* implements the {@link Iterable}, {@link Equal}, {@link Pipeable}, and
|
|
405
|
+
* {@link Inspectable} traits from Effect. This ensures compatibility with other
|
|
406
|
+
* Effect data structures and functionalities. For example, you can easily use
|
|
407
|
+
* Effect's `pipe` method to chain operations on the `HashSet`.
|
|
408
|
+
*
|
|
409
|
+
* **Equality of Elements with Effect's {@link Equal `Equal`} Trait:**
|
|
410
|
+
*
|
|
411
|
+
* This `HashSet` relies on Effect's {@link Equal} trait to determine the
|
|
412
|
+
* uniqueness of elements within the set. The way equality is checked depends on
|
|
413
|
+
* the type of the elements:
|
|
414
|
+
*
|
|
415
|
+
* - **Primitive Values:** For primitive JavaScript values like strings, numbers,
|
|
416
|
+
* booleans, `null`, and `undefined`, equality is determined by their value
|
|
417
|
+
* (similar to the `===` operator).
|
|
418
|
+
* - **Objects and Custom Types:** For objects and other custom types, equality is
|
|
419
|
+
* determined by whether those types implement the {@link Equal} interface
|
|
420
|
+
* themselves. If an element type implements `Equal`, the `HashSet` will
|
|
421
|
+
* delegate to that implementation to perform the equality check. This allows
|
|
422
|
+
* you to define custom logic for determining when two instances of your
|
|
423
|
+
* objects should be considered equal based on their properties, rather than
|
|
424
|
+
* just their object identity.
|
|
425
|
+
*
|
|
426
|
+
* ```ts
|
|
427
|
+
* import { Equal, Hash, HashSet } from "effect"
|
|
428
|
+
*
|
|
429
|
+
* class Person implements Equal.Equal {
|
|
430
|
+
* constructor(
|
|
431
|
+
* readonly id: number, // Unique identifier
|
|
432
|
+
* readonly name: string,
|
|
433
|
+
* readonly age: number
|
|
434
|
+
* ) {}
|
|
435
|
+
*
|
|
436
|
+
* // Define equality based on id, name, and age
|
|
437
|
+
* [Equal.symbol](that: Equal.Equal): boolean {
|
|
438
|
+
* if (that instanceof Person) {
|
|
439
|
+
* return (
|
|
440
|
+
* Equal.equals(this.id, that.id) &&
|
|
441
|
+
* Equal.equals(this.name, that.name) &&
|
|
442
|
+
* Equal.equals(this.age, that.age)
|
|
443
|
+
* )
|
|
444
|
+
* }
|
|
445
|
+
* return false
|
|
446
|
+
* }
|
|
447
|
+
*
|
|
448
|
+
* // Generate a hash code based on the unique id
|
|
449
|
+
* [Hash.symbol](): number {
|
|
450
|
+
* return Hash.hash(this.id)
|
|
451
|
+
* }
|
|
452
|
+
* }
|
|
453
|
+
*
|
|
454
|
+
* // Creating a HashSet with objects that implement the Equal interface
|
|
455
|
+
* const set = HashSet.empty().pipe(
|
|
456
|
+
* HashSet.add(new Person(1, "Alice", 30)),
|
|
457
|
+
* HashSet.add(new Person(1, "Alice", 30))
|
|
458
|
+
* )
|
|
459
|
+
*
|
|
460
|
+
* // HashSet recognizes them as equal, so only one element is stored
|
|
461
|
+
* console.log(HashSet.size(set))
|
|
462
|
+
* // Output: 1
|
|
463
|
+
* ```
|
|
464
|
+
*
|
|
465
|
+
* **Simplifying Equality and Hashing with `Data` and `Schema`:**
|
|
466
|
+
*
|
|
467
|
+
* Effect's {@link Data} and {@link Schema `Schema.Data`} modules offer powerful
|
|
468
|
+
* ways to automatically handle the implementation of both the {@link Equal} and
|
|
469
|
+
* {@link Hash} traits for your custom data structures.
|
|
470
|
+
*
|
|
471
|
+
* - **`Data` Module:** By using constructors like `Data.struct`, `Data.tuple`,
|
|
472
|
+
* `Data.array`, or `Data.case` to define your data types, Effect
|
|
473
|
+
* automatically generates the necessary implementations for value-based
|
|
474
|
+
* equality and consistent hashing. This significantly reduces boilerplate and
|
|
475
|
+
* ensures correctness.
|
|
476
|
+
*
|
|
477
|
+
* ```ts
|
|
478
|
+
* import { HashSet, Data, Equal } from "effect"
|
|
479
|
+
* import assert from "node:assert/strict"
|
|
480
|
+
*
|
|
481
|
+
* // Data.* implements the `Equal` traits for us
|
|
482
|
+
* const person1 = Data.struct({ id: 1, name: "Alice", age: 30 })
|
|
483
|
+
* const person2 = Data.struct({ id: 1, name: "Alice", age: 30 })
|
|
484
|
+
*
|
|
485
|
+
* assert(Equal.equals(person1, person2))
|
|
486
|
+
*
|
|
487
|
+
* const set = HashSet.empty().pipe(
|
|
488
|
+
* HashSet.add(person1),
|
|
489
|
+
* HashSet.add(person2)
|
|
490
|
+
* )
|
|
491
|
+
*
|
|
492
|
+
* // HashSet recognizes them as equal, so only one element is stored
|
|
493
|
+
* console.log(HashSet.size(set)) // Output: 1
|
|
494
|
+
* ```
|
|
495
|
+
*
|
|
496
|
+
* - **`Schema` Module:** When defining data schemas using the {@link Schema}
|
|
497
|
+
* module, you can use `Schema.Data` to automatically include the `Equal` and
|
|
498
|
+
* `Hash` traits in the decoded objects. This is particularly important when
|
|
499
|
+
* working with `HashSet`. **For decoded objects to be correctly recognized as
|
|
500
|
+
* equal within a `HashSet`, ensure that the schema for those objects is
|
|
501
|
+
* defined using `Schema.Data`.**
|
|
502
|
+
*
|
|
503
|
+
* ```ts
|
|
504
|
+
* import { Equal, HashSet, Schema } from "effect"
|
|
505
|
+
* import assert from "node:assert/strict"
|
|
506
|
+
*
|
|
507
|
+
* // Schema.Data implements the `Equal` traits for us
|
|
508
|
+
* const PersonSchema = Schema.Data(
|
|
509
|
+
* Schema.Struct({
|
|
510
|
+
* id: Schema.Number,
|
|
511
|
+
* name: Schema.String,
|
|
512
|
+
* age: Schema.Number
|
|
513
|
+
* })
|
|
514
|
+
* )
|
|
515
|
+
*
|
|
516
|
+
* const Person = Schema.decode(PersonSchema)
|
|
517
|
+
*
|
|
518
|
+
* const person1 = Person({ id: 1, name: "Alice", age: 30 })
|
|
519
|
+
* const person2 = Person({ id: 1, name: "Alice", age: 30 })
|
|
520
|
+
*
|
|
521
|
+
* assert(Equal.equals(person1, person2)) // Output: true
|
|
522
|
+
*
|
|
523
|
+
* const set = HashSet.empty().pipe(
|
|
524
|
+
* HashSet.add(person1),
|
|
525
|
+
* HashSet.add(person2)
|
|
526
|
+
* )
|
|
527
|
+
*
|
|
528
|
+
* // HashSet thanks to Schema.Data implementation of the `Equal` trait, recognizes the two Person as equal, so only one element is stored
|
|
529
|
+
* console.log(HashSet.size(set)) // Output: 1
|
|
530
|
+
* ```
|
|
531
|
+
*
|
|
532
|
+
* ### Interoperability with the JavaScript Runtime:
|
|
533
|
+
*
|
|
534
|
+
* To interoperate with the regular JavaScript runtime, Effect's `HashSet`
|
|
535
|
+
* provides methods to access its elements in formats readily usable by
|
|
536
|
+
* JavaScript APIs: {@link values `HashSet.values`},
|
|
537
|
+
* {@link toValues `HashSet.toValues`}
|
|
538
|
+
*
|
|
539
|
+
* ```ts
|
|
540
|
+
* import { HashSet } from "effect"
|
|
541
|
+
*
|
|
542
|
+
* const hashSet: HashSet.HashSet<number> = HashSet.make(1, 2, 3)
|
|
543
|
+
*
|
|
544
|
+
* // Using HashSet.values to convert HashSet.HashSet<A> to IterableIterator<A>
|
|
545
|
+
* const iterable: IterableIterator<number> = HashSet.values(hashSet)
|
|
546
|
+
*
|
|
547
|
+
* console.log(...iterable) // Logs: 1 2 3
|
|
548
|
+
*
|
|
549
|
+
* // Using HashSet.toValues to convert HashSet.HashSet<A> to Array<A>
|
|
550
|
+
* const array: Array<number> = HashSet.toValues(hashSet)
|
|
551
|
+
*
|
|
552
|
+
* console.log(array) // Logs: [ 1, 2, 3 ]
|
|
553
|
+
* ```
|
|
554
|
+
*
|
|
555
|
+
* Be mindful of performance implications (both time and space complexity) when
|
|
556
|
+
* frequently converting between Effect's immutable HashSet and mutable
|
|
557
|
+
* JavaScript data structures, especially for large collections.
|
|
558
|
+
*
|
|
559
|
+
* @module HashSet
|
|
310
560
|
* @since 2.0.0
|
|
311
561
|
*/
|
|
312
562
|
export * as HashSet from "./HashSet.js";
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["absurd","flow","hole","identity","pipe","unsafeCoerce","Arbitrary","Array","BigDecimal","BigInt","Boolean","Brand","Cache","Cause","Channel","ChildExecutorDecision","Chunk","Clock","Config","ConfigError","ConfigProvider","ConfigProviderPathPatch","Console","Context","Cron","Data","DateTime","DefaultServices","Deferred","Differ","Duration","Effect","Effectable","Either","Encoding","Equal","Equivalence","ExecutionStrategy","Exit","FastCheck","Fiber","FiberHandle","FiberId","FiberMap","FiberRef","FiberRefs","FiberRefsPatch","FiberSet","FiberStatus","Function","GlobalValue","GroupBy","HKT","Hash","HashMap","HashSet","Inspectable","Iterable","JSONSchema","KeyedPool","Layer","LayerMap","List","LogLevel","LogSpan","Logger","Mailbox","ManagedRuntime","Match","MergeDecision","MergeState","MergeStrategy","Metric","MetricBoundaries","MetricHook","MetricKey","MetricKeyType","MetricLabel","MetricPair","MetricPolling","MetricRegistry","MetricState","Micro","ModuleVersion","MutableHashMap","MutableHashSet","MutableList","MutableQueue","MutableRef","NonEmptyIterable","Number","Option","Order","Ordering","ParseResult","Pipeable","Pool","Predicate","Pretty","PrimaryKey","PubSub","Queue","Random","RateLimiter","RcMap","RcRef","Readable","Record","RedBlackTree","Redacted","Ref","RegExp","Reloadable","Request","RequestBlock","RequestResolver","Resource","Runtime","RuntimeFlags","RuntimeFlagsPatch","STM","Schedule","ScheduleDecision","ScheduleInterval","ScheduleIntervals","Scheduler","Schema","SchemaAST","Scope","ScopedCache","ScopedRef","Secret","SingleProducerAsyncInput","Sink","SortedMap","SortedSet","Stream","StreamEmit","StreamHaltStrategy","Streamable","String","Struct","Subscribable","SubscriptionRef","Supervisor","Symbol","SynchronizedRef","TArray","TDeferred","TMap","TPriorityQueue","TPubSub","TQueue","TRandom","TReentrantLock","TRef","TSemaphore","TSet","TSubscriptionRef","Take","TestAnnotation","TestAnnotationMap","TestAnnotations","TestClock","TestConfig","TestContext","TestLive","TestServices","TestSized","Tracer","Trie","Tuple","Types","Unify","UpstreamPullRequest","UpstreamPullStrategy","Utils"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AACE;;;AAGAA,MAAM;AACN;;;AAGAC,IAAI;AACJ;;;AAGAC,IAAI;AACJ;;;AAGAC,QAAQ;AACR;;;AAGAC,IAAI;AACJ;;;AAGAC,YAAY,QACP,eAAe;AAEtB;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;;;AAKA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;;;;;;;;;;;;;AAeA,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAE7C;;;;;;;AAOA,OAAO,KAAKC,MAAM,MAAM,aAAa;AAErC;;;;;;;AAOA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;;;;;;;;;;;;;;;;AAkBA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,qBAAqB,MAAM,4BAA4B;AAEnE;;;AAGA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KAAKC,MAAM,MAAM,aAA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A,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AAErD;;;AAGA,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;;;;;;;;;;;;AAcA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;AAGA,OAAO,KAAKC,GAAG,MAAM,UAAU;AAE/B;;;AAGA,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC;;;AAGA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC
|
|
1
|
+
{"version":3,"file":"index.js","names":["absurd","flow","hole","identity","pipe","unsafeCoerce","Arbitrary","Array","BigDecimal","BigInt","Boolean","Brand","Cache","Cause","Channel","ChildExecutorDecision","Chunk","Clock","Config","ConfigError","ConfigProvider","ConfigProviderPathPatch","Console","Context","Cron","Data","DateTime","DefaultServices","Deferred","Differ","Duration","Effect","Effectable","Either","Encoding","Equal","Equivalence","ExecutionStrategy","Exit","FastCheck","Fiber","FiberHandle","FiberId","FiberMap","FiberRef","FiberRefs","FiberRefsPatch","FiberSet","FiberStatus","Function","GlobalValue","GroupBy","HKT","Hash","HashMap","HashSet","Inspectable","Iterable","JSONSchema","KeyedPool","Layer","LayerMap","List","LogLevel","LogSpan","Logger","Mailbox","ManagedRuntime","Match","MergeDecision","MergeState","MergeStrategy","Metric","MetricBoundaries","MetricHook","MetricKey","MetricKeyType","MetricLabel","MetricPair","MetricPolling","MetricRegistry","MetricState","Micro","ModuleVersion","MutableHashMap","MutableHashSet","MutableList","MutableQueue","MutableRef","NonEmptyIterable","Number","Option","Order","Ordering","ParseResult","Pipeable","Pool","Predicate","Pretty","PrimaryKey","PubSub","Queue","Random","RateLimiter","RcMap","RcRef","Readable","Record","RedBlackTree","Redacted","Ref","RegExp","Reloadable","Request","RequestBlock","RequestResolver","Resource","Runtime","RuntimeFlags","RuntimeFlagsPatch","STM","Schedule","ScheduleDecision","ScheduleInterval","ScheduleIntervals","Scheduler","Schema","SchemaAST","Scope","ScopedCache","ScopedRef","Secret","SingleProducerAsyncInput","Sink","SortedMap","SortedSet","Stream","StreamEmit","StreamHaltStrategy","Streamable","String","Struct","Subscribable","SubscriptionRef","Supervisor","Symbol","SynchronizedRef","TArray","TDeferred","TMap","TPriorityQueue","TPubSub","TQueue","TRandom","TReentrantLock","TRef","TSemaphore","TSet","TSubscriptionRef","Take","TestAnnotation","TestAnnotationMap","TestAnnotations","TestClock","TestConfig","TestContext","TestLive","TestServices","TestSized","Tracer","Trie","Tuple","Types","Unify","UpstreamPullRequest","UpstreamPullStrategy","Utils"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AACE;;;AAGAA,MAAM;AACN;;;AAGAC,IAAI;AACJ;;;AAGAC,IAAI;AACJ;;;AAGAC,QAAQ;AACR;;;AAGAC,IAAI;AACJ;;;AAGAC,YAAY,QACP,eAAe;AAEtB;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;;;AAKA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;;;;;;;;;;;;;AAeA,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAE7C;;;;;;;AAOA,OAAO,KAAKC,MAAM,MAAM,aAAa;AAErC;;;;;;;AAOA,OAAO,KAAKC,OAAO,MAAM,cAAc;AAEvC;;;;;;;;;;;;;;;;;;AAkBA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KA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gBAAgB,MAAM,uBAAuB;AAEzD;;;AAGA,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC;;;AAGA,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AAErD;;;AAGA,OAAO,KAAKC,iBAAiB,MAAM,wBAAwB;AAE3D;;;AAGA,OAAO,KAAKC,eAAe,MAAM,sBAAsB;AAEvD;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAE7C;;;AAGA,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAE/C;;;AAGA,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC;;;AAGA,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAEjD;;;AAGA,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAE3C;;;AAGA,OAAO,KAAKC,MAAM,MAAM,aAAa;AAErC;;;;;;;;;;;;;;;;;AAiBA,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC;;;;;AAKA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;;;AAKA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KAAKC,KAAK,MAAM,YAAY;AAEnC;;;AAGA,OAAO,KAAKC,mBAAmB,MAAM,0BAA0B;AAE/D;;;AAGA,OAAO,KAAKC,oBAAoB,MAAM,2BAA2B;AAEjE;;;AAGA,OAAO,KAAKC,KAAK,MAAM,YAAY","ignoreList":[]}
|
package/package.json
CHANGED
package/src/Data.ts
CHANGED
|
@@ -309,10 +309,10 @@ export declare namespace TaggedEnum {
|
|
|
309
309
|
readonly taggedEnum: { readonly _tag: string }
|
|
310
310
|
readonly numberOfGenerics: Count
|
|
311
311
|
|
|
312
|
-
readonly A:
|
|
313
|
-
readonly B:
|
|
314
|
-
readonly C:
|
|
315
|
-
readonly D:
|
|
312
|
+
readonly A: unknown
|
|
313
|
+
readonly B: unknown
|
|
314
|
+
readonly C: unknown
|
|
315
|
+
readonly D: unknown
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
/**
|
package/src/Effect.ts
CHANGED
|
@@ -12023,7 +12023,7 @@ export const fork: <A, E, R>(self: Effect<A, E, R>) => Effect<Fiber.RuntimeFiber
|
|
|
12023
12023
|
* useful for tasks that need to run in the background independently, such as
|
|
12024
12024
|
* periodic logging, monitoring, or background data processing.
|
|
12025
12025
|
*
|
|
12026
|
-
* **Example** (Creating a Daemon
|
|
12026
|
+
* **Example** (Creating a Daemon Fiber)
|
|
12027
12027
|
*
|
|
12028
12028
|
* ```ts
|
|
12029
12029
|
* import { Effect, Console, Schedule } from "effect"
|
package/src/Function.ts
CHANGED
|
@@ -45,28 +45,49 @@ export const isFunction = (input: unknown): input is Function => typeof input ==
|
|
|
45
45
|
* which determines if the function is being used in a data-first or
|
|
46
46
|
* data-last style.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
48
|
+
* **Example** (Using arity to determine data-first or data-last style)
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { dual, pipe } from "effect/Function"
|
|
52
|
+
*
|
|
53
|
+
* const sum = dual<
|
|
54
|
+
* (that: number) => (self: number) => number,
|
|
55
|
+
* (self: number, that: number) => number
|
|
56
|
+
* >(2, (self, that) => self + that)
|
|
57
|
+
*
|
|
58
|
+
* console.log(sum(2, 3)) // 5
|
|
59
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* **Example** (Using call signatures to define the overloads)
|
|
63
|
+
*
|
|
49
64
|
* ```ts
|
|
50
|
-
* import * as assert from "node:assert"
|
|
51
65
|
* import { dual, pipe } from "effect/Function"
|
|
52
66
|
*
|
|
53
|
-
* // Exampe using arity to determine data-first or data-last style
|
|
54
67
|
* const sum: {
|
|
55
68
|
* (that: number): (self: number) => number
|
|
56
69
|
* (self: number, that: number): number
|
|
57
70
|
* } = dual(2, (self: number, that: number): number => self + that)
|
|
58
71
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
72
|
+
* console.log(sum(2, 3)) // 5
|
|
73
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
74
|
+
* ```
|
|
61
75
|
*
|
|
62
|
-
*
|
|
63
|
-
* const sum2: {
|
|
64
|
-
* (that: number): (self: number) => number
|
|
65
|
-
* (self: number, that: number): number
|
|
66
|
-
* } = dual((args) => args.length === 1, (self: number, that: number): number => self + that)
|
|
76
|
+
* **Example** (Using a predicate to determine data-first or data-last style)
|
|
67
77
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { dual, pipe } from "effect/Function"
|
|
80
|
+
*
|
|
81
|
+
* const sum = dual<
|
|
82
|
+
* (that: number) => (self: number) => number,
|
|
83
|
+
* (self: number, that: number) => number
|
|
84
|
+
* >(
|
|
85
|
+
* (args) => args.length === 2,
|
|
86
|
+
* (self, that) => self + that
|
|
87
|
+
* )
|
|
88
|
+
*
|
|
89
|
+
* console.log(sum(2, 3)) // 5
|
|
90
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
70
91
|
* ```
|
|
71
92
|
*
|
|
72
93
|
* @since 2.0.0
|
|
@@ -89,28 +110,49 @@ export const dual: {
|
|
|
89
110
|
* which determines if the function is being used in a data-first or
|
|
90
111
|
* data-last style.
|
|
91
112
|
*
|
|
92
|
-
*
|
|
113
|
+
* **Example** (Using arity to determine data-first or data-last style)
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { dual, pipe } from "effect/Function"
|
|
117
|
+
*
|
|
118
|
+
* const sum = dual<
|
|
119
|
+
* (that: number) => (self: number) => number,
|
|
120
|
+
* (self: number, that: number) => number
|
|
121
|
+
* >(2, (self, that) => self + that)
|
|
122
|
+
*
|
|
123
|
+
* console.log(sum(2, 3)) // 5
|
|
124
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* **Example** (Using call signatures to define the overloads)
|
|
128
|
+
*
|
|
93
129
|
* ```ts
|
|
94
|
-
* import * as assert from "node:assert"
|
|
95
130
|
* import { dual, pipe } from "effect/Function"
|
|
96
131
|
*
|
|
97
|
-
* // Exampe using arity to determine data-first or data-last style
|
|
98
132
|
* const sum: {
|
|
99
133
|
* (that: number): (self: number) => number
|
|
100
134
|
* (self: number, that: number): number
|
|
101
135
|
* } = dual(2, (self: number, that: number): number => self + that)
|
|
102
136
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
137
|
+
* console.log(sum(2, 3)) // 5
|
|
138
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
139
|
+
* ```
|
|
105
140
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* } = dual((args) => args.length === 1, (self: number, that: number): number => self + that)
|
|
141
|
+
* **Example** (Using a predicate to determine data-first or data-last style)
|
|
142
|
+
*
|
|
143
|
+
* ```ts
|
|
144
|
+
* import { dual, pipe } from "effect/Function"
|
|
111
145
|
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
146
|
+
* const sum = dual<
|
|
147
|
+
* (that: number) => (self: number) => number,
|
|
148
|
+
* (self: number, that: number) => number
|
|
149
|
+
* >(
|
|
150
|
+
* (args) => args.length === 2,
|
|
151
|
+
* (self, that) => self + that
|
|
152
|
+
* )
|
|
153
|
+
*
|
|
154
|
+
* console.log(sum(2, 3)) // 5
|
|
155
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
114
156
|
* ```
|
|
115
157
|
*
|
|
116
158
|
* @since 2.0.0
|
|
@@ -133,28 +175,49 @@ export const dual: {
|
|
|
133
175
|
* which determines if the function is being used in a data-first or
|
|
134
176
|
* data-last style.
|
|
135
177
|
*
|
|
136
|
-
*
|
|
178
|
+
* **Example** (Using arity to determine data-first or data-last style)
|
|
179
|
+
*
|
|
180
|
+
* ```ts
|
|
181
|
+
* import { dual, pipe } from "effect/Function"
|
|
182
|
+
*
|
|
183
|
+
* const sum = dual<
|
|
184
|
+
* (that: number) => (self: number) => number,
|
|
185
|
+
* (self: number, that: number) => number
|
|
186
|
+
* >(2, (self, that) => self + that)
|
|
187
|
+
*
|
|
188
|
+
* console.log(sum(2, 3)) // 5
|
|
189
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* **Example** (Using call signatures to define the overloads)
|
|
193
|
+
*
|
|
137
194
|
* ```ts
|
|
138
|
-
* import * as assert from "node:assert"
|
|
139
195
|
* import { dual, pipe } from "effect/Function"
|
|
140
196
|
*
|
|
141
|
-
* // Exampe using arity to determine data-first or data-last style
|
|
142
197
|
* const sum: {
|
|
143
198
|
* (that: number): (self: number) => number
|
|
144
199
|
* (self: number, that: number): number
|
|
145
200
|
* } = dual(2, (self: number, that: number): number => self + that)
|
|
146
201
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
202
|
+
* console.log(sum(2, 3)) // 5
|
|
203
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* **Example** (Using a predicate to determine data-first or data-last style)
|
|
149
207
|
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
208
|
+
* ```ts
|
|
209
|
+
* import { dual, pipe } from "effect/Function"
|
|
210
|
+
*
|
|
211
|
+
* const sum = dual<
|
|
212
|
+
* (that: number) => (self: number) => number,
|
|
213
|
+
* (self: number, that: number) => number
|
|
214
|
+
* >(
|
|
215
|
+
* (args) => args.length === 2,
|
|
216
|
+
* (self, that) => self + that
|
|
217
|
+
* )
|
|
155
218
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
219
|
+
* console.log(sum(2, 3)) // 5
|
|
220
|
+
* console.log(pipe(2, sum(3))) // 5
|
|
158
221
|
* ```
|
|
159
222
|
*
|
|
160
223
|
* @since 2.0.0
|