kds
04/09/2019, 5:21 AMfun <A> flat(listOfOptions: List<Option<A>>): List<A> {
return listOfOptions.fold(mutableListOf(), { acc, opt ->
when (opt) {
is Some -> {
acc.add(opt.t)
acc
}
is None -> acc
}
})
}