mapWhile

inline fun <T> mapWhile(cond: (index: Int) -> Boolean, gen: (Int) -> T): List<T>