wem (31) [Avatar] Offline
#1
Given the exercises that come just before ex. 5.20 isn't it more natural to implement flatMap like this? :

fun <B> flatMap(f: (A) -> List<B>): List<B> = flatten(map(f))

Pierre-Yves Saumont (181) [Avatar] Offline
#2
Sure! I changed the solution for yours.