static IComparer toComparer(Func f) { if (f == null) return defaultComparer; return new Comparer(f); }