Skip to content

Commit

Permalink
fix(fn): allow for curried in compose
Browse files Browse the repository at this point in the history
  • Loading branch information
millsp committed Mar 1, 2021
1 parent 359e223 commit 2bc5604
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 221 deletions.
111 changes: 56 additions & 55 deletions sources/Function/Compose/List/Async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import {Function} from '../../Function'
import {Await} from '../../../Any/Await'
import {Curry} from '../../Curry'

/**
*@hidden
Expand All @@ -11,16 +12,16 @@ export type ComposeListAsync = {
R0,
P extends any[],
>(fns: [
Function<P, R0>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R0>>>

<
R0,
R1,
P extends any[],
>(fns: [
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R1>>>

<
Expand All @@ -29,9 +30,9 @@ export type ComposeListAsync = {
R2,
P extends any[],
>(fns: [
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R2>>>

<
Expand All @@ -41,10 +42,10 @@ export type ComposeListAsync = {
R3,
P extends any[],
>(fns: [
Function<[Await<R2>], R3>,
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R2>], R3> | Curry<Function<[Await<R2>], R3>>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R3>>>

<
Expand All @@ -55,11 +56,11 @@ export type ComposeListAsync = {
R4,
P extends any[],
>(fns: [
Function<[Await<R3>], R4>,
Function<[Await<R2>], R3>,
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R3>], R4> | Curry<Function<[Await<R3>], R4>>,
Function<[Await<R2>], R3> | Curry<Function<[Await<R2>], R3>>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R4>>>

<
Expand All @@ -71,12 +72,12 @@ export type ComposeListAsync = {
R5,
P extends any[],
>(fns: [
Function<[Await<R4>], R5>,
Function<[Await<R3>], R4>,
Function<[Await<R2>], R3>,
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R4>], R5> | Curry<Function<[Await<R4>], R5>>,
Function<[Await<R3>], R4> | Curry<Function<[Await<R3>], R4>>,
Function<[Await<R2>], R3> | Curry<Function<[Await<R2>], R3>>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R5>>>

<
Expand All @@ -89,13 +90,13 @@ export type ComposeListAsync = {
R6,
P extends any[],
>(fns: [
Function<[Await<R5>], R6>,
Function<[Await<R4>], R5>,
Function<[Await<R3>], R4>,
Function<[Await<R2>], R3>,
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R5>], R6> | Curry<Function<[Await<R5>], R6>>,
Function<[Await<R4>], R5> | Curry<Function<[Await<R4>], R5>>,
Function<[Await<R3>], R4> | Curry<Function<[Await<R3>], R4>>,
Function<[Await<R2>], R3> | Curry<Function<[Await<R2>], R3>>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R6>>>

<
Expand All @@ -109,14 +110,14 @@ export type ComposeListAsync = {
R7,
P extends any[],
>(fns: [
Function<[Await<R6>], R7>,
Function<[Await<R5>], R6>,
Function<[Await<R4>], R5>,
Function<[Await<R3>], R4>,
Function<[Await<R2>], R3>,
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R6>], R7> | Curry<Function<[Await<R6>], R7>>,
Function<[Await<R5>], R6> | Curry<Function<[Await<R5>], R6>>,
Function<[Await<R4>], R5> | Curry<Function<[Await<R4>], R5>>,
Function<[Await<R3>], R4> | Curry<Function<[Await<R3>], R4>>,
Function<[Await<R2>], R3> | Curry<Function<[Await<R2>], R3>>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R7>>>

<
Expand All @@ -131,15 +132,15 @@ export type ComposeListAsync = {
R8,
P extends any[],
>(fns: [
Function<[Await<R7>], R8>,
Function<[Await<R6>], R7>,
Function<[Await<R5>], R6>,
Function<[Await<R4>], R5>,
Function<[Await<R3>], R4>,
Function<[Await<R2>], R3>,
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R7>], R8> | Curry<Function<[Await<R7>], R8>>,
Function<[Await<R6>], R7> | Curry<Function<[Await<R6>], R7>>,
Function<[Await<R5>], R6> | Curry<Function<[Await<R5>], R6>>,
Function<[Await<R4>], R5> | Curry<Function<[Await<R4>], R5>>,
Function<[Await<R3>], R4> | Curry<Function<[Await<R3>], R4>>,
Function<[Await<R2>], R3> | Curry<Function<[Await<R2>], R3>>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R8>>>

<
Expand All @@ -155,15 +156,15 @@ export type ComposeListAsync = {
R9,
P extends any[],
>(fns: [
Function<[Await<R8>], R9>,
Function<[Await<R7>], R8>,
Function<[Await<R6>], R7>,
Function<[Await<R5>], R6>,
Function<[Await<R4>], R5>,
Function<[Await<R3>], R4>,
Function<[Await<R2>], R3>,
Function<[Await<R1>], R2>,
Function<[Await<R0>], R1>,
Function<P, R0>,
Function<[Await<R8>], R9> | Curry<Function<[Await<R8>], R9>>,
Function<[Await<R7>], R8> | Curry<Function<[Await<R7>], R8>>,
Function<[Await<R6>], R7> | Curry<Function<[Await<R6>], R7>>,
Function<[Await<R5>], R6> | Curry<Function<[Await<R5>], R6>>,
Function<[Await<R4>], R5> | Curry<Function<[Await<R4>], R5>>,
Function<[Await<R3>], R4> | Curry<Function<[Await<R3>], R4>>,
Function<[Await<R2>], R3> | Curry<Function<[Await<R2>], R3>>,
Function<[Await<R1>], R2> | Curry<Function<[Await<R1>], R2>>,
Function<[Await<R0>], R1> | Curry<Function<[Await<R0>], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, Promise<Await<R9>>>
}
111 changes: 56 additions & 55 deletions sources/Function/Compose/List/Sync.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @ignore *//** */

