zipWith<U extends Object, R extends Object> method

Option<R> zipWith<U extends Object, R extends Object>(
  1. Option<U> other,
  2. R f(
    1. T,
    2. U
    )
)

Zips self and another Option with function f

Implementation

Option<R> zipWith<U extends Object, R extends Object>(
    Option<U> other, R Function(T, U) f) {
  if (v == null) {
    return None;
  } else {
    if (other.isSome()) {
      return Some(f(v!, other.unwrap()));
    }
    return None;
  }
}