mapNotNull

fun <T, R> List<T>.mapNotNull(transform: (prev: R?, value: T) -> R?): List<R>

The same as a regular mapNotNull, but transform block contains the previous value of the list.