mapWhileCheck

inline fun <T> mapWhileCheck(check: (T) -> Boolean, gen: (Int) -> T): List<T>