effect 4.0.0-beta.0 → 4.0.0-beta.1
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/Effect.d.ts +50 -0
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js.map +1 -1
- package/dist/internal/effect.js +6 -0
- package/dist/internal/effect.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/package.json +1 -1
- package/src/Effect.ts +59 -0
- package/src/internal/effect.ts +13 -0
- package/src/unstable/cli/Prompt.ts +2 -2
package/dist/Effect.d.ts
CHANGED
|
@@ -7433,6 +7433,32 @@ export declare const filter: {
|
|
|
7433
7433
|
* @category Filtering
|
|
7434
7434
|
*/
|
|
7435
7435
|
<A>(predicate: Predicate.Predicate<NoInfer<A>>): (elements: Iterable<A>) => Effect<Array<A>>;
|
|
7436
|
+
/**
|
|
7437
|
+
* Filters elements of an iterable using a predicate, refinement, effectful
|
|
7438
|
+
* predicate, or `Filter.FilterEffect`.
|
|
7439
|
+
*
|
|
7440
|
+
* @example
|
|
7441
|
+
* ```ts
|
|
7442
|
+
* import { Effect, Filter, Result } from "effect"
|
|
7443
|
+
*
|
|
7444
|
+
* // Sync predicate
|
|
7445
|
+
* const evens = Effect.filter([1, 2, 3, 4], (n) => n % 2 === 0)
|
|
7446
|
+
*
|
|
7447
|
+
* // Effectful predicate
|
|
7448
|
+
* const checked = Effect.filter([1, 2, 3], (n) => Effect.succeed(n > 1))
|
|
7449
|
+
*
|
|
7450
|
+
* // FilterEffect
|
|
7451
|
+
* const mapped = Effect.filter([1, 2, 3, 4], (n) =>
|
|
7452
|
+
* Effect.succeed(n % 2 === 0 ? Result.succeed(n * 2) : Result.fail(n))
|
|
7453
|
+
* )
|
|
7454
|
+
* ```
|
|
7455
|
+
*
|
|
7456
|
+
* @since 2.0.0
|
|
7457
|
+
* @category Filtering
|
|
7458
|
+
*/
|
|
7459
|
+
<A, B, X>(filter: Filter.Filter<NoInfer<A>, B, X>, options?: {
|
|
7460
|
+
readonly concurrency?: Concurrency | undefined;
|
|
7461
|
+
}): (elements: Iterable<A>) => Effect<Array<B>>;
|
|
7436
7462
|
/**
|
|
7437
7463
|
* Filters elements of an iterable using a predicate, refinement, effectful
|
|
7438
7464
|
* predicate, or `Filter.FilterEffect`.
|
|
@@ -7533,6 +7559,30 @@ export declare const filter: {
|
|
|
7533
7559
|
* @category Filtering
|
|
7534
7560
|
*/
|
|
7535
7561
|
<A>(elements: Iterable<A>, predicate: Predicate.Predicate<A>): Effect<Array<A>>;
|
|
7562
|
+
/**
|
|
7563
|
+
* Filters elements of an iterable using a predicate, refinement, effectful
|
|
7564
|
+
* predicate, or `Filter.FilterEffect`.
|
|
7565
|
+
*
|
|
7566
|
+
* @example
|
|
7567
|
+
* ```ts
|
|
7568
|
+
* import { Effect, Filter, Result } from "effect"
|
|
7569
|
+
*
|
|
7570
|
+
* // Sync predicate
|
|
7571
|
+
* const evens = Effect.filter([1, 2, 3, 4], (n) => n % 2 === 0)
|
|
7572
|
+
*
|
|
7573
|
+
* // Effectful predicate
|
|
7574
|
+
* const checked = Effect.filter([1, 2, 3], (n) => Effect.succeed(n > 1))
|
|
7575
|
+
*
|
|
7576
|
+
* // FilterEffect
|
|
7577
|
+
* const mapped = Effect.filter([1, 2, 3, 4], (n) =>
|
|
7578
|
+
* Effect.succeed(n % 2 === 0 ? Result.succeed(n * 2) : Result.fail(n))
|
|
7579
|
+
* )
|
|
7580
|
+
* ```
|
|
7581
|
+
*
|
|
7582
|
+
* @since 2.0.0
|
|
7583
|
+
* @category Filtering
|
|
7584
|
+
*/
|
|
7585
|
+
<A, B, X>(elements: Iterable<A>, filter: Filter.Filter<NoInfer<A>, B, X>): Effect<Array<B>>;
|
|
7536
7586
|
/**
|
|
7537
7587
|
* Filters elements of an iterable using a predicate, refinement, effectful
|
|
7538
7588
|
* predicate, or `Filter.FilterEffect`.
|