private static Val reduceNumeric(Val list, LongBinaryOperator intFn, DoubleBinaryOperator doubleFn) {
    try {
      var iterator = ((Lister) list).iterator();
      if (!iterator.hasNext().booleanValue()) {
        return NullT.NullValue;
      }
      var next = iterator.next();
      if (next instanceof IntT intT) {
        long acc = intT.intValue();
        while (iterator.hasNext().booleanValue()) {
          acc = intFn.applyAsLong(iterator.next().convertToNative(Long.class), acc);
        }
        return IntT.intOf(acc);
      } else if (next instanceof DoubleT doubleT) {
        double acc = doubleT.convertToNative(Double.class);
        while (iterator.hasNext().booleanValue()) {
          acc = doubleFn.applyAsDouble(iterator.next().convertToNative(Double.class), acc);
        }
        return DoubleT.doubleOf(acc);
      } else {
        return Err.newErr("Bad element of list for min(): %s", next);
      }
    } catch (RuntimeException e) {
      return Err.newErr(e, "%s", e.getMessage());
    }
  }
Built-in functions to expose to all dynamic expression used in planetiler configs.
planetiler-custommap/src/main/java/com/onthegomap/planetiler/custommap/expression/stdlib/PlanetilerStdLib.java