'Kotlin - Can the minimum distance between a location and a list of locations be found with a one liner?

I would like the following "pseudocode" to be valid syntax (but clearly it's not) :

minDistance = minOf(myLocations.forEach{return location.distanceTo(it)})

To clarify, I am trying to find the distance from the smartphone (location) to the closest location in a mutable list of locations (myLocations).

Does Kotlin allow this level of terseness, or must I break it up in a few more lines and help variables?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source