concept type in category kotlin

This is an excerpt from Manning's book Functional Programming with Kotlin.
A function
fwith input typeAand output typeB(written in Kotlin as a single type:(A) → B, pronounced "A to B") is a computation that relates every valueaof typeAto exactly one valuebof typeBsuch thatbis determined solely by the value ofa. Any changing state of an internal or external process is irrelevant to computing the resultf(a). For example, a functionintToStringhaving type(Int) → Stringwill take every integer to a corresponding string. Furthermore, if it really is a function, it will do nothing else.
Even though we have omitted type declarations in the above examples, the types are still vital and are inferred in all cases; the lambda must still be of type
(Int) → Int, otherwise compilation will fail.

This is an excerpt from Manning's book The Joy of Kotlin.
Considering your maximum multiple problems, when writing the interface, you realize that it’s not always easy to find such properties. Remember that you must find a set of properties that can be verified on all tuples of type
((Int, List<Int>), Int)that will be true if the lastIntis the correct result of applying the function to the pairInt,List<Int>. Here’s a reminder of the function signature:
Here, Kotlin guesses the type by looking forward to the value used to initialize the field. This is called type inference, and it lets you omit the type in numerous cases. But there are places where type inference won’t work, such as when the type is ambiguous or the field isn’t initialized. In these cases, you must specify the type.
val ls = listOf("A String") val la = ls + 42 // <- Kotlin infers the type `List<Any>` for `la`In Java, types are invariant, which means that if
Ais a parent type ofB,List<A>is neither a parent type nor a child type ofList<B>.List<A>andList<B>are two different types at compile time (and the same type at runtime). The problem with invariant types is that you can’t write the following: