Skip to content

Commit 1c46094

Browse files
committed
PR 1584
1 parent b6b77b5 commit 1c46094

31 files changed

+98
-52
lines changed

docs/modules/Chain.ts.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,43 +173,43 @@ export declare function bind<M extends URIS4>(
173173
M: Chain4<M>
174174
): <N extends string, A, S, R, E, B>(
175175
name: Exclude<N, keyof A>,
176-
f: (a: A) => Kind4<M, S, R, E, B>
176+
f: <A2 extends A>(a: A | A2) => Kind4<M, S, R, E, B>
177177
) => (ma: Kind4<M, S, R, E, A>) => Kind4<M, S, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
178178
export declare function bind<M extends URIS3>(
179179
M: Chain3<M>
180180
): <N extends string, A, R, E, B>(
181181
name: Exclude<N, keyof A>,
182-
f: (a: A) => Kind3<M, R, E, B>
182+
f: <A2 extends A>(a: A | A2) => Kind3<M, R, E, B>
183183
) => (ma: Kind3<M, R, E, A>) => Kind3<M, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
184184
export declare function bind<M extends URIS3, E>(
185185
M: Chain3C<M, E>
186186
): <N extends string, A, R, B>(
187187
name: Exclude<N, keyof A>,
188-
f: (a: A) => Kind3<M, R, E, B>
188+
f: <A2 extends A>(a: A | A2) => Kind3<M, R, E, B>
189189
) => (ma: Kind3<M, R, E, A>) => Kind3<M, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
190190
export declare function bind<M extends URIS2>(
191191
M: Chain2<M>
192192
): <N extends string, A, E, B>(
193193
name: Exclude<N, keyof A>,
194-
f: (a: A) => Kind2<M, E, B>
194+
f: <A2 extends A>(a: A | A2) => Kind2<M, E, B>
195195
) => (ma: Kind2<M, E, A>) => Kind2<M, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
196196
export declare function bind<M extends URIS2, E>(
197197
M: Chain2C<M, E>
198198
): <N extends string, A, B>(
199199
name: Exclude<N, keyof A>,
200-
f: (a: A) => Kind2<M, E, B>
200+
f: <A2 extends A>(a: A | A2) => Kind2<M, E, B>
201201
) => (ma: Kind2<M, E, A>) => Kind2<M, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
202202
export declare function bind<M extends URIS>(
203203
M: Chain1<M>
204204
): <N extends string, A, B>(
205205
name: Exclude<N, keyof A>,
206-
f: (a: A) => Kind<M, B>
206+
f: <A2 extends A>(a: A | A2) => Kind<M, B>
207207
) => (ma: Kind<M, A>) => Kind<M, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
208208
export declare function bind<M>(
209209
M: Chain<M>
210210
): <N extends string, A, B>(
211211
name: Exclude<N, keyof A>,
212-
f: (a: A) => HKT<M, B>
212+
f: <A2 extends A>(a: A | A2) => HKT<M, B>
213213
) => (ma: HKT<M, A>) => HKT<M, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
214214
```
215215

docs/modules/Either.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ Added in v3.0.0
14061406
```ts
14071407
export declare const bind: <N, A, E, B>(
14081408
name: Exclude<N, keyof A>,
1409-
f: (a: A) => Either<E, B>
1409+
f: <A2>(a: A | A2) => Either<E, B>
14101410
) => (ma: Either<E, A>) => Either<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
14111411
```
14121412
@@ -1431,7 +1431,7 @@ Less strict version of [`bind`](#bind).
14311431
```ts
14321432
export declare const bindW: <N extends string, A, E2, B>(
14331433
name: Exclude<N, keyof A>,
1434-
f: (a: A) => Either<E2, B>
1434+
f: <A2 extends A>(a: A | A2) => Either<E2, B>
14351435
) => <E1>(fa: Either<E1, A>) => Either<E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
14361436
```
14371437

docs/modules/IO.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Added in v3.0.0
362362
```ts
363363
export declare const bind: <N, A, B>(
364364
name: Exclude<N, keyof A>,
365-
f: (a: A) => IO<B>
365+
f: <A2>(a: A | A2) => IO<B>
366366
) => (ma: IO<A>) => IO<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
367367
```
368368

docs/modules/IOEither.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ Added in v3.0.0
11071107
```ts
11081108
export declare const bind: <N, A, E, B>(
11091109
name: Exclude<N, keyof A>,
1110-
f: (a: A) => IOEither<E, B>
1110+
f: <A2>(a: A | A2) => IOEither<E, B>
11111111
) => (ma: IOEither<E, A>) => IOEither<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
11121112
```
11131113
@@ -1132,7 +1132,7 @@ Less strict version of [`bind`](#bind).
11321132
```ts
11331133
export declare const bindW: <N extends string, A, E2, B>(
11341134
name: Exclude<N, keyof A>,
1135-
f: (a: A) => IOEither<E2, B>
1135+
f: <A2 extends A>(a: A | A2) => IOEither<E2, B>
11361136
) => <E1>(fa: IOEither<E1, A>) => IOEither<E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
11371137
```
11381138

docs/modules/IOOption.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ Added in v3.0.0
863863
```ts
864864
export declare const bind: <N, A, B>(
865865
name: Exclude<N, keyof A>,
866-
f: (a: A) => IOOption<B>
866+
f: <A2>(a: A | A2) => IOOption<B>
867867
) => (ma: IOOption<A>) => IOOption<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
868868
```
869869

docs/modules/Identity.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ Added in v3.0.0
509509
```ts
510510
export declare const bind: <N, A, B>(
511511
name: Exclude<N, keyof A>,
512-
f: (a: A) => B
512+
f: <A2>(a: A | A2) => B
513513
) => (ma: A) => { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }
514514
```
515515

docs/modules/Option.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ Added in v3.0.0
13571357
```ts
13581358
export declare const bind: <N, A, B>(
13591359
name: Exclude<N, keyof A>,
1360-
f: (a: A) => Option<B>
1360+
f: <A2>(a: A | A2) => Option<B>
13611361
) => (ma: Option<A>) => Option<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
13621362
```
13631363

docs/modules/Reader.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ Added in v3.0.0
642642
```ts
643643
export declare const bind: <N, A, E, B>(
644644
name: Exclude<N, keyof A>,
645-
f: (a: A) => Reader<E, B>
645+
f: <A2>(a: A | A2) => Reader<E, B>
646646
) => (ma: Reader<E, A>) => Reader<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
647647
```
648648
@@ -667,7 +667,7 @@ Less strict version of [`bind`](#bind).
667667
```ts
668668
export declare const bindW: <N extends string, A, R2, B>(
669669
name: Exclude<N, keyof A>,
670-
f: (a: A) => Reader<R2, B>
670+
f: <A2 extends A>(a: A | A2) => Reader<R2, B>
671671
) => <R1>(fa: Reader<R1, A>) => Reader<R1 & R2, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
672672
```
673673

docs/modules/ReaderEither.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ Added in v3.0.0
11801180
```ts
11811181
export declare const bind: <N, A, R, E, B>(
11821182
name: Exclude<N, keyof A>,
1183-
f: (a: A) => ReaderEither<R, E, B>
1183+
f: <A2>(a: A | A2) => ReaderEither<R, E, B>
11841184
) => (ma: ReaderEither<R, E, A>) => ReaderEither<R, E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
11851185
```
11861186
@@ -1207,7 +1207,7 @@ Less strict version of [`bind`](#bind).
12071207
```ts
12081208
export declare const bindW: <N extends string, A, R2, E2, B>(
12091209
name: Exclude<N, keyof A>,
1210-
f: (a: A) => ReaderEither<R2, E2, B>
1210+
f: <A2 extends A>(a: A | A2) => ReaderEither<R2, E2, B>
12111211
) => <R1, E1>(
12121212
fa: ReaderEither<R1, E1, A>
12131213
) => ReaderEither<R1 & R2, E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

docs/modules/ReaderIO.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ Added in v3.0.0
615615
```ts
616616
export declare const bind: <N, A, E, B>(
617617
name: Exclude<N, keyof A>,
618-
f: (a: A) => ReaderIO<E, B>
618+
f: <A2>(a: A | A2) => ReaderIO<E, B>
619619
) => (ma: ReaderIO<E, A>) => ReaderIO<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
620620
```
621621
@@ -640,7 +640,7 @@ The `W` suffix (short for **W**idening) means that the environment types will be
640640
```ts
641641
export declare const bindW: <N extends string, A, R2, B>(
642642
name: Exclude<N, keyof A>,
643-
f: (a: A) => ReaderIO<R2, B>
643+
f: <A2 extends A>(a: A | A2) => ReaderIO<R2, B>
644644
) => <R1>(fa: ReaderIO<R1, A>) => ReaderIO<R1 & R2, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
645645
```
646646

docs/modules/ReaderTask.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ Added in v3.0.0
701701
```ts
702702
export declare const bind: <N, A, E, B>(
703703
name: Exclude<N, keyof A>,
704-
f: (a: A) => ReaderTask<E, B>
704+
f: <A2>(a: A | A2) => ReaderTask<E, B>
705705
) => (ma: ReaderTask<E, A>) => ReaderTask<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
706706
```
707707
@@ -726,7 +726,7 @@ Less strict version of [`bind`](#bind).
726726
```ts
727727
export declare const bindW: <N extends string, A, R2, B>(
728728
name: Exclude<N, keyof A>,
729-
f: (a: A) => ReaderTask<R2, B>
729+
f: <A2 extends A>(a: A | A2) => ReaderTask<R2, B>
730730
) => <R1>(fa: ReaderTask<R1, A>) => ReaderTask<R1 & R2, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
731731
```
732732

docs/modules/ReaderTaskEither.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ Added in v3.0.0
17321732
```ts
17331733
export declare const bind: <N, A, R, E, B>(
17341734
name: Exclude<N, keyof A>,
1735-
f: (a: A) => ReaderTaskEither<R, E, B>
1735+
f: <A2>(a: A | A2) => ReaderTaskEither<R, E, B>
17361736
) => (
17371737
ma: ReaderTaskEither<R, E, A>
17381738
) => ReaderTaskEither<R, E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
@@ -1761,7 +1761,7 @@ Less strict version of [`bind`](#bind).
17611761
```ts
17621762
export declare const bindW: <N extends string, A, R2, E2, B>(
17631763
name: Exclude<N, keyof A>,
1764-
f: (a: A) => ReaderTaskEither<R2, E2, B>
1764+
f: <A2 extends A>(a: A | A2) => ReaderTaskEither<R2, E2, B>
17651765
) => <R1, E1>(
17661766
fa: ReaderTaskEither<R1, E1, A>
17671767
) => ReaderTaskEither<R1 & R2, E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

docs/modules/ReadonlyArray.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,7 @@ Added in v3.0.0
21162116
```ts
21172117
export declare const bind: <N, A, B>(
21182118
name: Exclude<N, keyof A>,
2119-
f: (a: A) => readonly B[]
2119+
f: <A2>(a: A | A2) => readonly B[]
21202120
) => (ma: readonly A[]) => readonly { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }[]
21212121
```
21222122

docs/modules/ReadonlyNonEmptyArray.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ Added in v3.0.0
13311331
```ts
13321332
export declare const bind: <N, A, B>(
13331333
name: Exclude<N, keyof A>,
1334-
f: (a: A) => ReadonlyNonEmptyArray<B>
1334+
f: <A2>(a: A | A2) => ReadonlyNonEmptyArray<B>
13351335
) => (
13361336
ma: ReadonlyNonEmptyArray<A>
13371337
) => ReadonlyNonEmptyArray<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

docs/modules/State.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ Added in v3.0.0
360360
```ts
361361
export declare const bind: <N, A, E, B>(
362362
name: Exclude<N, keyof A>,
363-
f: (a: A) => State<E, B>
363+
f: <A2>(a: A | A2) => State<E, B>
364364
) => (ma: State<E, A>) => State<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
365365
```
366366

docs/modules/StateReaderTaskEither.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ Added in v3.0.0
13871387
```ts
13881388
export declare const bind: <N, A, S, R, E, B>(
13891389
name: Exclude<N, keyof A>,
1390-
f: (a: A) => StateReaderTaskEither<S, R, E, B>
1390+
f: <A2>(a: A | A2) => StateReaderTaskEither<S, R, E, B>
13911391
) => (
13921392
ma: StateReaderTaskEither<S, R, E, A>
13931393
) => StateReaderTaskEither<S, R, E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
@@ -1416,7 +1416,7 @@ Less strict version of [`bind`](#bind).
14161416
```ts
14171417
export declare const bindW: <N extends string, A, S, R2, E2, B>(
14181418
name: Exclude<N, keyof A>,
1419-
f: (a: A) => StateReaderTaskEither<S, R2, E2, B>
1419+
f: <A2 extends A>(a: A | A2) => StateReaderTaskEither<S, R2, E2, B>
14201420
) => <R1, E1>(
14211421
fa: StateReaderTaskEither<S, R1, E1, A>
14221422
) => StateReaderTaskEither<S, R1 & R2, E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

docs/modules/Task.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ Added in v3.0.0
486486
```ts
487487
export declare const bind: <N, A, B>(
488488
name: Exclude<N, keyof A>,
489-
f: (a: A) => Task<B>
489+
f: <A2>(a: A | A2) => Task<B>
490490
) => (ma: Task<A>) => Task<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
491491
```
492492

docs/modules/TaskEither.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ Added in v3.0.0
14291429
```ts
14301430
export declare const bind: <N, A, E, B>(
14311431
name: Exclude<N, keyof A>,
1432-
f: (a: A) => TaskEither<E, B>
1432+
f: <A2>(a: A | A2) => TaskEither<E, B>
14331433
) => (ma: TaskEither<E, A>) => TaskEither<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
14341434
```
14351435
@@ -1454,7 +1454,7 @@ Less strict version of [`bind`](#bind).
14541454
```ts
14551455
export declare const bindW: <N extends string, A, E2, B>(
14561456
name: Exclude<N, keyof A>,
1457-
f: (a: A) => TaskEither<E2, B>
1457+
f: <A2 extends A>(a: A | A2) => TaskEither<E2, B>
14581458
) => <E1>(fa: TaskEither<E1, A>) => TaskEither<E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
14591459
```
14601460

docs/modules/TaskOption.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ Added in v3.0.0
970970
```ts
971971
export declare const bind: <N, A, B>(
972972
name: Exclude<N, keyof A>,
973-
f: (a: A) => TaskOption<B>
973+
f: <A2>(a: A | A2) => TaskOption<B>
974974
) => (ma: TaskOption<A>) => TaskOption<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
975975
```
976976

docs/modules/Tree.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ Added in v3.0.0
639639
```ts
640640
export declare const bind: <N, A, B>(
641641
name: Exclude<N, keyof A>,
642-
f: (a: A) => Tree<B>
642+
f: <A2>(a: A | A2) => Tree<B>
643643
) => (ma: Tree<A>) => Tree<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
644644
```
645645

src/Chain.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,49 +131,49 @@ export function bind<M extends URIS4>(
131131
M: Chain4<M>
132132
): <N extends string, A, S, R, E, B>(
133133
name: Exclude<N, keyof A>,
134-
f: (a: A) => Kind4<M, S, R, E, B>
134+
f: <A2 extends A>(a: A | A2) => Kind4<M, S, R, E, B>
135135
) => (ma: Kind4<M, S, R, E, A>) => Kind4<M, S, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
136136
export function bind<M extends URIS3>(
137137
M: Chain3<M>
138138
): <N extends string, A, R, E, B>(
139139
name: Exclude<N, keyof A>,
140-
f: (a: A) => Kind3<M, R, E, B>
140+
f: <A2 extends A>(a: A | A2) => Kind3<M, R, E, B>
141141
) => (ma: Kind3<M, R, E, A>) => Kind3<M, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
142142
export function bind<M extends URIS3, E>(
143143
M: Chain3C<M, E>
144144
): <N extends string, A, R, B>(
145145
name: Exclude<N, keyof A>,
146-
f: (a: A) => Kind3<M, R, E, B>
146+
f: <A2 extends A>(a: A | A2) => Kind3<M, R, E, B>
147147
) => (ma: Kind3<M, R, E, A>) => Kind3<M, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
148148
export function bind<M extends URIS2>(
149149
M: Chain2<M>
150150
): <N extends string, A, E, B>(
151151
name: Exclude<N, keyof A>,
152-
f: (a: A) => Kind2<M, E, B>
152+
f: <A2 extends A>(a: A | A2) => Kind2<M, E, B>
153153
) => (ma: Kind2<M, E, A>) => Kind2<M, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
154154
export function bind<M extends URIS2, E>(
155155
M: Chain2C<M, E>
156156
): <N extends string, A, B>(
157157
name: Exclude<N, keyof A>,
158-
f: (a: A) => Kind2<M, E, B>
158+
f: <A2 extends A>(a: A | A2) => Kind2<M, E, B>
159159
) => (ma: Kind2<M, E, A>) => Kind2<M, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
160160
export function bind<M extends URIS>(
161161
M: Chain1<M>
162162
): <N extends string, A, B>(
163163
name: Exclude<N, keyof A>,
164-
f: (a: A) => Kind<M, B>
164+
f: <A2 extends A>(a: A | A2) => Kind<M, B>
165165
) => (ma: Kind<M, A>) => Kind<M, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
166166
export function bind<M>(
167167
M: Chain<M>
168168
): <N extends string, A, B>(
169169
name: Exclude<N, keyof A>,
170-
f: (a: A) => HKT<M, B>
170+
f: <A2 extends A>(a: A | A2) => HKT<M, B>
171171
) => (ma: HKT<M, A>) => HKT<M, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
172172
export function bind<M>(
173173
M: Chain<M>
174174
): <N extends string, A, B>(
175175
name: Exclude<N, keyof A>,
176-
f: (a: A) => HKT<M, B>
176+
f: <A2 extends A>(a: A | A2) => HKT<M, B>
177177
) => (ma: HKT<M, A>) => HKT<M, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }> {
178178
return (name, f) =>
179179
M.chain((a) =>

src/Either.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ export const bind =
11741174
*/
11751175
export const bindW: <N extends string, A, E2, B>(
11761176
name: Exclude<N, keyof A>,
1177-
f: (a: A) => Either<E2, B>
1177+
f: <A2 extends A>(a: A | A2) => Either<E2, B>
11781178
) => <E1>(
11791179
fa: Either<E1, A>
11801180
) => Either<E1 | E2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }> = bind as any

src/IOEither.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ export const bind =
838838
*/
839839
export const bindW: <N extends string, A, E2, B>(
840840
name: Exclude<N, keyof A>,
841-
f: (a: A) => IOEither<E2, B>
841+
f: <A2 extends A>(a: A | A2) => IOEither<E2, B>
842842
) => <E1>(
843843
fa: IOEither<E1, A>
844844
) => IOEither<E1 | E2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }> = bind as any

src/Reader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export const bind =
411411
*/
412412
export const bindW: <N extends string, A, R2, B>(
413413
name: Exclude<N, keyof A>,
414-
f: (a: A) => Reader<R2, B>
414+
f: <A2 extends A>(a: A | A2) => Reader<R2, B>
415415
) => <R1>(
416416
fa: Reader<R1, A>
417417
) => Reader<R1 & R2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }> = bind as any

src/ReaderEither.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ export const bind =
843843
*/
844844
export const bindW: <N extends string, A, R2, E2, B>(
845845
name: Exclude<N, keyof A>,
846-
f: (a: A) => ReaderEither<R2, E2, B>
846+
f: <A2 extends A>(a: A | A2) => ReaderEither<R2, E2, B>
847847
) => <R1, E1>(
848848
fa: ReaderEither<R1, E1, A>
849849
) => ReaderEither<R1 & R2, E1 | E2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }> = bind as any

0 commit comments

Comments
 (0)