does this ```typealias Visitor<T> = (TreeNod...
# getting-started
does this
Copy code
typealias Visitor<T> = (TreeNode<T>) -> Unit
mean, “any function that takes TreeNode<T> and return Unit can now be referred to as
? so instead of writing
Copy code
fun search(printResult: (TreeNode<T>) -> Unit)
I write
fun search(visit: Visitor<T>)
Yes and the compiler will replace the Visitor<T> with the correct type. It doesn’t create a new type just a simpler short hand for your code.
You’d be able to write both ways