Hi. :slightly_smiling_face: I'm trying to find ou...
# getting-started
t
Hi. 🙂 I'm trying to find out, how to use arrow-kt to convert a function taking two parameters into a function taking a pair. I wrote this goofy
tuplize
function:
Copy code
fun foo(x: Int, y: Int) = 3 * x + 2 * y + 1

fun <T, U, R> tuplize(f: (T, U) -> R): ((Pair<T, U>) -> R) = { (a, b): Pair<T, U> -> f(a, b) }

val xs = listOf(Pair(1, 2), Pair(42, 23))

val ys = xs.map(tuplize(::foo))
It works, but I guess arrow-kt already has something nice build-in, and I just can't find it. Can somebody help me out?
e
there isn't as far as I know, but this is probably a better question for #arrow than here
t