Created
August 30, 2019 13:56
-
-
Save IanField90/f40c613ec38e0151ef39203b644c8da2 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
fun <T, S, U> partial1(t: T, f: (T, S) -> U): (S) -> U { | |
return { s -> f(t, s) } | |
} | |
val greeter: (String, String) -> String = { greeting, name -> "$greeting, $name" } | |
val helloer = partial1("Hello", greeter) | |
fun main() { | |
println(helloer("Ian")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment