Reduces the supplied values using the supplied function with a left fold.

@exception NoSuchElementException thrown if values does not contain at least one element.
329921
public static <A> A reduceLeft (F<A,A> func, Iterable<? extends A> values)
    {
        Iterator<? extends A> iter = values.iterator();
        A zero = iter.next();
        while (iter.hasNext()) {
            zero = func.apply(zero, iter.next());
        }
        return zero;
    }
62925
function intValidatorNoErrors( n, min, max ) {
        return ( n = truncate(n) ) >= min && n <= max;
    }
1060317
function foldR(fn, startValue, list) {
      
   return list 
            ? fn(foldR(fn, startValue, tail(list)), head(list))
            : startValue
            ;
}
1363875
private void simplifyEnumValues(AbstractCompiler compiler) {
    if (getRhs().isObjectLit() && getRhs().hasChildren()) {
      for (Node key : getRhs().children()) {
        removeStringKeyValue(key);
      }
      compiler.reportChangeToEnclosingScope(getRhs());
    }
  }
441788
public void reverse(CollectListData data,
                        Object value) {
        CollectListData.MutableInt counter = data.map.get( value );
        if( (--counter.value) == 0 ) {
            data.map.remove( value );
        }
    }
1025331
@Override
    public Double reduce(List<Double> values) {
        double min = Double.MAX_VALUE;
        double max = Double.MIN_VALUE;

        for (Double value : values) {
            if (value == null) {
                value = 0.0;
            }

            double candidate = (value);

            if (candidate < min) {
                min = candidate;
            }
            if (candidate > max) {
                max = candidate;
            }
        }
        return max - min;
    }
606604
static <T> Set<T> reduceSet(Iterator<Set<T>> values) {
        Set<T> set = new HashSet<>();
        while (values.hasNext()) {
            set.addAll(values.next());
        }
        return set;
    }
715695
def reduce(function, initval=None):
	
	if initval is None:
		return lambda s: __builtin__.reduce(function, s)
	else:
		return lambda s: __builtin__.reduce(function, s, initval)
297053
function collapse(values) {
  if (!values || !values.length) return [];
  var length = values.length;

  // Truncate values
  var replica = [];
  for (var i = length; i--;) {
    var sample = strip(values[i]);
    if (!+sample) replica[i] = '0';
    else replica[i] = truncate(values[i]);
  }

  // Collapse values
  var a = replica[0], b = replica[1], c = replica[2], d = replica[3];
  switch (length) {
    case 2: if (a === b) return [a];
    case 3: {
      if (a === b && b === c) return [a];
      if (a === c) return [a, b];
    }
    case 4: {
      if (a === b && b === c && c === d) return [a];
      if (a === c && b === d) return [a, b];
      if (b === d) return [a, b, c];
    }
    default: return values;
  }
}
800885
@Override
    public void deleteAll(final Collection<T> values) {
        if (values == null || values.size() == 0) {
            return;
        }

        // we need a List of values to partition
        final List<T> valuesList;
        if (values instanceof List) {
            valuesList = (List<T>) values;
        } else {
            valuesList = Lists.newArrayList(values);
        }

        // process values in groups of <partition size>
        for (final List<T> partition : Lists.partition(valuesList, config.getPartitionSize())) {
            doDeleteAllValues(partition);
            for (final T value : partition) {
                notifyDeleted(value);
            }
        }
    }
194886
function fold(count, buf)
{
  if(!count || buf.length % 2) return buf;
  var ret = buf.slice(0,buf.length/2);
  for(i = 0; i < ret.length; i++) ret[i] = ret[i] ^ buf[i+ret.length];
  return fold(count-1,ret);
}
940595
@Override
    public void resolve(final ValueStack values) throws Exception
    {
        if (values.size() < 2)
            throw new Exception("missing operands for " + toString());
        try
        {
            final double multiplier = Math.pow(10, values.popDouble());
            values.push(new Double(Math.round(values.popDouble() * multiplier) / multiplier));
        } catch (final ParseException e)
        {
            e.fillInStackTrace();
            throw new Exception(toString() + "; " + e.getMessage(), e);
        }
    }
1206268
public static <T extends Comparable<T>> T minOr(Collection<T> values, T defaultVal) {
    if (values.isEmpty()) {
      return defaultVal;
    } else {
      return Collections.min(values);
    }
  }
776931
public final <T> T fold(Function<? super L, ? extends T> left, Function<? super R, ? extends T> right) {
		if (isLeft()) {
			return left.apply(getLeft());
		} else {
			return right.apply(getRight());
		}
	}
1349299
void reduce() {
        // Note that the scanner choice is opposite of our type. This is
        // because a group of 'and's has children which are 'or's and vice
        // versa.
        Scanner<S> scanner = mForAnd ? OrChildScanner.THE : AndChildScanner.THE;

        Iterator<Filter<S>> it = mElements.iterator();
        aLoop:
        while (it.hasNext()) {
            Filter<S> a = it.next();
            for (Filter<S> b : mElements) {
                if (a != b) {
                    if (a.accept(scanner, b)) {
                        it.remove();
                        continue aLoop;
                    }
                }
            }
        }
    }
297159
function(values) {
    var max = Number.MIN_VALUE,
        min = Number.MAX_VALUE,
        val,
        cc,
        attrs = {};

    if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) {
      if (!this.params.min || !this.params.max) {
        for (cc in values) {
          val = parseFloat(values[cc]);
          if (val > max) max = values[cc];
          if (val < min) min = val;
        }
        if (!this.params.min) {
          this.scale.setMin(min);
        }
        if (!this.params.max) {
          this.scale.setMax(max);
        }
        this.params.min = min;
        this.params.max = max;
      }
      for (cc in values) {
        val = parseFloat(values[cc]);
        if (!isNaN(val)) {
          attrs[cc] = this.scale.getValue(val);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    } else {
      for (cc in values) {
        if (values[cc]) {
          attrs[cc] = this.scale.getValue(values[cc]);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    }

    this.setAttributes(attrs);
    jvm.$.extend(this.values, values);
  }
91621
public void extractValues(HashMap<String, String> values) {
        for (MultipleSyntaxElements l : childContainers) {
            l.extractValues(values);
        }
    }