From 2be1dfe8a96e5dfc5d5b12fb99bfddeeab0aea92 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:13:59 +1000 Subject: [PATCH 01/40] refactor(Apply/ap): replace generics `A`/`B` with `A1`/`A2` --- src/Apply.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Apply.ts b/src/Apply.ts index d85081e60..8f67651eb 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -113,36 +113,36 @@ export interface Apply4 extends Functor4 { export function ap( F: Apply2, G: Apply2C -): ( - fa: Kind2> -) => (fab: Kind2 B>>) => Kind2> +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply1, G: Apply2C -): (fa: Kind>) => (fab: Kind B>>) => Kind> +): (fa: Kind>) => (fab: Kind A2>>) => Kind> export function ap( F: Apply, G: Apply2 -): (fa: HKT>) => (fab: HKT B>>) => HKT> +): (fa: HKT>) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply2C -): (fa: HKT>) => (fab: HKT B>>) => HKT> +): (fa: HKT>) => (fab: HKT A2>>) => HKT> export function ap( F: Apply, G: Apply1 -): (fa: HKT>) => (fab: HKT B>>) => HKT> +): (fa: HKT>) => (fab: HKT A2>>) => HKT> export function ap( F: Apply, G: Apply -): (fa: HKT>) => (fab: HKT B>>) => HKT> +): (fa: HKT>) => (fab: HKT A2>>) => HKT> export function ap( F: Apply, G: Apply -): (fa: HKT>) => (fab: HKT B>>) => HKT> { - return (fa: HKT>) => (fab: HKT B>>): HKT> => +): (fa: HKT>) => (fab: HKT A2>>) => HKT> { + return (fa: HKT>) => (fab: HKT A2>>): HKT> => F.ap( - F.map(fab, (gab) => (ga: HKT) => G.ap(gab, ga)), + F.map(fab, (gab) => (ga: HKT) => G.ap(gab, ga)), fa ) } From e2a61ba597456beaf193be4787c4e9082967daa1 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:26:29 +1000 Subject: [PATCH 02/40] feat(Apply/ap): add `Apply` to `Apply3C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 8f67651eb..2b816de72 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -120,6 +120,12 @@ export function ap( F: Apply1, G: Apply2C ): (fa: Kind>) => (fab: Kind A2>>) => Kind> +export function ap( + F: Apply, + G: Apply3C +): ( + fa: HKT> +) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply2 From 9a3ebb4d20cb1d187b23b80df6ae27d10e50aa06 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:26:46 +1000 Subject: [PATCH 03/40] feat(Apply/ap): add `Apply` to `Apply3` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 2b816de72..0932d88bf 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -120,6 +120,12 @@ export function ap( F: Apply1, G: Apply2C ): (fa: Kind>) => (fab: Kind A2>>) => Kind> +export function ap( + F: Apply, + G: Apply3 +): ( + fa: HKT> +) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply3C From c2b586b978cd22dbc8a5bf5507cc23a91e177925 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:30:26 +1000 Subject: [PATCH 04/40] feat(Apply/ap): add `Apply` to `Apply4` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 0932d88bf..e86bd019d 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -120,6 +120,12 @@ export function ap( F: Apply1, G: Apply2C ): (fa: Kind>) => (fab: Kind A2>>) => Kind> +export function ap( + F: Apply, + G: Apply4 +): ( + fa: HKT> +) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply3 From 96c96e519aa4576052c2373a13a914817f308bd2 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:36:04 +1000 Subject: [PATCH 05/40] feat(Apply/ap): add `Apply1` to `Apply1` overload --- src/Apply.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index e86bd019d..c1e5cacbe 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -120,6 +120,10 @@ export function ap( F: Apply1, G: Apply2C ): (fa: Kind>) => (fab: Kind A2>>) => Kind> +export function ap( + F: Apply1, + G: Apply1 +): (fa: Kind>) => (fab: Kind A2>>) => Kind> export function ap( F: Apply, G: Apply4 From a5139aeb5807e01efff289f768c5dfbf5f637047 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:39:05 +1000 Subject: [PATCH 06/40] feat(Apply/ap): add `Apply1` to `Apply2` overload --- src/Apply.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index c1e5cacbe..9f26f901d 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,10 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply1, + G: Apply2 +): (fa: Kind>) => (fab: Kind A2>>) => Kind> export function ap( F: Apply1, G: Apply2C From 9405ecaefe405ea1c90d85c0506ca01a07368bff Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:41:00 +1000 Subject: [PATCH 07/40] feat(Apply/ap): add `Apply1` to `Apply3` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 9f26f901d..d772cfe5b 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply1, + G: Apply3 +): ( + fa: Kind> +) => (fab: Kind A2>>) => Kind> export function ap( F: Apply1, G: Apply2 From 1a3098f7f7679a17c0aba852de22bb9ed03a1a5c Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:42:00 +1000 Subject: [PATCH 08/40] feat(Apply/ap): add `Apply1` to `Apply3C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index d772cfe5b..775965c42 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -122,6 +122,12 @@ export function ap( ): ( fa: Kind> ) => (fab: Kind A2>>) => Kind> +export function ap( + F: Apply1, + G: Apply3C +): ( + fa: Kind> +) => (fab: Kind A2>>) => Kind> export function ap( F: Apply1, G: Apply2 From fb25871a236b31a9254a59b86bcb7fdfeaa3b8f8 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 09:45:01 +1000 Subject: [PATCH 09/40] feat(Apply/ap): add `Apply1` to `Apply4` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 775965c42..489f3231a 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply1, + G: Apply4 +): ( + fa: Kind> +) => (fab: Kind A2>>) => Kind> export function ap( F: Apply1, G: Apply3 From 19e4ff60735fabdd24941a24a1f6ffdf0a6dd93a Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:03:16 +1000 Subject: [PATCH 10/40] feat(Apply/ap): add `Apply2` to `Apply1` overload --- src/Apply.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 489f3231a..e7b0113a9 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,10 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply2, + G: Apply1 +): (fa: Kind2>) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply1, G: Apply4 From 81b1ec54f08f5003d8dc13b4cf93df42177c4bf2 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:04:56 +1000 Subject: [PATCH 11/40] feat(Apply/ap): add `Apply2` to `Apply2` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index e7b0113a9..db5996fb1 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply2, + G: Apply2 +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2, G: Apply1 From c14228866efc9e13205ef747b5972daff69edf22 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:09:17 +1000 Subject: [PATCH 12/40] refactor(Apply/ap): replace generics `E`/`FE` with `E2`/`E1` --- src/Apply.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Apply.ts b/src/Apply.ts index db5996fb1..a4067bf39 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,18 +110,18 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ -export function ap( - F: Apply2, - G: Apply2C -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2, G: Apply2 ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply2, + G: Apply2C +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2, G: Apply1 From ec265fdf5fa58c51a36f06b3f269190e04ba9e8c Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:12:08 +1000 Subject: [PATCH 13/40] feat(Apply/ap): add `Apply2` to `Apply3` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index a4067bf39..bf8a97196 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply2, + G: Apply3 +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2, G: Apply2 From 5d7ae0ce0c31d1e7d7217650c9621081ad69e778 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:15:57 +1000 Subject: [PATCH 14/40] feat(Apply/ap): add `Apply2` to `Apply3C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index bf8a97196..b5de644ea 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply2, + G: Apply3C +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2, G: Apply2 From 2afaf987870f3cccd39019e6caec96edd9d95c0d Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:17:30 +1000 Subject: [PATCH 15/40] feat(Apply/ap): add `Apply2` to `Apply4` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index b5de644ea..dee5a6f25 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply2, + G: Apply4 +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2, G: Apply3 From 364e999e8b295365f92726c7b5a2efd1ebb31a29 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:19:34 +1000 Subject: [PATCH 16/40] feat(Apply/ap): add `Apply2C` to `Apply1` overload --- src/Apply.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index dee5a6f25..987d73e27 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,10 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply2C, + G: Apply1 +): (fa: Kind2>) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2, G: Apply4 From fce20bab3b5418b14f6d69d563fab612a429125b Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:21:16 +1000 Subject: [PATCH 17/40] feat(Apply/ap): add `Apply2C` to `Apply2` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 987d73e27..3c51c6155 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply2C, + G: Apply2 +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2C, G: Apply1 From b822abc0e4dee0a85e97096eba7096dda8502368 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:24:26 +1000 Subject: [PATCH 18/40] feat(Apply/ap): add `Apply2C` to `Apply2C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 3c51c6155..e0f29cade 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply2C, + G: Apply2C +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2C, G: Apply1 From 2c206bb70bb5fc4a888338a1040dddc5141a45f2 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:26:33 +1000 Subject: [PATCH 19/40] feat(Apply/ap): add `Apply2C` to `Apply3` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index e0f29cade..fd04d1f8d 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply2C, + G: Apply3 +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2C, G: Apply2 From 0da9bf48e94ff5a18b974e5fa7d5a50dfc3e3ae3 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:28:02 +1000 Subject: [PATCH 20/40] feat(Apply/ap): add `Apply2C` to `Apply3C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index fd04d1f8d..f47a579ab 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind2> ) => (fab: Kind2 A2>>) => Kind2> +export function ap( + F: Apply2C, + G: Apply3C +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2C, G: Apply2 From 1e7662d57ae9710c163aeb061190def975e8c9ef Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:29:18 +1000 Subject: [PATCH 21/40] feat(Apply/ap): add `Apply2C` to `Apply4` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index f47a579ab..7ceeb5421 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply2C, + G: Apply4 +): ( + fa: Kind2> +) => (fab: Kind2 A2>>) => Kind2> export function ap( F: Apply2C, G: Apply3 From 9edada8239cf665a7b71be76a78fceba98e5f773 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:32:25 +1000 Subject: [PATCH 22/40] feat(Apply/ap): add `Apply3` to `Apply1` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 7ceeb5421..760cb21e1 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply3, + G: Apply1 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply2C, G: Apply4 From 13a40a1a0a8602cec732cf944be2e9949b70b197 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:33:34 +1000 Subject: [PATCH 23/40] feat(Apply/ap): add `Apply3` to `Apply2` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 760cb21e1..96bf748d2 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply3, + G: Apply2 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3, G: Apply1 From 57c62fd790dd65296bcec583f641685ce2bb97d8 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:34:13 +1000 Subject: [PATCH 24/40] feat(Apply/ap): add `Apply3` to `Apply2C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 96bf748d2..15bab919d 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind3> ) => (fab: Kind3 A2>>) => Kind3> +export function ap( + F: Apply3, + G: Apply2C +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3, G: Apply1 From 9289609ac1abcf947845576945e0c8e78bfde439 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:36:01 +1000 Subject: [PATCH 25/40] feat(Apply/ap): add `Apply3` to `Apply3` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 15bab919d..22803fe0f 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply3, + G: Apply3 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3, G: Apply2 From 4f40a07adad01406d4c89e49cbbb03a9a6aa9a6a Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:37:14 +1000 Subject: [PATCH 26/40] feat(Apply/ap): add `Apply3` to `Apply3C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 22803fe0f..c3d44b4fe 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind3> ) => (fab: Kind3 A2>>) => Kind3> +export function ap( + F: Apply3, + G: Apply3C +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3, G: Apply2 From dee55447dcd98bc9e21b4ddb64acc8d746d9df7b Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 10:38:02 +1000 Subject: [PATCH 27/40] feat(Apply/ap): add `Apply3` to `Apply4` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index c3d44b4fe..329cb4017 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply3, + G: Apply4 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3, G: Apply3 From b4e964720e078db2593f1730ba57175de9a8f65e Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:02:00 +1000 Subject: [PATCH 28/40] feat(Apply/ap): add `Apply4` to `Apply1` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 329cb4017..58107f3eb 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply4, + G: Apply1 +): ( + fa: Kind4> +) => (fab: Kind4 A2>>) => Kind4> export function ap( F: Apply3, G: Apply4 From 3ca3bc6b42e386188e810b8bc9bc16d5d675a9d0 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:02:14 +1000 Subject: [PATCH 29/40] feat(Apply/ap): add `Apply4` to `Apply2` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 58107f3eb..e99bf1c60 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply4, + G: Apply2 +): ( + fa: Kind4> +) => (fab: Kind4 A2>>) => Kind4> export function ap( F: Apply4, G: Apply1 From 215958d351763e41897c1c66fdb0855d9806f7a1 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:02:28 +1000 Subject: [PATCH 30/40] feat(Apply/ap): add `Apply4` to `Apply2C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index e99bf1c60..901977ebc 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind4> ) => (fab: Kind4 A2>>) => Kind4> +export function ap( + F: Apply4, + G: Apply2C +): ( + fa: Kind4> +) => (fab: Kind4 A2>>) => Kind4> export function ap( F: Apply4, G: Apply1 From 8e613911f8617bac8ad9d1356ca8f908d72892c5 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:02:45 +1000 Subject: [PATCH 31/40] feat(Apply/ap): add `Apply4` to `Apply3` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 901977ebc..d05d2e170 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,12 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply4, + G: Apply3 +): ( + fa: Kind4> +) => (fab: Kind4 A2>>) => Kind4> export function ap( F: Apply4, G: Apply2 From dce9d5f4099ee6869405a6d55e4f8d01b298efff Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:02:54 +1000 Subject: [PATCH 32/40] feat(Apply/ap): add `Apply4` to `Apply3C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index d05d2e170..e31941bf6 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -116,6 +116,12 @@ export function ap( ): ( fa: Kind4> ) => (fab: Kind4 A2>>) => Kind4> +export function ap( + F: Apply4, + G: Apply3C +): ( + fa: Kind4> +) => (fab: Kind4 A2>>) => Kind4> export function ap( F: Apply4, G: Apply2 From edffe35592ab6ae4f713b9849ffd1d37a1eda68f Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:03:03 +1000 Subject: [PATCH 33/40] feat(Apply/ap): add `Apply4` to `Apply4` overload --- src/Apply.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index e31941bf6..cfa77c15c 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -110,6 +110,14 @@ export interface Apply4 extends Functor4 { * @category combinators * @since 2.10.0 */ +export function ap( + F: Apply4, + G: Apply4 +): ( + fa: Kind4> +) => ( + fab: Kind4 A2>> +) => Kind4> export function ap( F: Apply4, G: Apply3 From cee58eae8732ca165f43e03070dfefadebde4544 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:09:24 +1000 Subject: [PATCH 34/40] feat(Apply/ap): add `Apply3C` to `Apply1` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index cfa77c15c..0f20a1048 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -148,6 +148,12 @@ export function ap( ): ( fa: Kind4> ) => (fab: Kind4 A2>>) => Kind4> +export function ap( + F: Apply3C, + G: Apply1 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3, G: Apply4 From 84cd63f131fc91dfd509998f10b6747430a2d9e7 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:09:39 +1000 Subject: [PATCH 35/40] feat(Apply/ap): add `Apply3C` to `Apply2` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 0f20a1048..574495adb 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -148,6 +148,12 @@ export function ap( ): ( fa: Kind4> ) => (fab: Kind4 A2>>) => Kind4> +export function ap( + F: Apply3C, + G: Apply2 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3C, G: Apply1 From f9d33049c6b796cbe058d3a0729e10a2260b4cfe Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:09:53 +1000 Subject: [PATCH 36/40] feat(Apply/ap): add `Apply3C` to `Apply2C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 574495adb..6beb0202d 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -154,6 +154,12 @@ export function ap( ): ( fa: Kind3> ) => (fab: Kind3 A2>>) => Kind3> +export function ap( + F: Apply3C, + G: Apply2C +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3C, G: Apply1 From d4d41f9327cb42690ab1758ca2b42029ec9005ec Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:10:11 +1000 Subject: [PATCH 37/40] feat(Apply/ap): add `Apply3C` to `Apply3` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 6beb0202d..507557852 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -148,6 +148,12 @@ export function ap( ): ( fa: Kind4> ) => (fab: Kind4 A2>>) => Kind4> +export function ap( + F: Apply3C, + G: Apply3 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3C, G: Apply2 From 70917bda69746f88148e69d323abb5f0093f1514 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:10:28 +1000 Subject: [PATCH 38/40] feat(Apply/ap): add `Apply3C` to `Apply3C` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 507557852..16f37f43a 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -154,6 +154,12 @@ export function ap( ): ( fa: Kind3> ) => (fab: Kind3 A2>>) => Kind3> +export function ap( + F: Apply3C, + G: Apply3C +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3C, G: Apply2 From 5e4f4aadeec7ddbd5adaadd119aa56f5dd3fe8bd Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 12 Jun 2022 11:10:35 +1000 Subject: [PATCH 39/40] feat(Apply/ap): add `Apply3C` to `Apply4` overload --- src/Apply.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Apply.ts b/src/Apply.ts index 16f37f43a..ae6baf445 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -148,6 +148,12 @@ export function ap( ): ( fa: Kind4> ) => (fab: Kind4 A2>>) => Kind4> +export function ap( + F: Apply3C, + G: Apply4 +): ( + fa: Kind3> +) => (fab: Kind3 A2>>) => Kind3> export function ap( F: Apply3C, G: Apply3 From 950f4c89aebdd476b8ec4710d6f077747501f772 Mon Sep 17 00:00:00 2001 From: Wayne Van Son Date: Sun, 14 Aug 2022 17:37:07 +1000 Subject: [PATCH 40/40] refactor(apply): normailise generic names --- src/Apply.ts | 300 +++++++++++++++++++++++++-------------------------- 1 file changed, 148 insertions(+), 152 deletions(-) diff --git a/src/Apply.ts b/src/Apply.ts index ae6baf445..461c4850e 100644 --- a/src/Apply.ts +++ b/src/Apply.ts @@ -113,252 +113,248 @@ export interface Apply4 extends Functor4 { export function ap( F: Apply4, G: Apply4 -): ( - fa: Kind4> -) => ( - fab: Kind4 A2>> -) => Kind4> +): ( + fa: Kind4> +) => (fab: Kind4 B>>) => Kind4> export function ap( F: Apply4, G: Apply3 -): ( - fa: Kind4> -) => (fab: Kind4 A2>>) => Kind4> -export function ap( +): ( + fa: Kind4> +) => (fab: Kind4 B>>) => Kind4> +export function ap( F: Apply4, - G: Apply3C -): ( - fa: Kind4> -) => (fab: Kind4 A2>>) => Kind4> + G: Apply3C +): ( + fa: Kind4> +) => (fab: Kind4 B>>) => Kind4> export function ap( F: Apply4, G: Apply2 -): ( - fa: Kind4> -) => (fab: Kind4 A2>>) => Kind4> -export function ap( +): ( + fa: Kind4> +) => (fab: Kind4 B>>) => Kind4> +export function ap( F: Apply4, - G: Apply2C -): ( - fa: Kind4> -) => (fab: Kind4 A2>>) => Kind4> + G: Apply2C +): ( + fa: Kind4> +) => (fab: Kind4 B>>) => Kind4> export function ap( F: Apply4, G: Apply1 -): ( - fa: Kind4> -) => (fab: Kind4 A2>>) => Kind4> -export function ap( - F: Apply3C, +): ( + fa: Kind4> +) => (fab: Kind4 B>>) => Kind4> +export function ap( + F: Apply3C, G: Apply4 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> -export function ap( - F: Apply3C, +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> +export function ap( + F: Apply3C, G: Apply3 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> -export function ap( - F: Apply3C, - G: Apply3C -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> -export function ap( - F: Apply3C, +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> +export function ap( + F: Apply3C, + G: Apply3C +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> +export function ap( + F: Apply3C, G: Apply2 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> -export function ap( - F: Apply3C, - G: Apply2C -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> +export function ap( + F: Apply3C, + G: Apply2C +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> export function ap( F: Apply3C, G: Apply1 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> export function ap( F: Apply3, G: Apply4 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> export function ap( F: Apply3, G: Apply3 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> -export function ap( +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> +export function ap( F: Apply3, - G: Apply3C -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> + G: Apply3C +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> export function ap( F: Apply3, G: Apply2 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> -export function ap( +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> +export function ap( F: Apply3, - G: Apply2C -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> + G: Apply2C +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> export function ap( F: Apply3, G: Apply1 -): ( - fa: Kind3> -) => (fab: Kind3 A2>>) => Kind3> -export function ap( - F: Apply2C, +): ( + fa: Kind3> +) => (fab: Kind3 B>>) => Kind3> +export function ap( + F: Apply2C, G: Apply4 -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> -export function ap( - F: Apply2C, +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> +export function ap( + F: Apply2C, G: Apply3 -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> -export function ap( - F: Apply2C, - G: Apply3C -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> -export function ap( - F: Apply2C, +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> +export function ap( + F: Apply2C, + G: Apply3C +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> +export function ap( + F: Apply2C, G: Apply2 -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> -export function ap( - F: Apply2C, - G: Apply2C -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> +export function ap( + F: Apply2C, + G: Apply2C +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> export function ap( F: Apply2C, G: Apply1 -): (fa: Kind2>) => (fab: Kind2 A2>>) => Kind2> +): (fa: Kind2>) => (fab: Kind2 B>>) => Kind2> export function ap( F: Apply2, G: Apply4 -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> export function ap( F: Apply2, G: Apply3 -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> -export function ap( +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> +export function ap( F: Apply2, - G: Apply3C -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> + G: Apply3C +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> export function ap( F: Apply2, G: Apply2 -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> -export function ap( +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> +export function ap( F: Apply2, - G: Apply2C -): ( - fa: Kind2> -) => (fab: Kind2 A2>>) => Kind2> + G: Apply2C +): ( + fa: Kind2> +) => (fab: Kind2 B>>) => Kind2> export function ap( F: Apply2, G: Apply1 -): (fa: Kind2>) => (fab: Kind2 A2>>) => Kind2> +): (fa: Kind2>) => (fab: Kind2 B>>) => Kind2> export function ap( F: Apply1, G: Apply4 -): ( - fa: Kind> -) => (fab: Kind A2>>) => Kind> +): ( + fa: Kind> +) => (fab: Kind B>>) => Kind> export function ap( F: Apply1, G: Apply3 -): ( - fa: Kind> -) => (fab: Kind A2>>) => Kind> +): ( + fa: Kind> +) => (fab: Kind B>>) => Kind> export function ap( F: Apply1, G: Apply3C -): ( - fa: Kind> -) => (fab: Kind A2>>) => Kind> +): ( + fa: Kind> +) => (fab: Kind B>>) => Kind> export function ap( F: Apply1, G: Apply2 -): (fa: Kind>) => (fab: Kind A2>>) => Kind> +): (fa: Kind>) => (fab: Kind B>>) => Kind> export function ap( F: Apply1, G: Apply2C -): (fa: Kind>) => (fab: Kind A2>>) => Kind> +): (fa: Kind>) => (fab: Kind B>>) => Kind> export function ap( F: Apply1, G: Apply1 -): (fa: Kind>) => (fab: Kind A2>>) => Kind> +): (fa: Kind>) => (fab: Kind B>>) => Kind> export function ap( F: Apply, G: Apply4 -): ( - fa: HKT> -) => (fab: HKT B>>) => HKT> +): ( + fa: HKT> +) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply3 -): ( - fa: HKT> -) => (fab: HKT B>>) => HKT> +): ( + fa: HKT> +) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply3C -): ( - fa: HKT> -) => (fab: HKT B>>) => HKT> +): (fa: HKT>) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply2 -): (fa: HKT>) => (fab: HKT B>>) => HKT> +): (fa: HKT>) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply2C -): (fa: HKT>) => (fab: HKT A2>>) => HKT> +): (fa: HKT>) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply1 -): (fa: HKT>) => (fab: HKT A2>>) => HKT> +): (fa: HKT>) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply -): (fa: HKT>) => (fab: HKT A2>>) => HKT> +): (fa: HKT>) => (fab: HKT B>>) => HKT> export function ap( F: Apply, G: Apply -): (fa: HKT>) => (fab: HKT A2>>) => HKT> { - return (fa: HKT>) => (fab: HKT A2>>): HKT> => +): (fa: HKT>) => (fab: HKT B>>) => HKT> { + return (fa: HKT>) => (fab: HKT B>>): HKT> => F.ap( - F.map(fab, (gab) => (ga: HKT) => G.ap(gab, ga)), + F.map(fab, (gab) => (ga: HKT) => G.ap(gab, ga)), fa ) }