enhancement
With $list.indexBy(x -> ...), you can build a map from a list in which each original list element is indexed via a key value. However, the result map always contains exactly the list values as values.
With $list.indexBy(keyFun: x -> ..., mapFun: x -> ...) you should be able to specify a further function with which the values occurring in the map are calculated from the original list values using the map function