int? min(int Function(T) selector) { if (isEmpty) { return null; } return skip(1) .fold(selector(first), (prev, next) => math.min(prev!, selector(next))); }