import {Curry} from '../../Curry'
import {Function} from '../../Function'

/**
Expand All @@ -10,16 +11,16 @@ export type ComposeListSync = {
R0,
P extends any[],
>(fns: [
Function<P, R0>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R0>

<
R0,
R1,
P extends any[],
>(fns: [
Function<[R0], R1>,
Function<P, R0>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R1>

<
Expand All @@ -28,9 +29,9 @@ export type ComposeListSync = {
R2,
P extends any[],
>(fns: [
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R2>

<
Expand All @@ -40,10 +41,10 @@ export type ComposeListSync = {
R3,
P extends any[],
>(fns: [
Function<[R2], R3>,
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R2], R3> | Curry<Function<[R2], R3>>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R3>

<
Expand All @@ -54,11 +55,11 @@ export type ComposeListSync = {
R4,
P extends any[],
>(fns: [
Function<[R3], R4>,
Function<[R2], R3>,
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R3], R4> | Curry<Function<[R3], R4>>,
Function<[R2], R3> | Curry<Function<[R2], R3>>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R4>

<
Expand All @@ -70,12 +71,12 @@ export type ComposeListSync = {
R5,
P extends any[],
>(fns: [
Function<[R4], R5>,
Function<[R3], R4>,
Function<[R2], R3>,
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R4], R5> | Curry<Function<[R4], R5>>,
Function<[R3], R4> | Curry<Function<[R3], R4>>,
Function<[R2], R3> | Curry<Function<[R2], R3>>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R5>

<
Expand All @@ -88,13 +89,13 @@ export type ComposeListSync = {
R6,
P extends any[],
>(fns: [
Function<[R5], R6>,
Function<[R4], R5>,
Function<[R3], R4>,
Function<[R2], R3>,
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R5], R6> | Curry<Function<[R5], R6>>,
Function<[R4], R5> | Curry<Function<[R4], R5>>,
Function<[R3], R4> | Curry<Function<[R3], R4>>,
Function<[R2], R3> | Curry<Function<[R2], R3>>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R6>

<
Expand All @@ -108,14 +109,14 @@ export type ComposeListSync = {
R7,
P extends any[],
>(fns: [
Function<[R6], R7>,
Function<[R5], R6>,
Function<[R4], R5>,
Function<[R3], R4>,
Function<[R2], R3>,
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R6], R7> | Curry<Function<[R6], R7>>,
Function<[R5], R6> | Curry<Function<[R5], R6>>,
Function<[R4], R5> | Curry<Function<[R4], R5>>,
Function<[R3], R4> | Curry<Function<[R3], R4>>,
Function<[R2], R3> | Curry<Function<[R2], R3>>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R7>

<
Expand All @@ -130,15 +131,15 @@ export type ComposeListSync = {
R8,
P extends any[],
>(fns: [
Function<[R7], R8>,
Function<[R6], R7>,
Function<[R5], R6>,
Function<[R4], R5>,
Function<[R3], R4>,
Function<[R2], R3>,
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R7], R8> | Curry<Function<[R7], R8>>,
Function<[R6], R7> | Curry<Function<[R6], R7>>,
Function<[R5], R6> | Curry<Function<[R5], R6>>,
Function<[R4], R5> | Curry<Function<[R4], R5>>,
Function<[R3], R4> | Curry<Function<[R3], R4>>,
Function<[R2], R3> | Curry<Function<[R2], R3>>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R8>

<
Expand All @@ -154,15 +155,15 @@ export type ComposeListSync = {
R9,
P extends any[],
>(fns: [
Function<[R8], R9>,
Function<[R7], R8>,
Function<[R6], R7>,
Function<[R5], R6>,
Function<[R4], R5>,
Function<[R3], R4>,
Function<[R2], R3>,
Function<[R1], R2>,
Function<[R0], R1>,
Function<P, R0>,
Function<[R8], R9> | Curry<Function<[R8], R9>>,
Function<[R7], R8> | Curry<Function<[R7], R8>>,
Function<[R6], R7> | Curry<Function<[R6], R7>>,
Function<[R5], R6> | Curry<Function<[R5], R6>>,
Function<[R4], R5> | Curry<Function<[R4], R5>>,
Function<[R3], R4> | Curry<Function<[R3], R4>>,
Function<[R2], R3> | Curry<Function<[R2], R3>>,
Function<[R1], R2> | Curry<Function<[R1], R2>>,
Function<[R0], R1> | Curry<Function<[R0], R1>>,
Function<P, R0> | Curry<Function<P, R0>>,
]): Function<P, R9>
}

0 comments on commit 2bc5604

Please sign in to comment.