From 93dcc86ff43252b964711bf18cc9a59efa0c0349 Mon Sep 17 00:00:00 2001 From: gcanti Date: Wed, 17 Feb 2021 14:12:57 +0100 Subject: [PATCH] export missing instances --- CHANGELOG.md | 52 +++++++++++++++++---- docs/modules/ReaderTask.ts.md | 44 ++++++++++++++++++ docs/modules/ReaderTaskEither.ts.md | 55 ++++++++++++++++++++++ docs/modules/StateReaderTaskEither.ts.md | 33 +++++++++++++ docs/modules/Task.ts.md | 44 ++++++++++++++++++ docs/modules/TaskEither.ts.md | 55 ++++++++++++++++++++++ docs/modules/TaskOption.ts.md | 22 +++++++++ src/ReaderTask.ts | 34 +++++++++++++- src/ReaderTaskEither.ts | 56 +++++++++++++++++++++- src/StateReaderTaskEither.ts | 41 ++++++++++++++++ src/Task.ts | 34 +++++++++++++- src/TaskEither.ts | 59 +++++++++++++++++++++++- src/TaskOption.ts | 15 +++++- 13 files changed, 527 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d22c6dd03..8e0160515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,16 +17,48 @@ high state of flux, you're at risk of it changing without notice. # 2.10.0-rc.2 -- `Choice` - - deprecate `splitChoice` in favour of `split` - - deprecate `fanin` in favour of `fanIn` -- `Compactable` - - split `compact` / `separate` constraints -- `Reader` - - export `first`, `second`, `left`, `right` -- `Strong` - - deprecate `splitString` in favour of `split` - - deprecate `fanout` in favour of `fanOut` +- **Deprecations** + - `Choice` + - deprecate `splitChoice` in favour of `split` + - deprecate `fanin` in favour of `fanIn` + - `Strong` + - deprecate `splitString` in favour of `split` + - deprecate `fanout` in favour of `fanOut` +- **New Feature** + - `Reader` + - export `first`, `second`, `left`, `right` + - `ReaderTask` + - export `Chain` instance + - export `Monad` instance + - export `MonadIO` instance + - export `MonadTask` instance + - `ReaderTaskEither` + - export `Chain` instance + - export `Monad` instance + - export `MonadIO` instance + - export `MonadTask` instance + - export `MonadThrow` instance + - `StateReaderTaskEither` + - export `MonadIO` instance + - export `MonadTask` instance + - export `MonadThrow` instance + - `Task` + - export `Chain` instance + - export `Monad` instance + - export `MonadIO` instance + - export `MonadTask` instance + - `TaskEither` + - export `Chain` instance + - export `Monad` instance + - export `MonadIO` instance + - export `MonadTask` instance + - export `MonadThrow` instance + - `TaskOption` + - export `Chain` instance + - export `Monad` instance +- **Polish** + - `Compactable` + - split `compact` / `separate` constraints # 2.10.0-rc.1 diff --git a/docs/modules/ReaderTask.ts.md b/docs/modules/ReaderTask.ts.md index 84eb2e088..2337c76e6 100644 --- a/docs/modules/ReaderTask.ts.md +++ b/docs/modules/ReaderTask.ts.md @@ -46,9 +46,13 @@ Added in v2.3.0 - [ApplicativeSeq](#applicativeseq) - [ApplyPar](#applypar) - [ApplySeq](#applyseq) + - [Chain](#chain) - [FromIO](#fromio) - [FromTask](#fromtask) - [Functor](#functor-1) + - [Monad](#monad-1) + - [MonadIO](#monadio) + - [MonadTask](#monadtask) - [Pointed](#pointed-1) - [URI](#uri) - [URI (type alias)](#uri-type-alias) @@ -395,6 +399,16 @@ export declare const ApplySeq: Apply2<'ReaderTask'> Added in v2.10.0 +## Chain + +**Signature** + +```ts +export declare const Chain: Chain2<'ReaderTask'> +``` + +Added in v2.10.0 + ## FromIO **Signature** @@ -425,6 +439,36 @@ export declare const Functor: Functor2<'ReaderTask'> Added in v2.7.0 +## Monad + +**Signature** + +```ts +export declare const Monad: Monad2<'ReaderTask'> +``` + +Added in v2.10.0 + +## MonadIO + +**Signature** + +```ts +export declare const MonadIO: MonadIO2<'ReaderTask'> +``` + +Added in v2.10.0 + +## MonadTask + +**Signature** + +```ts +export declare const MonadTask: MonadTask2<'ReaderTask'> +``` + +Added in v2.10.0 + ## Pointed **Signature** diff --git a/docs/modules/ReaderTaskEither.ts.md b/docs/modules/ReaderTaskEither.ts.md index e22c797b1..266c74331 100644 --- a/docs/modules/ReaderTaskEither.ts.md +++ b/docs/modules/ReaderTaskEither.ts.md @@ -96,10 +96,15 @@ Added in v2.0.0 - [ApplyPar](#applypar) - [ApplySeq](#applyseq) - [Bifunctor](#bifunctor-1) + - [Chain](#chain) - [FromEither](#fromeither) - [FromIO](#fromio) - [FromTask](#fromtask) - [Functor](#functor-1) + - [Monad](#monad-1) + - [MonadIO](#monadio) + - [MonadTask](#monadtask) + - [MonadThrow](#monadthrow-1) - [Pointed](#pointed-1) - [URI](#uri) - [URI (type alias)](#uri-type-alias) @@ -1038,6 +1043,16 @@ export declare const Bifunctor: Bifunctor3<'ReaderTaskEither'> Added in v2.7.0 +## Chain + +**Signature** + +```ts +export declare const Chain: Chain3<'ReaderTaskEither'> +``` + +Added in v2.10.0 + ## FromEither **Signature** @@ -1078,6 +1093,46 @@ export declare const Functor: Functor3<'ReaderTaskEither'> Added in v2.7.0 +## Monad + +**Signature** + +```ts +export declare const Monad: Monad3<'ReaderTaskEither'> +``` + +Added in v2.10.0 + +## MonadIO + +**Signature** + +```ts +export declare const MonadIO: MonadIO3<'ReaderTaskEither'> +``` + +Added in v2.10.0 + +## MonadTask + +**Signature** + +```ts +export declare const MonadTask: MonadTask3<'ReaderTaskEither'> +``` + +Added in v2.10.0 + +## MonadThrow + +**Signature** + +```ts +export declare const MonadThrow: MonadThrow3<'ReaderTaskEither'> +``` + +Added in v2.10.0 + ## Pointed **Signature** diff --git a/docs/modules/StateReaderTaskEither.ts.md b/docs/modules/StateReaderTaskEither.ts.md index b4ed6fb2e..5cc8cd22a 100644 --- a/docs/modules/StateReaderTaskEither.ts.md +++ b/docs/modules/StateReaderTaskEither.ts.md @@ -95,6 +95,9 @@ Added in v2.0.0 - [FromTask](#fromtask) - [Functor](#functor-1) - [Monad](#monad-1) + - [MonadIO](#monadio) + - [MonadTask](#monadtask) + - [MonadThrow](#monadthrow-1) - [Pointed](#pointed-1) - [URI](#uri) - [URI (type alias)](#uri-type-alias) @@ -1018,6 +1021,36 @@ export declare const Monad: Monad4<'StateReaderTaskEither'> Added in v2.10.0 +## MonadIO + +**Signature** + +```ts +export declare const MonadIO: MonadIO4<'StateReaderTaskEither'> +``` + +Added in v2.10.0 + +## MonadTask + +**Signature** + +```ts +export declare const MonadTask: MonadTask4<'StateReaderTaskEither'> +``` + +Added in v2.10.0 + +## MonadThrow + +**Signature** + +```ts +export declare const MonadThrow: MonadThrow4<'StateReaderTaskEither'> +``` + +Added in v2.10.0 + ## Pointed **Signature** diff --git a/docs/modules/Task.ts.md b/docs/modules/Task.ts.md index 364dc40a3..0c30e423f 100644 --- a/docs/modules/Task.ts.md +++ b/docs/modules/Task.ts.md @@ -48,9 +48,13 @@ Added in v2.0.0 - [ApplicativeSeq](#applicativeseq) - [ApplyPar](#applypar) - [ApplySeq](#applyseq) + - [Chain](#chain) - [FromIO](#fromio) - [FromTask](#fromtask-1) - [Functor](#functor-1) + - [Monad](#monad-1) + - [MonadIO](#monadio) + - [MonadTask](#monadtask) - [Pointed](#pointed-1) - [URI](#uri) - [URI (type alias)](#uri-type-alias) @@ -331,6 +335,16 @@ export declare const ApplySeq: Apply1<'Task'> Added in v2.10.0 +## Chain + +**Signature** + +```ts +export declare const Chain: Chain1<'Task'> +``` + +Added in v2.10.0 + ## FromIO **Signature** @@ -361,6 +375,36 @@ export declare const Functor: Functor1<'Task'> Added in v2.7.0 +## Monad + +**Signature** + +```ts +export declare const Monad: Monad1<'Task'> +``` + +Added in v2.10.0 + +## MonadIO + +**Signature** + +```ts +export declare const MonadIO: MonadIO1<'Task'> +``` + +Added in v2.10.0 + +## MonadTask + +**Signature** + +```ts +export declare const MonadTask: MonadTask1<'Task'> +``` + +Added in v2.10.0 + ## Pointed **Signature** diff --git a/docs/modules/TaskEither.ts.md b/docs/modules/TaskEither.ts.md index 503e1614e..93e1e119f 100644 --- a/docs/modules/TaskEither.ts.md +++ b/docs/modules/TaskEither.ts.md @@ -93,10 +93,15 @@ Added in v2.0.0 - [ApplyPar](#applypar) - [ApplySeq](#applyseq) - [Bifunctor](#bifunctor-1) + - [Chain](#chain) - [FromEither](#fromeither) - [FromIO](#fromio) - [FromTask](#fromtask) - [Functor](#functor-1) + - [Monad](#monad-1) + - [MonadIO](#monadio) + - [MonadTask](#monadtask-1) + - [MonadThrow](#monadthrow) - [Pointed](#pointed-1) - [URI](#uri) - [URI (type alias)](#uri-type-alias) @@ -969,6 +974,16 @@ export declare const Bifunctor: Bifunctor2<'TaskEither'> Added in v2.7.0 +## Chain + +**Signature** + +```ts +export declare const Chain: Chain2<'TaskEither'> +``` + +Added in v2.10.0 + ## FromEither **Signature** @@ -1009,6 +1024,46 @@ export declare const Functor: Functor2<'TaskEither'> Added in v2.7.0 +## Monad + +**Signature** + +```ts +export declare const Monad: Monad2<'TaskEither'> +``` + +Added in v2.10.0 + +## MonadIO + +**Signature** + +```ts +export declare const MonadIO: MonadIO2<'TaskEither'> +``` + +Added in v2.10.0 + +## MonadTask + +**Signature** + +```ts +export declare const MonadTask: MonadTask2<'TaskEither'> +``` + +Added in v2.10.0 + +## MonadThrow + +**Signature** + +```ts +export declare const MonadThrow: MonadThrow2<'TaskEither'> +``` + +Added in v2.10.0 + ## Pointed **Signature** diff --git a/docs/modules/TaskOption.ts.md b/docs/modules/TaskOption.ts.md index b77657b15..ea51c5212 100644 --- a/docs/modules/TaskOption.ts.md +++ b/docs/modules/TaskOption.ts.md @@ -74,11 +74,13 @@ Added in v2.10.0 - [ApplicativeSeq](#applicativeseq) - [ApplyPar](#applypar) - [ApplySeq](#applyseq) + - [Chain](#chain) - [Compactable](#compactable-1) - [Filterable](#filterable-1) - [FromIO](#fromio) - [FromTask](#fromtask) - [Functor](#functor-1) + - [Monad](#monad-1) - [MonadIO](#monadio) - [MonadTask](#monadtask) - [Pointed](#pointed-1) @@ -684,6 +686,16 @@ export declare const ApplySeq: Apply1<'TaskOption'> Added in v2.10.0 +## Chain + +**Signature** + +```ts +export declare const Chain: Chain1<'TaskOption'> +``` + +Added in v2.10.0 + ## Compactable **Signature** @@ -734,6 +746,16 @@ export declare const Functor: Functor1<'TaskOption'> Added in v2.10.0 +## Monad + +**Signature** + +```ts +export declare const Monad: Monad1<'TaskOption'> +``` + +Added in v2.10.0 + ## MonadIO **Signature** diff --git a/src/ReaderTask.ts b/src/ReaderTask.ts index a3d78b2c4..b56f84a46 100644 --- a/src/ReaderTask.ts +++ b/src/ReaderTask.ts @@ -20,6 +20,7 @@ import { import { flow, identity, pipe } from './function' import { bindTo as bindTo_, flap as flap_, Functor2 } from './Functor' import { Monad2 } from './Monad' +import { MonadIO2 } from './MonadIO' import { MonadTask2 } from './MonadTask' import { Monoid } from './Monoid' import { Pointed2 } from './Pointed' @@ -290,7 +291,8 @@ export const ApplicativeSeq: Applicative2 = { } /** - * @internal + * @category instances + * @since 2.10.0 */ export const Chain: Chain2 = { URI, @@ -300,7 +302,8 @@ export const Chain: Chain2 = { } /** - * @internal + * @category instances + * @since 2.10.0 */ export const Monad: Monad2 = { URI, @@ -310,6 +313,33 @@ export const Monad: Monad2 = { chain: _chain } +/** + * @category instances + * @since 2.10.0 + */ +export const MonadIO: MonadIO2 = { + URI, + map: _map, + of, + ap: _apPar, + chain: _chain, + fromIO +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadTask: MonadTask2 = { + URI, + map: _map, + of, + ap: _apPar, + chain: _chain, + fromIO, + fromTask +} + /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. diff --git a/src/ReaderTaskEither.ts b/src/ReaderTaskEither.ts index e8174abc5..0a6148f9c 100644 --- a/src/ReaderTaskEither.ts +++ b/src/ReaderTaskEither.ts @@ -46,6 +46,7 @@ import { bindTo as bindTo_, flap as flap_, Functor3 } from './Functor' import { IO } from './IO' import { IOEither } from './IOEither' import { Monad3, Monad3C } from './Monad' +import { MonadIO3 } from './MonadIO' import { MonadTask3, MonadTask3C } from './MonadTask' import { MonadThrow3, MonadThrow3C } from './MonadThrow' import { Monoid } from './Monoid' @@ -697,7 +698,8 @@ export const ApplicativeSeq: Applicative3 = { } /** - * @internal + * @category instances + * @since 2.10.0 */ export const Chain: Chain3 = { URI, @@ -706,6 +708,58 @@ export const Chain: Chain3 = { chain: _chain } +/** + * @category instances + * @since 2.10.0 + */ +export const Monad: Monad3 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadIO: MonadIO3 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of, + fromIO +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadTask: MonadTask3 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of, + fromIO, + fromTask +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadThrow: MonadThrow3 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of, + throwError +} + /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. diff --git a/src/StateReaderTaskEither.ts b/src/StateReaderTaskEither.ts index dcac882ee..5067d0dcb 100644 --- a/src/StateReaderTaskEither.ts +++ b/src/StateReaderTaskEither.ts @@ -29,6 +29,7 @@ import { bindTo as bindTo_, flap as flap_, Functor4 } from './Functor' import { IO } from './IO' import { IOEither } from './IOEither' import { Monad4 } from './Monad' +import { MonadIO4 } from './MonadIO' import { MonadTask4 } from './MonadTask' import { MonadThrow4 } from './MonadThrow' import { Pointed4 } from './Pointed' @@ -608,6 +609,46 @@ export const Monad: Monad4 = { chain: _chain } +/** + * @category instances + * @since 2.10.0 + */ +export const MonadIO: MonadIO4 = { + URI, + map: _map, + ap: _ap, + of, + chain: _chain, + fromIO +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadTask: MonadTask4 = { + URI, + map: _map, + ap: _ap, + of, + chain: _chain, + fromIO, + fromTask +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadThrow: MonadThrow4 = { + URI, + map: _map, + ap: _ap, + of, + chain: _chain, + throwError +} + /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. diff --git a/src/Task.ts b/src/Task.ts index db727849f..626fd8e71 100644 --- a/src/Task.ts +++ b/src/Task.ts @@ -24,6 +24,7 @@ import { FromTask1 } from './FromTask' import { identity, pipe } from './function' import { bindTo as bindTo_, flap as flap_, Functor1 } from './Functor' import { Monad1 } from './Monad' +import { MonadIO1 } from './MonadIO' import { MonadTask1 } from './MonadTask' import { Monoid } from './Monoid' import { Pointed1 } from './Pointed' @@ -302,7 +303,8 @@ export const ApplicativeSeq: Applicative1 = { } /** - * @internal + * @category instances + * @since 2.10.0 */ export const Chain: Chain1 = { URI, @@ -312,7 +314,8 @@ export const Chain: Chain1 = { } /** - * @internal + * @category instances + * @since 2.10.0 */ export const Monad: Monad1 = { URI, @@ -322,6 +325,33 @@ export const Monad: Monad1 = { chain: _chain } +/** + * @category instances + * @since 2.10.0 + */ +export const MonadIO: MonadIO1 = { + URI, + map: _map, + of, + ap: _apPar, + chain: _chain, + fromIO +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadTask: MonadTask1 = { + URI, + map: _map, + of, + ap: _apPar, + chain: _chain, + fromIO, + fromTask +} + /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. diff --git a/src/TaskEither.ts b/src/TaskEither.ts index bfc9338e0..0c9f58244 100644 --- a/src/TaskEither.ts +++ b/src/TaskEither.ts @@ -53,6 +53,7 @@ import { bindTo as bindTo_, flap as flap_, Functor2 } from './Functor' import { IO } from './IO' import { IOEither } from './IOEither' import { Monad2, Monad2C } from './Monad' +import { MonadIO2 } from './MonadIO' import { MonadTask2, MonadTask2C } from './MonadTask' import { MonadThrow2, MonadThrow2C } from './MonadThrow' import { Monoid } from './Monoid' @@ -682,13 +683,69 @@ export const ApplicativeSeq: Applicative2 = { of } -const Chain: Chain2 = { +/** + * @category instances + * @since 2.10.0 + */ +export const Chain: Chain2 = { URI, map: _map, ap: _apPar, chain: _chain } +/** + * @category instances + * @since 2.10.0 + */ +export const Monad: Monad2 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadIO: MonadIO2 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of, + fromIO +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadTask: MonadTask2 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of, + fromIO, + fromTask +} + +/** + * @category instances + * @since 2.10.0 + */ +export const MonadThrow: MonadThrow2 = { + URI, + map: _map, + ap: _apPar, + chain: _chain, + of, + throwError +} + /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. diff --git a/src/TaskOption.ts b/src/TaskOption.ts index e202ddd70..0f6d37f78 100644 --- a/src/TaskOption.ts +++ b/src/TaskOption.ts @@ -482,7 +482,8 @@ export const ApplicativeSeq: Applicative1 = { } /** - * @internal + * @category instances + * @since 2.10.0 */ export const Chain: Chain1 = { URI, @@ -527,6 +528,18 @@ export const Alternative: Alternative1 = { zero } +/** + * @category instances + * @since 2.10.0 + */ +export const Monad: Monad1 = { + URI, + map: _map, + ap: _ap, + of, + chain: _chain +} + /** * @category instances * @since 2.10.0