Here, () -> Unit is a function type and the Unit after the -> indicates that this function type does not return any meaningful value . Mentioning the Unit cannot be skipped in function types. Unit for Extending Generics. Every function has to return a value.2 May 2019