Skip to content

Commit

Permalink
forbid shadowing keys in do context
Browse files Browse the repository at this point in the history
  • Loading branch information
Punie authored and gcanti committed Sep 14, 2022
1 parent 6324968 commit b3cd423
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docs/modules/Array.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3295,7 +3295,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: A[]) => { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }[]
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Either.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ Added in v2.8.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: Either<E, A>) => Either<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
14 changes: 7 additions & 7 deletions docs/modules/Functor.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,45 +227,45 @@ Added in v2.0.0
export declare function bindMap<F extends URIS4>(
F: Functor4<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <S, R, E>(
fa: Kind4<F, S, R, E, A>
) => Kind4<F, S, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export declare function bindMap<F extends URIS3>(
F: Functor3<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <R, E>(fa: Kind3<F, R, E, A>) => Kind3<F, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export declare function bindMap<F extends URIS3, E>(
F: Functor3C<F, E>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <R>(fa: Kind3<F, R, E, A>) => Kind3<F, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export declare function bindMap<F extends URIS2>(
F: Functor2<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: Kind2<F, E, A>) => Kind2<F, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export declare function bindMap<F extends URIS2, E>(
F: Functor2C<F, E>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: Kind2<F, E, A>) => Kind2<F, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export declare function bindMap<F extends URIS>(
F: Functor1<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: Kind<F, A>) => Kind<F, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export declare function bindMap<F>(
F: Functor<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: HKT<F, A>) => HKT<F, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/IO.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Added in v2.8.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: IO<A>) => IO<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/IOEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: IOEither<E, A>) => IOEither<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/IOOption.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ Added in v2.12.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: IOOption<A>) => IOOption<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Identity.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ Added in v2.8.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: A) => { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/NonEmptyArray.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: NonEmptyArray<A>) => NonEmptyArray<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Option.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@ Added in v2.8.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: Option<A>) => Option<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Reader.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ Added in v2.8.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: Reader<E, A>) => Reader<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ReaderEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <R, E>(
fa: ReaderEither<R, E, A>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ReaderTask.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ Added in v2.8.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: ReaderTask<E, A>) => ReaderTask<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ReaderTaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <R, E>(
fa: ReaderTaskEither<R, E, A>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ReadonlyArray.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2442,7 +2442,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: readonly A[]) => readonly { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }[]
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ReadonlyNonEmptyArray.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (
fa: ReadonlyNonEmptyArray<A>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/State.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Added in v2.8.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: State<E, A>) => State<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/StateReaderTaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <S, R, E>(
fa: StateReaderTaskEither<S, R, E, A>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Task.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: Task<A>) => Task<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/TaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: TaskEither<E, A>) => TaskEither<E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/TaskOption.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ Added in v2.10.0
```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: TaskOption<A>) => TaskOption<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Tree.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ Added in v2.8.0

```ts
export declare const bindMap: <N, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: Tree<A>) => Tree<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>
```
Expand Down
16 changes: 8 additions & 8 deletions src/Functor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,51 +195,51 @@ export function bindTo<F>(
export function bindMap<F extends URIS4>(
F: Functor4<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <S, R, E>(
fa: Kind4<F, S, R, E, A>
) => Kind4<F, S, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export function bindMap<F extends URIS3>(
F: Functor3<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <R, E>(fa: Kind3<F, R, E, A>) => Kind3<F, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export function bindMap<F extends URIS3, E>(
F: Functor3C<F, E>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <R>(fa: Kind3<F, R, E, A>) => Kind3<F, R, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export function bindMap<F extends URIS2>(
F: Functor2<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => <E>(fa: Kind2<F, E, A>) => Kind2<F, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export function bindMap<F extends URIS2, E>(
F: Functor2C<F, E>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: Kind2<F, E, A>) => Kind2<F, E, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export function bindMap<F extends URIS>(
F: Functor1<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: Kind<F, A>) => Kind<F, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export function bindMap<F>(
F: Functor<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: HKT<F, A>) => HKT<F, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }>
export function bindMap<F>(
F: Functor<F>
): <N extends string, A, B>(
name: N,
name: Exclude<N, keyof A>,
f: (a: A) => B
) => (fa: HKT<F, A>) => HKT<F, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B }> {
return (name, f) => (fa) => F.map(fa, (a) => Object.assign({}, a, { [name]: f(a) }) as any)
Expand Down

0 comments on commit b3cd423

Please sign in to comment.