effect 4.0.0-beta.21 → 4.0.0-beta.22
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/Array.d.ts +8 -9
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js.map +1 -1
- package/dist/Chunk.d.ts +4 -4
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js.map +1 -1
- package/dist/Duration.d.ts +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +1 -1
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2 -2
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js.map +1 -1
- package/dist/Filter.d.ts +4 -4
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js.map +1 -1
- package/dist/HashMap.d.ts +3 -3
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +4 -5
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js.map +1 -1
- package/dist/Record.d.ts +4 -5
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js.map +1 -1
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +7 -1
- package/dist/Runtime.js.map +1 -1
- package/dist/Stream.d.ts +7 -1
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +5 -1
- package/dist/Stream.js.map +1 -1
- package/dist/Trie.d.ts +3 -3
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js.map +1 -1
- package/dist/TxHashMap.d.ts +3 -3
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js.map +1 -1
- package/dist/internal/effect.js +10 -38
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/trie.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +2 -2
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +35 -42
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +55 -0
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +37 -0
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +2 -2
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +3 -3
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +15 -13
- package/src/Chunk.ts +6 -6
- package/src/Duration.ts +2 -2
- package/src/Effect.ts +4 -2
- package/src/Filter.ts +4 -5
- package/src/HashMap.ts +3 -3
- package/src/Iterable.ts +6 -7
- package/src/Record.ts +6 -7
- package/src/Runtime.ts +7 -1
- package/src/Stream.ts +12 -3
- package/src/Trie.ts +3 -3
- package/src/TxHashMap.ts +4 -4
- package/src/internal/effect.ts +27 -53
- package/src/internal/hashMap.ts +3 -4
- package/src/internal/trie.ts +3 -4
- package/src/unstable/ai/Chat.ts +36 -51
- package/src/unstable/ai/LanguageModel.ts +0 -1
- package/src/unstable/ai/Tool.ts +1 -1
- package/src/unstable/httpapi/HttpApiClient.ts +82 -1
- package/src/unstable/schema/VariantSchema.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariantSchema.js","names":["Effect","dual","Option","pipeArguments","Predicate","Schema","Getter","Transformation","Struct_","TypeId","cacheSymbol","Symbol","for","isStruct","u","hasProperty","FieldTypeId","isField","extract","args","self","variant","options","cache","cacheKey","isDefault","undefined","fields","key","Object","keys","value","isSchema","schemas","Struct","make","Class","identifier","annotations","variantStruct","schema","defaultVariant","SClass","Base","variants","defineProperty","annotate","id","title","FieldOnly","obj","Field","FieldExcept","includes","UnionVariants","members","Union","fieldEvolve","f","field","fromEntries","map","evolve","extractVariants","Override","Overrideable","pipe","decodeTo","optional","brand","toType","decode","passthrough","encode","o","isSome","succeed","asSome","defaultValue","StructProto","arguments","create","FieldProto","VariantUnion","filter","member"],"sources":["../../../src/unstable/schema/VariantSchema.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,MAAM,MAAM,iBAAiB;AACzC,SAASC,IAAI,QAAQ,mBAAmB;AACxC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,SAAwBC,aAAa,QAAQ,mBAAmB;AAChE,OAAO,KAAKC,SAAS,MAAM,oBAAoB;AAC/C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzC,OAAO,KAAKC,MAAM,MAAM,uBAAuB;AAC/C,OAAO,KAAKC,cAAc,MAAM,+BAA+B;AAC/D,OAAO,KAAKC,OAAO,MAAM,iBAAiB;AAE1C;;;;AAIA,OAAO,MAAMC,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"VariantSchema.js","names":["Effect","dual","Option","pipeArguments","Predicate","Schema","Getter","Transformation","Struct_","TypeId","cacheSymbol","Symbol","for","isStruct","u","hasProperty","FieldTypeId","isField","extract","args","self","variant","options","cache","cacheKey","isDefault","undefined","fields","key","Object","keys","value","isSchema","schemas","Struct","make","Class","identifier","annotations","variantStruct","schema","defaultVariant","SClass","Base","variants","defineProperty","annotate","id","title","FieldOnly","obj","Field","FieldExcept","includes","UnionVariants","members","Union","fieldEvolve","f","field","fromEntries","map","evolve","extractVariants","Override","Overrideable","pipe","decodeTo","optional","brand","toType","decode","passthrough","encode","o","isSome","succeed","asSome","defaultValue","StructProto","arguments","create","FieldProto","VariantUnion","filter","member"],"sources":["../../../src/unstable/schema/VariantSchema.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,MAAM,MAAM,iBAAiB;AACzC,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AAY;AACrB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
package/src/Array.ts
CHANGED
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
*/
|
|
86
86
|
import * as Equal from "./Equal.ts"
|
|
87
87
|
import * as Equivalence from "./Equivalence.ts"
|
|
88
|
-
import type * as Filter from "./Filter.ts"
|
|
89
88
|
import type { LazyArg } from "./Function.ts"
|
|
90
89
|
import { dual, identity } from "./Function.ts"
|
|
91
90
|
import type { TypeLambda } from "./HKT.ts"
|
|
@@ -2144,7 +2143,7 @@ export const takeWhileFilter: {
|
|
|
2144
2143
|
* @category getters
|
|
2145
2144
|
* @since 4.0.0
|
|
2146
2145
|
*/
|
|
2147
|
-
<A, B, X>(f:
|
|
2146
|
+
<A, B, X>(f: (input: NoInfer<A>, i: number) => Result.Result<B, X>): (self: Iterable<A>) => Array<B>
|
|
2148
2147
|
/**
|
|
2149
2148
|
* Takes elements from the start while a `Filter` succeeds, collecting transformed values.
|
|
2150
2149
|
*
|
|
@@ -2154,8 +2153,11 @@ export const takeWhileFilter: {
|
|
|
2154
2153
|
* @category getters
|
|
2155
2154
|
* @since 4.0.0
|
|
2156
2155
|
*/
|
|
2157
|
-
<A, B, X>(
|
|
2158
|
-
|
|
2156
|
+
<A, B, X>(
|
|
2157
|
+
self: Iterable<A>,
|
|
2158
|
+
f: (input: NoInfer<A>, i: number) => Result.Result<B, X>
|
|
2159
|
+
): Array<B>
|
|
2160
|
+
} = dual(2, <A, B, X>(self: Iterable<A>, f: (input: NoInfer<A>, i: number) => Result.Result<B, X>): Array<B> => {
|
|
2159
2161
|
let i = 0
|
|
2160
2162
|
const out: Array<B> = []
|
|
2161
2163
|
for (const a of self) {
|
|
@@ -2535,7 +2537,7 @@ export const dropWhileFilter: {
|
|
|
2535
2537
|
* @category getters
|
|
2536
2538
|
* @since 4.0.0
|
|
2537
2539
|
*/
|
|
2538
|
-
<A, B, X>(f:
|
|
2540
|
+
<A, B, X>(f: (input: NoInfer<A>, i: number) => Result.Result<B, X>): (self: Iterable<A>) => Array<A>
|
|
2539
2541
|
/**
|
|
2540
2542
|
* Drops elements from the start while a `Filter` succeeds.
|
|
2541
2543
|
*
|
|
@@ -2545,10 +2547,10 @@ export const dropWhileFilter: {
|
|
|
2545
2547
|
* @category getters
|
|
2546
2548
|
* @since 4.0.0
|
|
2547
2549
|
*/
|
|
2548
|
-
<A, B, X>(self: Iterable<A>, f:
|
|
2550
|
+
<A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result.Result<B, X>): Array<A>
|
|
2549
2551
|
} = dual(
|
|
2550
2552
|
2,
|
|
2551
|
-
<A, B, X>(self: Iterable<A>, f:
|
|
2553
|
+
<A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result.Result<B, X>): Array<A> => {
|
|
2552
2554
|
const input = fromIterable(self)
|
|
2553
2555
|
let i = 0
|
|
2554
2556
|
while (i < input.length) {
|
|
@@ -6410,7 +6412,7 @@ export const filterMap: {
|
|
|
6410
6412
|
* @category filtering
|
|
6411
6413
|
* @since 4.0.0
|
|
6412
6414
|
*/
|
|
6413
|
-
<A, B, X>(f:
|
|
6415
|
+
<A, B, X>(f: (input: NoInfer<A>, i: number) => Result.Result<B, X>): (self: Iterable<A>) => Array<B>
|
|
6414
6416
|
/**
|
|
6415
6417
|
* Keeps transformed values for elements where a `Filter` succeeds.
|
|
6416
6418
|
*
|
|
@@ -6431,8 +6433,8 @@ export const filterMap: {
|
|
|
6431
6433
|
* @category filtering
|
|
6432
6434
|
* @since 4.0.0
|
|
6433
6435
|
*/
|
|
6434
|
-
<A, B, X>(self: Iterable<A>, f:
|
|
6435
|
-
} = dual(2, <A, B, X>(self: Iterable<A>, f:
|
|
6436
|
+
<A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result.Result<B, X>): Array<B>
|
|
6437
|
+
} = dual(2, <A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result.Result<B, X>): Array<B> => {
|
|
6436
6438
|
const as = fromIterable(self)
|
|
6437
6439
|
const out: Array<B> = []
|
|
6438
6440
|
for (let i = 0; i < as.length; i++) {
|
|
@@ -6605,7 +6607,7 @@ export const partition: {
|
|
|
6605
6607
|
* @category filtering
|
|
6606
6608
|
* @since 2.0.0
|
|
6607
6609
|
*/
|
|
6608
|
-
<A, Pass, Fail>(f:
|
|
6610
|
+
<A, Pass, Fail>(f: (input: NoInfer<A>, i: number) => Result.Result<Pass, Fail>): (self: Iterable<A>) => [excluded: Array<Fail>, satisfying: Array<Pass>]
|
|
6609
6611
|
/**
|
|
6610
6612
|
* Splits an iterable using a `Filter` into failures and successes.
|
|
6611
6613
|
*
|
|
@@ -6629,12 +6631,12 @@ export const partition: {
|
|
|
6629
6631
|
* @category filtering
|
|
6630
6632
|
* @since 2.0.0
|
|
6631
6633
|
*/
|
|
6632
|
-
<A, Pass, Fail>(self: Iterable<A>, f:
|
|
6634
|
+
<A, Pass, Fail>(self: Iterable<A>, f: (input: A, i: number) => Result.Result<Pass, Fail>): [excluded: Array<Fail>, satisfying: Array<Pass>]
|
|
6633
6635
|
} = dual(
|
|
6634
6636
|
2,
|
|
6635
6637
|
<A, Pass, Fail>(
|
|
6636
6638
|
self: Iterable<A>,
|
|
6637
|
-
f:
|
|
6639
|
+
f: (input: A, i: number) => Result.Result<Pass, Fail>
|
|
6638
6640
|
): [excluded: Array<Fail>, satisfying: Array<Pass>] => {
|
|
6639
6641
|
const excluded: Array<Fail> = []
|
|
6640
6642
|
const satisfying: Array<Pass> = []
|
package/src/Chunk.ts
CHANGED
|
@@ -1564,7 +1564,7 @@ export const filterMap: {
|
|
|
1564
1564
|
* @since 2.0.0
|
|
1565
1565
|
* @category filtering
|
|
1566
1566
|
*/
|
|
1567
|
-
<A, B, X>(f:
|
|
1567
|
+
<A, B, X>(f: (input: A, i: number) => Result<B, X>): (self: Chunk<A>) => Chunk<B>
|
|
1568
1568
|
/**
|
|
1569
1569
|
* Returns a filtered and mapped subset of the elements.
|
|
1570
1570
|
*
|
|
@@ -1591,10 +1591,10 @@ export const filterMap: {
|
|
|
1591
1591
|
* @since 2.0.0
|
|
1592
1592
|
* @category filtering
|
|
1593
1593
|
*/
|
|
1594
|
-
<A, B, X>(self: Chunk<A>, f:
|
|
1594
|
+
<A, B, X>(self: Chunk<A>, f: (input: A, i: number) => Result<B, X>): Chunk<B>
|
|
1595
1595
|
} = dual(
|
|
1596
1596
|
2,
|
|
1597
|
-
<A, B, X>(self: Chunk<A>, f:
|
|
1597
|
+
<A, B, X>(self: Chunk<A>, f: (input: A, i: number) => Result<B, X>): Chunk<B> => {
|
|
1598
1598
|
const as = RA.fromIterable(self)
|
|
1599
1599
|
const out: Array<B> = []
|
|
1600
1600
|
for (let i = 0; i < as.length; i++) {
|
|
@@ -2821,7 +2821,7 @@ export const partition: {
|
|
|
2821
2821
|
* @category filtering
|
|
2822
2822
|
* @since 2.0.0
|
|
2823
2823
|
*/
|
|
2824
|
-
<A, Pass, Fail>(f:
|
|
2824
|
+
<A, Pass, Fail>(f: (input: NoInfer<A>, i: number) => Result<Pass, Fail>): (self: Chunk<A>) => [excluded: Chunk<Fail>, satisfying: Chunk<Pass>]
|
|
2825
2825
|
/**
|
|
2826
2826
|
* Splits a chunk using a `Filter` into failures and successes.
|
|
2827
2827
|
*
|
|
@@ -2843,12 +2843,12 @@ export const partition: {
|
|
|
2843
2843
|
* @category filtering
|
|
2844
2844
|
* @since 2.0.0
|
|
2845
2845
|
*/
|
|
2846
|
-
<A, Pass, Fail>(self: Chunk<A>, f:
|
|
2846
|
+
<A, Pass, Fail>(self: Chunk<A>, f: (input: A, i: number) => Result<Pass, Fail>): [excluded: Chunk<Fail>, satisfying: Chunk<Pass>]
|
|
2847
2847
|
} = dual(
|
|
2848
2848
|
2,
|
|
2849
2849
|
<A, Pass, Fail>(
|
|
2850
2850
|
self: Chunk<A>,
|
|
2851
|
-
f:
|
|
2851
|
+
f: (input: A, i: number) => Result<Pass, Fail>
|
|
2852
2852
|
): [excluded: Chunk<Fail>, satisfying: Chunk<Pass>] => {
|
|
2853
2853
|
const [excluded, satisfying] = RA.partition(self, f)
|
|
2854
2854
|
return [fromArrayUnsafe(excluded), fromArrayUnsafe(satisfying)]
|
package/src/Duration.ts
CHANGED
|
@@ -611,8 +611,8 @@ export const weeks = (weeks: number): Duration => make(weeks * 604_800_000)
|
|
|
611
611
|
* @since 2.0.0
|
|
612
612
|
* @category getters
|
|
613
613
|
*/
|
|
614
|
-
export const toMillis = (self:
|
|
615
|
-
match(
|
|
614
|
+
export const toMillis = (self: Duration): number =>
|
|
615
|
+
match(self, {
|
|
616
616
|
onMillis: identity,
|
|
617
617
|
onNanos: (nanos) => Number(nanos) / 1_000_000,
|
|
618
618
|
onInfinity: () => Infinity,
|
package/src/Effect.ts
CHANGED
|
@@ -1146,7 +1146,9 @@ export const findFirstFilter: {
|
|
|
1146
1146
|
* @since 4.0.0
|
|
1147
1147
|
* @category Collecting
|
|
1148
1148
|
*/
|
|
1149
|
-
<A, B, X, E, R>(
|
|
1149
|
+
<A, B, X, E, R>(
|
|
1150
|
+
filter: (input: NoInfer<A>, i: number) => Effect<Result.Result<B, X>, E, R>
|
|
1151
|
+
): (elements: Iterable<A>) => Effect<Option<B>, E, R>
|
|
1150
1152
|
/**
|
|
1151
1153
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
1152
1154
|
*
|
|
@@ -1158,7 +1160,7 @@ export const findFirstFilter: {
|
|
|
1158
1160
|
*/
|
|
1159
1161
|
<A, B, X, E, R>(
|
|
1160
1162
|
elements: Iterable<A>,
|
|
1161
|
-
filter:
|
|
1163
|
+
filter: (input: NoInfer<A>, i: number) => Effect<Result.Result<B, X>, E, R>
|
|
1162
1164
|
): Effect<Option<B>, E, R>
|
|
1163
1165
|
} = internal.findFirstFilter
|
|
1164
1166
|
|
package/src/Filter.ts
CHANGED
|
@@ -29,8 +29,8 @@ import type { EqualsWith, ExcludeTag, ExtractReason, ExtractTag, ReasonTags, Tag
|
|
|
29
29
|
* @since 4.0.0
|
|
30
30
|
* @category Models
|
|
31
31
|
*/
|
|
32
|
-
export interface Filter<in Input, out Pass = Input, out Fail = Input
|
|
33
|
-
(input: Input
|
|
32
|
+
export interface Filter<in Input, out Pass = Input, out Fail = Input> {
|
|
33
|
+
(input: Input): Result.Result<Pass, Fail>
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -68,10 +68,9 @@ export interface FilterEffect<
|
|
|
68
68
|
out Pass,
|
|
69
69
|
out Fail,
|
|
70
70
|
out E = never,
|
|
71
|
-
out R = never
|
|
72
|
-
in Args extends Array<any> = []
|
|
71
|
+
out R = never
|
|
73
72
|
> {
|
|
74
|
-
(input: Input
|
|
73
|
+
(input: Input): Effect<Result.Result<Pass, Fail>, E, R>
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
// -------------------------------------------------------------------------------------
|
package/src/HashMap.ts
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { Equal } from "./Equal.ts"
|
|
6
|
-
import type * as Filter from "./Filter.ts"
|
|
7
6
|
import type { Inspectable } from "./Inspectable.ts"
|
|
8
7
|
import * as internal from "./internal/hashMap.ts"
|
|
9
8
|
import type { Option } from "./Option.ts"
|
|
10
9
|
import type { Pipeable } from "./Pipeable.ts"
|
|
10
|
+
import type { Result } from "./Result.ts"
|
|
11
11
|
import type { NoInfer } from "./Types.ts"
|
|
12
12
|
|
|
13
13
|
const TypeId = internal.HashMapTypeId
|
|
@@ -2058,7 +2058,7 @@ export const filterMap: {
|
|
|
2058
2058
|
* @since 2.0.0
|
|
2059
2059
|
* @category filtering
|
|
2060
2060
|
*/
|
|
2061
|
-
<A, K, B, X>(f:
|
|
2061
|
+
<A, K, B, X>(f: (input: A, key: K) => Result<B, X>): (self: HashMap<K, A>) => HashMap<K, B>
|
|
2062
2062
|
/**
|
|
2063
2063
|
* Maps over the entries of the `HashMap` using the specified filter and keeps
|
|
2064
2064
|
* only successful results.
|
|
@@ -2082,7 +2082,7 @@ export const filterMap: {
|
|
|
2082
2082
|
* @since 2.0.0
|
|
2083
2083
|
* @category filtering
|
|
2084
2084
|
*/
|
|
2085
|
-
<K, A, B, X>(self: HashMap<K, A>, f:
|
|
2085
|
+
<K, A, B, X>(self: HashMap<K, A>, f: (input: A, key: K) => Result<B, X>): HashMap<K, B>
|
|
2086
2086
|
} = internal.filterMap
|
|
2087
2087
|
|
|
2088
2088
|
/**
|
package/src/Iterable.ts
CHANGED
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
|
|
33
33
|
import type { NonEmptyArray } from "./Array.ts"
|
|
34
34
|
import * as Equal from "./Equal.ts"
|
|
35
|
-
import type * as Filter from "./Filter.ts"
|
|
36
35
|
import { dual } from "./Function.ts"
|
|
37
36
|
import type { Option } from "./Option.ts"
|
|
38
37
|
import * as O from "./Option.ts"
|
|
@@ -3205,7 +3204,7 @@ export const filterMap: {
|
|
|
3205
3204
|
* @category filtering
|
|
3206
3205
|
* @since 2.0.0
|
|
3207
3206
|
*/
|
|
3208
|
-
<A, B, X>(f:
|
|
3207
|
+
<A, B, X>(f: (input: A, i: number) => Result<B, X>): (self: Iterable<A>) => Iterable<B>
|
|
3209
3208
|
/**
|
|
3210
3209
|
* Transforms elements of an iterable using a function that returns a `Result`, keeping only successful values.
|
|
3211
3210
|
*
|
|
@@ -3251,10 +3250,10 @@ export const filterMap: {
|
|
|
3251
3250
|
* @category filtering
|
|
3252
3251
|
* @since 2.0.0
|
|
3253
3252
|
*/
|
|
3254
|
-
<A, B, X>(self: Iterable<A>, f:
|
|
3253
|
+
<A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result<B, X>): Iterable<B>
|
|
3255
3254
|
} = dual(
|
|
3256
3255
|
2,
|
|
3257
|
-
<A, B, X>(self: Iterable<A>, f:
|
|
3256
|
+
<A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result<B, X>): Iterable<B> => ({
|
|
3258
3257
|
[Symbol.iterator]() {
|
|
3259
3258
|
const iterator = self[Symbol.iterator]()
|
|
3260
3259
|
let i = 0
|
|
@@ -3348,7 +3347,7 @@ export const filterMapWhile: {
|
|
|
3348
3347
|
* @category filtering
|
|
3349
3348
|
* @since 2.0.0
|
|
3350
3349
|
*/
|
|
3351
|
-
<A, B, X>(f:
|
|
3350
|
+
<A, B, X>(f: (input: A, i: number) => Result<B, X>): (self: Iterable<A>) => Iterable<B>
|
|
3352
3351
|
/**
|
|
3353
3352
|
* Transforms all elements of the `Iterable` for as long as the specified function succeeds.
|
|
3354
3353
|
*
|
|
@@ -3385,8 +3384,8 @@ export const filterMapWhile: {
|
|
|
3385
3384
|
* @category filtering
|
|
3386
3385
|
* @since 2.0.0
|
|
3387
3386
|
*/
|
|
3388
|
-
<A, B, X>(self: Iterable<A>, f:
|
|
3389
|
-
} = dual(2, <A, B, X>(self: Iterable<A>, f:
|
|
3387
|
+
<A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result<B, X>): Iterable<B>
|
|
3388
|
+
} = dual(2, <A, B, X>(self: Iterable<A>, f: (input: A, i: number) => Result<B, X>) => ({
|
|
3390
3389
|
[Symbol.iterator]() {
|
|
3391
3390
|
const iterator = self[Symbol.iterator]()
|
|
3392
3391
|
let i = 0
|
package/src/Record.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import type * as Combiner from "./Combiner.ts"
|
|
8
8
|
import * as Equal from "./Equal.ts"
|
|
9
9
|
import type { Equivalence } from "./Equivalence.ts"
|
|
10
|
-
import type * as Filter from "./Filter.ts"
|
|
11
10
|
import { dual, identity } from "./Function.ts"
|
|
12
11
|
import type { TypeLambda } from "./HKT.ts"
|
|
13
12
|
import * as Option from "./Option.ts"
|
|
@@ -1037,7 +1036,7 @@ export const filterMap: {
|
|
|
1037
1036
|
* @category filtering
|
|
1038
1037
|
* @since 2.0.0
|
|
1039
1038
|
*/
|
|
1040
|
-
<K extends string, A, B, X>(f:
|
|
1039
|
+
<K extends string, A, B, X>(f: (input: A, key: K) => Result<B, X>): (self: ReadonlyRecord<K, A>) => Record<ReadonlyRecord.NonLiteralKey<K>, B>
|
|
1041
1040
|
/**
|
|
1042
1041
|
* Transforms a record by applying the function `f` to each key and value in the original record.
|
|
1043
1042
|
* If the function succeeds, the key-value pair is included in the output record.
|
|
@@ -1055,12 +1054,12 @@ export const filterMap: {
|
|
|
1055
1054
|
* @category filtering
|
|
1056
1055
|
* @since 2.0.0
|
|
1057
1056
|
*/
|
|
1058
|
-
<K extends string, A, B, X>(self: ReadonlyRecord<K, A>, f:
|
|
1057
|
+
<K extends string, A, B, X>(self: ReadonlyRecord<K, A>, f: (input: A, key: K) => Result<B, X>): Record<ReadonlyRecord.NonLiteralKey<K>, B>
|
|
1059
1058
|
} = dual(
|
|
1060
1059
|
2,
|
|
1061
1060
|
<K extends string, A, B, X>(
|
|
1062
1061
|
self: ReadonlyRecord<K, A>,
|
|
1063
|
-
f:
|
|
1062
|
+
f: (input: A, key: K) => Result<B, X>
|
|
1064
1063
|
): Record<ReadonlyRecord.NonLiteralKey<K>, B> => {
|
|
1065
1064
|
const out: Record<string, B> = empty()
|
|
1066
1065
|
for (const key of keys(self)) {
|
|
@@ -1304,7 +1303,7 @@ export const partition: {
|
|
|
1304
1303
|
* @category filtering
|
|
1305
1304
|
* @since 2.0.0
|
|
1306
1305
|
*/
|
|
1307
|
-
<K extends string, A, B, C>(f:
|
|
1306
|
+
<K extends string, A, B, C>(f: (input: A, key: K) => Result<C, B>): (
|
|
1308
1307
|
self: ReadonlyRecord<K, A>
|
|
1309
1308
|
) => [left: Record<ReadonlyRecord.NonLiteralKey<K>, B>, right: Record<ReadonlyRecord.NonLiteralKey<K>, C>]
|
|
1310
1309
|
/**
|
|
@@ -1323,12 +1322,12 @@ export const partition: {
|
|
|
1323
1322
|
* @category filtering
|
|
1324
1323
|
* @since 2.0.0
|
|
1325
1324
|
*/
|
|
1326
|
-
<K extends string, A, B, C>(self: ReadonlyRecord<K, A>, f:
|
|
1325
|
+
<K extends string, A, B, C>(self: ReadonlyRecord<K, A>, f: (input: A, key: K) => Result<C, B>): [left: Record<ReadonlyRecord.NonLiteralKey<K>, B>, right: Record<ReadonlyRecord.NonLiteralKey<K>, C>]
|
|
1327
1326
|
} = dual(
|
|
1328
1327
|
2,
|
|
1329
1328
|
<K extends string, A, B, C>(
|
|
1330
1329
|
self: ReadonlyRecord<K, A>,
|
|
1331
|
-
f:
|
|
1330
|
+
f: (input: A, key: K) => Result<C, B>
|
|
1332
1331
|
): [left: Record<ReadonlyRecord.NonLiteralKey<K>, B>, right: Record<ReadonlyRecord.NonLiteralKey<K>, C>] => {
|
|
1333
1332
|
const left: Record<string, B> = empty()
|
|
1334
1333
|
const right: Record<string, C> = empty()
|
package/src/Runtime.ts
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
import * as Cause from "effect/Cause"
|
|
30
30
|
import * as Effect from "effect/Effect"
|
|
31
31
|
import * as Exit from "effect/Exit"
|
|
32
|
-
import { dual } from "effect/Function"
|
|
32
|
+
import { constVoid, dual } from "effect/Function"
|
|
33
33
|
import type * as Fiber from "./Fiber.ts"
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -212,6 +212,12 @@ export const makeRunMain = (
|
|
|
212
212
|
return Effect.logError(cause)
|
|
213
213
|
})
|
|
214
214
|
)
|
|
215
|
+
try {
|
|
216
|
+
const keepAlive = globalThis.setInterval(constVoid, 2_147_483_647)
|
|
217
|
+
fiber.addObserver(() => {
|
|
218
|
+
clearInterval(keepAlive)
|
|
219
|
+
})
|
|
220
|
+
} catch {}
|
|
215
221
|
const teardown = options?.teardown ?? defaultTeardown
|
|
216
222
|
return f({ fiber, teardown })
|
|
217
223
|
})
|
package/src/Stream.ts
CHANGED
|
@@ -963,6 +963,10 @@ export const fromIteratorSucceed = <A>(iterator: IterableIterator<A>, maxChunkSi
|
|
|
963
963
|
/**
|
|
964
964
|
* Creates a new `Stream` from an iterable collection of values.
|
|
965
965
|
*
|
|
966
|
+
* **Options**
|
|
967
|
+
*
|
|
968
|
+
* - `chunkSize`: Maximum number of values emitted per chunk.
|
|
969
|
+
*
|
|
966
970
|
* @example
|
|
967
971
|
* ```ts
|
|
968
972
|
* import { Console, Effect, Stream } from "effect"
|
|
@@ -982,10 +986,15 @@ export const fromIteratorSucceed = <A>(iterator: IterableIterator<A>, maxChunkSi
|
|
|
982
986
|
* @since 2.0.0
|
|
983
987
|
* @category Constructors
|
|
984
988
|
*/
|
|
985
|
-
export const fromIterable = <A>(
|
|
986
|
-
|
|
989
|
+
export const fromIterable = <A>(
|
|
990
|
+
iterable: Iterable<A>,
|
|
991
|
+
options?: {
|
|
992
|
+
readonly chunkSize?: number | undefined
|
|
993
|
+
}
|
|
994
|
+
): Stream<A> =>
|
|
995
|
+
Array.isArray(iterable) && options?.chunkSize === undefined
|
|
987
996
|
? fromArray(iterable)
|
|
988
|
-
: fromChannel(Channel.fromIterableArray(iterable))
|
|
997
|
+
: fromChannel(Channel.fromIterableArray(iterable, options?.chunkSize))
|
|
989
998
|
|
|
990
999
|
/**
|
|
991
1000
|
* Creates a stream from an effect producing an iterable of values.
|
package/src/Trie.ts
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
* @since 2.0.0
|
|
17
17
|
*/
|
|
18
18
|
import type { Equal } from "./Equal.ts"
|
|
19
|
-
import type * as Filter from "./Filter.ts"
|
|
20
19
|
import type { Inspectable } from "./Inspectable.ts"
|
|
21
20
|
import * as TR from "./internal/trie.ts"
|
|
22
21
|
import type { Option } from "./Option.ts"
|
|
23
22
|
import type { Pipeable } from "./Pipeable.ts"
|
|
23
|
+
import type { Result } from "./Result.ts"
|
|
24
24
|
import type { Covariant, NoInfer } from "./Types.ts"
|
|
25
25
|
|
|
26
26
|
const TypeId = TR.TrieTypeId
|
|
@@ -1585,7 +1585,7 @@ export const filterMap: {
|
|
|
1585
1585
|
* @since 2.0.0
|
|
1586
1586
|
* @category filtering
|
|
1587
1587
|
*/
|
|
1588
|
-
<A, B, X>(f:
|
|
1588
|
+
<A, B, X>(f: (input: A, key: string) => Result<B, X>): (self: Trie<A>) => Trie<B>
|
|
1589
1589
|
/**
|
|
1590
1590
|
* Maps over the entries of the `Trie` using the specified filter and keeps
|
|
1591
1591
|
* only successful results.
|
|
@@ -1634,7 +1634,7 @@ export const filterMap: {
|
|
|
1634
1634
|
* @since 2.0.0
|
|
1635
1635
|
* @category filtering
|
|
1636
1636
|
*/
|
|
1637
|
-
<A, B, X>(self: Trie<A>, f:
|
|
1637
|
+
<A, B, X>(self: Trie<A>, f: (input: A, key: string) => Result<B, X>): Trie<B>
|
|
1638
1638
|
} = TR.filterMap
|
|
1639
1639
|
|
|
1640
1640
|
/**
|
package/src/TxHashMap.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as Effect from "./Effect.ts"
|
|
6
|
-
import type * as Filter from "./Filter.ts"
|
|
7
6
|
import { format } from "./Formatter.ts"
|
|
8
7
|
import { dual } from "./Function.ts"
|
|
9
8
|
import * as HashMap from "./HashMap.ts"
|
|
@@ -12,6 +11,7 @@ import { NodeInspectSymbol, toJson } from "./Inspectable.ts"
|
|
|
12
11
|
import * as Option from "./Option.ts"
|
|
13
12
|
import type { Pipeable } from "./Pipeable.ts"
|
|
14
13
|
import { pipeArguments } from "./Pipeable.ts"
|
|
14
|
+
import type { Result } from "./Result.ts"
|
|
15
15
|
import * as TxRef from "./TxRef.ts"
|
|
16
16
|
|
|
17
17
|
const TypeId = "~effect/transactions/TxHashMap"
|
|
@@ -2835,7 +2835,7 @@ export const filterMap: {
|
|
|
2835
2835
|
* @since 2.0.0
|
|
2836
2836
|
* @category combinators
|
|
2837
2837
|
*/
|
|
2838
|
-
<V, K, A, X>(f:
|
|
2838
|
+
<V, K, A, X>(f: (input: V, key: K) => Result<A, X>): (self: TxHashMap<K, V>) => Effect.Effect<TxHashMap<K, A>, never, Effect.Transaction>
|
|
2839
2839
|
/**
|
|
2840
2840
|
* Combines filtering and mapping in a single operation. Applies a filter to each
|
|
2841
2841
|
* entry, keeping only successful results and transforming them.
|
|
@@ -2893,12 +2893,12 @@ export const filterMap: {
|
|
|
2893
2893
|
* @since 2.0.0
|
|
2894
2894
|
* @category combinators
|
|
2895
2895
|
*/
|
|
2896
|
-
<K, V, A, X>(self: TxHashMap<K, V>, f:
|
|
2896
|
+
<K, V, A, X>(self: TxHashMap<K, V>, f: (input: V, key: K) => Result<A, X>): Effect.Effect<TxHashMap<K, A>, never, Effect.Transaction>
|
|
2897
2897
|
} = dual(
|
|
2898
2898
|
2,
|
|
2899
2899
|
<K, V, A, X>(
|
|
2900
2900
|
self: TxHashMap<K, V>,
|
|
2901
|
-
f:
|
|
2901
|
+
f: (input: V, key: K) => Result<A, X>
|
|
2902
2902
|
): Effect.Effect<TxHashMap<K, A>, never, Effect.Transaction> =>
|
|
2903
2903
|
Effect.gen(function*() {
|
|
2904
2904
|
const currentMap = yield* TxRef.get(self.ref)
|