https://kotlinlang.org logo
Title
r

robstoll

01/11/2019, 8:03 PM
Which one would you prefer:
foo<Int, String>(1, 2) { "result: $it" }
foo(1, 2)<String>{ "result: $it" }
The first one has less surprises but is more verbose than the second. Thoughts?
k

karelpeeters

01/11/2019, 8:48 PM
What does it do?
r

robstoll

01/11/2019, 8:48 PM
mapping to an unknown type R (String in the above example)
d

dalexander

01/11/2019, 8:57 PM
I like the first one a little bit more. The type parameter “feels” like it’s in a weird place in the second case.
h

hudsonb

01/11/2019, 10:35 PM
First
t

tKw

01/12/2019, 12:21 AM
1️⃣
Also #codereview and #codingconventions are some good places for questions like this 🙂