Created
July 22, 2023 18:49
-
-
Save RobertKoval/d4742ad7792f5ea17729fe1454852084 to your computer and use it in GitHub Desktop.
Generic partial application function using new Value and Type Parameter Packs
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
func partiallyApply<T, U, each V>(_ function: @escaping (T, repeat each V) -> U, with argument: T) -> (repeat each V) -> U { | |
return { (rest: repeat each V) in | |
return function(argument, repeat each rest) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment