From 67841c1633e4d35b008bbb57e68f8520a6b02177 Mon Sep 17 00:00:00 2001 From: DenisFrezzato Date: Wed, 19 Apr 2023 12:44:35 +0200 Subject: [PATCH 1/2] Add chainOptionKW --- docs/modules/Either.ts.md | 17 +++++++++++++++++ docs/modules/IOEither.ts.md | 17 +++++++++++++++++ docs/modules/ReaderEither.ts.md | 17 +++++++++++++++++ docs/modules/ReaderTaskEither.ts.md | 17 +++++++++++++++++ docs/modules/StateReaderTaskEither.ts.md | 19 +++++++++++++++++++ docs/modules/TaskEither.ts.md | 17 +++++++++++++++++ src/Either.ts | 12 ++++++++++++ src/IOEither.ts | 13 +++++++++++++ src/ReaderEither.ts | 13 +++++++++++++ src/ReaderTaskEither.ts | 13 +++++++++++++ src/StateReaderTaskEither.ts | 15 +++++++++++++++ src/TaskEither.ts | 13 +++++++++++++ 12 files changed, 183 insertions(+) diff --git a/docs/modules/Either.ts.md b/docs/modules/Either.ts.md index 71c86a6a2..1e39965aa 100644 --- a/docs/modules/Either.ts.md +++ b/docs/modules/Either.ts.md @@ -156,6 +156,7 @@ Added in v2.0.0 - [chainFirstW](#chainfirstw) - [chainNullableK](#chainnullablek) - [chainOptionK](#chainoptionk) + - [chainOptionKW](#chainoptionkw) - [chainW](#chainw) - [flatten](#flatten) - [flattenW](#flattenw) @@ -1389,6 +1390,22 @@ export declare const chainOptionK: ( Added in v2.11.0 +## chainOptionKW + +Less strict version of [`chainOptionK`](#chainoptionk). + +The `W` suffix (short for **W**idening) means that the error types will be merged. + +**Signature** + +```ts +export declare const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: Either) => Either +``` + +Added in v2.13.2 + ## chainW Less strict version of [`chain`](#chain). diff --git a/docs/modules/IOEither.ts.md b/docs/modules/IOEither.ts.md index bfd1d0a0e..63df300d1 100644 --- a/docs/modules/IOEither.ts.md +++ b/docs/modules/IOEither.ts.md @@ -102,6 +102,7 @@ Added in v2.0.0 - [chainFirstW](#chainfirstw) - [chainIOK](#chainiok) - [chainOptionK](#chainoptionk) + - [chainOptionKW](#chainoptionkw) - [chainW](#chainw) - [flatten](#flatten) - [flattenW](#flattenw) @@ -1037,6 +1038,22 @@ export declare const chainOptionK: ( Added in v2.10.0 +## chainOptionKW + +Less strict version of [`chainOptionK`](#chainoptionk). + +The `W` suffix (short for **W**idening) means that the error types will be merged. + +**Signature** + +```ts +export declare const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: IOEither) => IOEither +``` + +Added in v2.13.2 + ## chainW Less strict version of [`chain`](#chain). diff --git a/docs/modules/ReaderEither.ts.md b/docs/modules/ReaderEither.ts.md index 4f1215975..883340d63 100644 --- a/docs/modules/ReaderEither.ts.md +++ b/docs/modules/ReaderEither.ts.md @@ -94,6 +94,7 @@ Added in v2.0.0 - [chainFirstReaderKW](#chainfirstreaderkw) - [chainFirstW](#chainfirstw) - [chainOptionK](#chainoptionk) + - [chainOptionKW](#chainoptionkw) - [chainReaderK](#chainreaderk) - [chainReaderKW](#chainreaderkw) - [chainW](#chainw) @@ -1061,6 +1062,22 @@ export declare const chainOptionK: ( Added in v2.10.0 +## chainOptionKW + +Less strict version of [`chainOptionK`](#chainoptionk). + +The `W` suffix (short for **W**idening) means that the error types will be merged. + +**Signature** + +```ts +export declare const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: ReaderEither) => ReaderEither +``` + +Added in v2.13.2 + ## chainReaderK **Signature** diff --git a/docs/modules/ReaderTaskEither.ts.md b/docs/modules/ReaderTaskEither.ts.md index a245274a9..26295269b 100644 --- a/docs/modules/ReaderTaskEither.ts.md +++ b/docs/modules/ReaderTaskEither.ts.md @@ -137,6 +137,7 @@ Added in v2.0.0 - [chainIOK](#chainiok) - [chainNullableK](#chainnullablek) - [chainOptionK](#chainoptionk) + - [chainOptionKW](#chainoptionkw) - [chainReaderEitherK](#chainreadereitherk) - [chainReaderEitherKW](#chainreadereitherkw) - [chainReaderIOK](#chainreaderiok) @@ -1643,6 +1644,22 @@ export declare const chainOptionK: ( Added in v2.10.0 +## chainOptionKW + +Less strict version of [`chainOptionK`](#chainoptionk). + +The `W` suffix (short for **W**idening) means that the error types will be merged. + +**Signature** + +```ts +export declare const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: ReaderTaskEither) => ReaderTaskEither +``` + +Added in v2.13.2 + ## chainReaderEitherK **Signature** diff --git a/docs/modules/StateReaderTaskEither.ts.md b/docs/modules/StateReaderTaskEither.ts.md index 1cb358fc3..d635e3e87 100644 --- a/docs/modules/StateReaderTaskEither.ts.md +++ b/docs/modules/StateReaderTaskEither.ts.md @@ -102,6 +102,7 @@ Added in v2.0.0 - [chainIOEitherKW](#chainioeitherkw) - [chainIOK](#chainiok) - [chainOptionK](#chainoptionk) + - [chainOptionKW](#chainoptionkw) - [chainReaderK](#chainreaderk) - [chainReaderKW](#chainreaderkw) - [chainReaderTaskEitherK](#chainreadertaskeitherk) @@ -1138,6 +1139,24 @@ export declare const chainOptionK: ( Added in v2.10.0 +## chainOptionKW + +Less strict version of [`chainOptionK`](#chainoptionk). + +The `W` suffix (short for **W**idening) means that the error types will be merged. + +**Signature** + +```ts +export declare const chainOptionKW: ( + onNone: Lazy +) => ( + f: (a: A) => Option +) => (ma: StateReaderTaskEither) => StateReaderTaskEither +``` + +Added in v2.13.2 + ## chainReaderK **Signature** diff --git a/docs/modules/TaskEither.ts.md b/docs/modules/TaskEither.ts.md index d4ddaac6c..adc800252 100644 --- a/docs/modules/TaskEither.ts.md +++ b/docs/modules/TaskEither.ts.md @@ -122,6 +122,7 @@ Added in v2.0.0 - [chainIOK](#chainiok) - [chainNullableK](#chainnullablek) - [chainOptionK](#chainoptionk) + - [chainOptionKW](#chainoptionkw) - [chainTaskK](#chaintaskk) - [chainTaskOptionK](#chaintaskoptionk) - [chainTaskOptionKW](#chaintaskoptionkw) @@ -1442,6 +1443,22 @@ export declare const chainOptionK: ( Added in v2.10.0 +## chainOptionKW + +Less strict version of [`chainOptionK`](#chainoptionk). + +The `W` suffix (short for **W**idening) means that the error types will be merged. + +**Signature** + +```ts +export declare const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: TaskEither) => TaskEither +``` + +Added in v2.13.2 + ## chainTaskK **Signature** diff --git a/src/Either.ts b/src/Either.ts index ce9827638..1ac20b380 100644 --- a/src/Either.ts +++ b/src/Either.ts @@ -1207,6 +1207,18 @@ export const chainOptionK: ( Chain ) +/** + * Less strict version of [`chainOptionK`](#chainoptionk). + * + * The `W` suffix (short for **W**idening) means that the error types will be merged. + * + * @category sequencing + * @since 2.13.2 + */ +export const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: Either) => Either = /*#__PURE__*/ chainOptionK as any + /** * @example * import * as E from 'fp-ts/Either' diff --git a/src/IOEither.ts b/src/IOEither.ts index 8edf0ca9c..3d87fa4d9 100644 --- a/src/IOEither.ts +++ b/src/IOEither.ts @@ -762,6 +762,19 @@ export const chainOptionK: ( Chain ) +/** + * Less strict version of [`chainOptionK`](#chainoptionk). + * + * The `W` suffix (short for **W**idening) means that the error types will be merged. + * + * @category sequencing + * @since 2.13.2 + */ +export const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: IOEither) => IOEither = + /*#__PURE__*/ chainOptionK as any + /** * @category sequencing * @since 2.4.0 diff --git a/src/ReaderEither.ts b/src/ReaderEither.ts index 186f365e3..3d5f9a93d 100644 --- a/src/ReaderEither.ts +++ b/src/ReaderEither.ts @@ -785,6 +785,19 @@ export const chainOptionK: ( ) => (f: (a: A) => Option) => (ma: ReaderEither) => ReaderEither = /*#__PURE__*/ chainOptionK_(FromEither, Chain) +/** + * Less strict version of [`chainOptionK`](#chainoptionk). + * + * The `W` suffix (short for **W**idening) means that the error types will be merged. + * + * @category sequencing + * @since 2.13.2 + */ +export const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: ReaderEither) => ReaderEither = + /*#__PURE__*/ chainOptionK as any + /** * @category sequencing * @since 2.4.0 diff --git a/src/ReaderTaskEither.ts b/src/ReaderTaskEither.ts index 0469f39a9..17729d3e0 100644 --- a/src/ReaderTaskEither.ts +++ b/src/ReaderTaskEither.ts @@ -1231,6 +1231,19 @@ export const chainOptionK: ( ) => (f: (a: A) => Option) => (ma: ReaderTaskEither) => ReaderTaskEither = /*#__PURE__*/ chainOptionK_(FromEither, Chain) +/** + * Less strict version of [`chainOptionK`](#chainoptionk). + * + * The `W` suffix (short for **W**idening) means that the error types will be merged. + * + * @category sequencing + * @since 2.13.2 + */ +export const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: ReaderTaskEither) => ReaderTaskEither = + /*#__PURE__*/ chainOptionK as any + /** * @category sequencing * @since 2.4.0 diff --git a/src/StateReaderTaskEither.ts b/src/StateReaderTaskEither.ts index cf2f3b4c2..c75664b69 100644 --- a/src/StateReaderTaskEither.ts +++ b/src/StateReaderTaskEither.ts @@ -909,6 +909,21 @@ export const chainOptionK: ( Chain ) +/** + * Less strict version of [`chainOptionK`](#chainoptionk). + * + * The `W` suffix (short for **W**idening) means that the error types will be merged. + * + * @category sequencing + * @since 2.13.2 + */ +export const chainOptionKW: ( + onNone: Lazy +) => ( + f: (a: A) => Option +) => (ma: StateReaderTaskEither) => StateReaderTaskEither = + /*#__PURE__*/ chainOptionK as any + /** * @category sequencing * @since 2.4.0 diff --git a/src/TaskEither.ts b/src/TaskEither.ts index 840af8979..601d7d28d 100644 --- a/src/TaskEither.ts +++ b/src/TaskEither.ts @@ -1010,6 +1010,19 @@ export const chainOptionK: ( Chain ) +/** + * Less strict version of [`chainOptionK`](#chainoptionk). + * + * The `W` suffix (short for **W**idening) means that the error types will be merged. + * + * @category sequencing + * @since 2.13.2 + */ +export const chainOptionKW: ( + onNone: Lazy +) => (f: (a: A) => Option) => (ma: TaskEither) => TaskEither = + /*#__PURE__*/ chainOptionK as any + /** * @category sequencing * @since 2.4.0 From be0d115ffa082a40175875104dd6e591d3cf5340 Mon Sep 17 00:00:00 2001 From: DenisFrezzato Date: Wed, 19 Apr 2023 12:44:40 +0200 Subject: [PATCH 2/2] 2.13.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 08231b4b1..45e4de070 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fp-ts", - "version": "2.13.0-rc.6", + "version": "2.13.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fp-ts", - "version": "2.13.0-rc.6", + "version": "2.13.2", "license": "MIT", "devDependencies": { "@types/benchmark": "^1.0.31", diff --git a/package.json b/package.json index 1edb8628f..0d1e8d72a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fp-ts", - "version": "2.13.1", + "version": "2.13.2", "description": "Functional programming in TypeScript", "main": "./lib/index.js", "module": "./es6/index.js",