createOrderedArrayFunction = comparator => {
	let fn = createOrderedArrayFunctionMap.get(comparator);
	if (fn !== undefined) return fn;
	fn = set => {
		set.sortWith(comparator);
		return Array.from(set);
	};
	createOrderedArrayFunctionMap.set(comparator, fn);
	return fn;
}
@template T
@param {ModuleComparator} comparator comparator function
@returns {ModuleSetToArrayFunction} set as ordered array