From 8ae84df993f63d1255a9b40a614fcc79fea8ad68 Mon Sep 17 00:00:00 2001 From: gcanti Date: Sun, 16 Oct 2022 08:33:31 +0200 Subject: [PATCH] SemigroupKind: fix combineKind signature --- .changeset/heavy-laws-clean.md | 5 +++++ docs/modules/SemigroupKind.ts.md | 8 ++++---- dtslint/ts4.1/SemigroupKind.ts | 18 ++++++++++++++++++ src/SemigroupKind.ts | 8 ++++---- 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 .changeset/heavy-laws-clean.md create mode 100644 dtslint/ts4.1/SemigroupKind.ts diff --git a/.changeset/heavy-laws-clean.md b/.changeset/heavy-laws-clean.md new file mode 100644 index 000000000..f2722570a --- /dev/null +++ b/.changeset/heavy-laws-clean.md @@ -0,0 +1,5 @@ +--- +"@fp-ts/core": patch +--- + +SemigroupKind: fix combineKind signature diff --git a/docs/modules/SemigroupKind.ts.md b/docs/modules/SemigroupKind.ts.md index 011af942d..cfd34f22b 100644 --- a/docs/modules/SemigroupKind.ts.md +++ b/docs/modules/SemigroupKind.ts.md @@ -25,10 +25,10 @@ Added in v3.0.0 ```ts export interface SemigroupKind extends Functor { - readonly combineKind: ( - first: Kind, - second: Kind - ) => Kind + readonly combineKind: ( + first: Kind, + second: Kind + ) => Kind readonly combineKindMany: ( start: Kind, diff --git a/dtslint/ts4.1/SemigroupKind.ts b/dtslint/ts4.1/SemigroupKind.ts new file mode 100644 index 000000000..f08768768 --- /dev/null +++ b/dtslint/ts4.1/SemigroupKind.ts @@ -0,0 +1,18 @@ +import * as semigroupKind from "@fp-ts/core/SemigroupKind" +import type { TypeLambda } from "@fp-ts/core/HKT" + +export interface ReaderAsyncWriter { + (r: R): () => Promise<[E, A]> +} + +export interface ReaderAsyncWriterTypeLambda extends TypeLambda { + readonly type: ReaderAsyncWriter +} + +declare const fa: ReaderAsyncWriter<{ a: string }, "a", string> +declare const fb: ReaderAsyncWriter<{ b: number }, "b", number> + +export declare const SemigroupKind: semigroupKind.SemigroupKind + +// $ExpectType ReaderAsyncWriter<{ a: string; } & { b: number; }, "a" | "b", string | number> +SemigroupKind.combineKind(fa, fb) diff --git a/src/SemigroupKind.ts b/src/SemigroupKind.ts index 81970b664..09dd36649 100644 --- a/src/SemigroupKind.ts +++ b/src/SemigroupKind.ts @@ -9,10 +9,10 @@ import type { Kind, TypeLambda } from "@fp-ts/core/HKT" * @since 3.0.0 */ export interface SemigroupKind extends Functor { - readonly combineKind: ( - first: Kind, - second: Kind - ) => Kind + readonly combineKind: ( + first: Kind, + second: Kind + ) => Kind readonly combineKindMany: ( start: Kind,