Arrow and other functional libraries have partial application tools, but you can always just write a lambda that wraps your function call
f
frellan
05/23/2018, 6:32 PM
hmm yeah okay, thanks!
g
greybird
05/23/2018, 7:47 PM
you probably know this, but if n and k are always/often the same, you could just give them default values. if you don't mind reordering the param list, that is.
Copy code
fun nthBits(index: Int, n: Int = 123, k: Int = 456): IntArray
f
frellan
05/23/2018, 7:51 PM
Yeah they are the same but different for every call, when using the function to calculate stuff those stay the same in the loop but the index changes.