Back
Dmitry Jemerov, Svetlana Isakova, Roman Elizarov, Sebastian Aigner: Kotlin in Action, Second Edition (2024, Manning Publications Co. LLC) No rating

Chapter 6 covers collections and sequences. Nothing really new, but it was nice to be reminded that groupBy has a more specialized version in partition. With this, a list can be split in two - a list of elements that satisfy a predicate and a list of those that don't. These lists are then obtained by deconstruction. For example, val (files, subdirectories) = fileSystemObjects.partition { it.isFile }