Created
March 4, 2023 21:20
-
-
Save gvergnaud/3be2628167a6477c71c63cbcb9a28d26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type MergeParameters3<T extends readonly UnknownFunction[]> = H.Pipe< | |
T, | |
[ | |
H.Let<"parametersList", H.Tuples.Map<H.Functions.Parameters>>, | |
H.Let< | |
"longestLength", | |
H.ComposeLeft< | |
[ | |
H.Get<"parametersList">, | |
H.Tuples.Map<H.Tuples.Length>, | |
H.Tuples.Reduce<H.Numbers.Max, 0> | |
] | |
> | |
>, | |
H.Let< | |
"unknownPadding", | |
H.Tuples.Map< | |
H.ComposeLeft< | |
[ | |
H.Numbers.Sub<H.Get<"longestLength">, H._>, | |
H.Tuples.Range<0>, | |
H.Tuples.Map<H.Constant<unknown>> | |
] | |
>, | |
H.Get<"parametersList"> | |
> | |
>, | |
H.Let< | |
"unknownPadding", | |
H.Tuples.Map< | |
H.ComposeLeft< | |
[ | |
H.Numbers.Sub<H.Get<"longestLength">, H._>, | |
H.Tuples.Range<0>, | |
H.Tuples.Map<H.Constant<unknown>> | |
] | |
>, | |
H.Get<"parametersList"> | |
> | |
>, | |
H.Tuples.ZipWith< | |
H.Tuples.Concat, | |
H.Get<"parametersList">, | |
H.Get<"unknownPadding"> | |
>, | |
Transpose, | |
H.Tuples.Map<H.Tuples.Reduce<H.Objects.Assign, {}>> | |
] | |
>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment