So, what's the problem here? I am used to head/tai...
# getting-started
n
So, what's the problem here? I am used to head/tail in Scala, so I am writing my own head/tail:
Copy code
fun <T> head(ls: List<T>): List<T> = ls.get(0)
Copy code
error: type mismatch: inferred type is T but List<T> was expected
fun <T> head(ls: List<T>): List<T> = ls.get(0)
                                     ^
m
Well, your return type is wrong...
n
Yep ... Thanks