Skip to content

Commit

Permalink
SemigroupKind: fix combineKind signature
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored and mikearnaldi committed Oct 16, 2022
1 parent 4953ec5 commit 8ae84df
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-laws-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fp-ts/core": patch
---

SemigroupKind: fix combineKind signature
8 changes: 4 additions & 4 deletions docs/modules/SemigroupKind.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Added in v3.0.0

```ts
export interface SemigroupKind<F extends TypeLambda> extends Functor<F> {
readonly combineKind: <S, R, O, E, A, B>(
first: Kind<F, S, R, O, E, A>,
second: Kind<F, S, R, O, E, A>
) => Kind<F, S, R, O, E, A | B>
readonly combineKind: <S, R1, O1, E1, A, R2, O2, E2, B>(
first: Kind<F, S, R1, O1, E1, A>,
second: Kind<F, S, R2, O2, E2, B>
) => Kind<F, S, R1 & R2, O1 | O2, E1 | E2, A | B>

readonly combineKindMany: <S, R, O, E, A>(
start: Kind<F, S, R, O, E, A>,
Expand Down
18 changes: 18 additions & 0 deletions dtslint/ts4.1/SemigroupKind.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as semigroupKind from "@fp-ts/core/SemigroupKind"
import type { TypeLambda } from "@fp-ts/core/HKT"

export interface ReaderAsyncWriter<R, E, A> {
(r: R): () => Promise<[E, A]>
}

export interface ReaderAsyncWriterTypeLambda extends TypeLambda {
readonly type: ReaderAsyncWriter<this["In1"], this["Out2"], this["Out1"]>
}

declare const fa: ReaderAsyncWriter<{ a: string }, "a", string>
declare const fb: ReaderAsyncWriter<{ b: number }, "b", number>

export declare const SemigroupKind: semigroupKind.SemigroupKind<ReaderAsyncWriterTypeLambda>

// $ExpectType ReaderAsyncWriter<{ a: string; } & { b: number; }, "a" | "b", string | number>
SemigroupKind.combineKind(fa, fb)
8 changes: 4 additions & 4 deletions src/SemigroupKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import type { Kind, TypeLambda } from "@fp-ts/core/HKT"
* @since 3.0.0
*/
export interface SemigroupKind<F extends TypeLambda> extends Functor<F> {
readonly combineKind: <S, R, O, E, A, B>(
first: Kind<F, S, R, O, E, A>,
second: Kind<F, S, R, O, E, A>
) => Kind<F, S, R, O, E, A | B>
readonly combineKind: <S, R1, O1, E1, A, R2, O2, E2, B>(
first: Kind<F, S, R1, O1, E1, A>,
second: Kind<F, S, R2, O2, E2, B>
) => Kind<F, S, R1 & R2, O1 | O2, E1 | E2, A | B>

readonly combineKindMany: <S, R, O, E, A>(
start: Kind<F, S, R, O, E, A>,
Expand Down

0 comments on commit 8ae84df

Please sign in to comment.