where function

VARP where(
  1. VARP condition, {
  2. VARP? x,
  3. VARP? y,
})

Implementation

VARP where(VARP condition, {VARP? x, VARP? y}) {
  if (x == null && y == null) {
    return nonzero(condition).$1;
  }
  MnnAssert(x != null && y != null, "x and y must be provided");
  return F.select(condition, x!, y!);
}