Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
147 B
1
Indexable
Never
fun <T, U> mapUsingFold(list: List<T>, mapF: (T) -> U): List<U> { 
    return list.fold(mutableListOf<U>()) { acc, t -> acc.add(mapF(t)); acc }
}