traverseOption<B> method
Implementation
Option<IList<B>> traverseOption<B>(Option<B> f(A a)) {
Option<IList<B>> result = some(nil());
var current = this;
while(current._isCons()) {
final gb = f(current._unsafeHead());
result = result.fold(none, (a) => gb.fold(none, (h) => some(new Cons(h, a))));
current = current._unsafeTail();
}
return result.map((l) => l.reverse());
}