public static Ord Compare <type, mark>(this ROrder <type, mark> that, type l, type r) { SSemigroup <type, Infimum <mark> > semi = that; var inf = semi.Inf(l, r); return(CreateOrd(that.Equal(r, inf).Not(), that.Equal(l, inf).Not())); }
public TreeSet <v> Singleton(v value, ROrder <v, Unit> ord = null) => New(ord, WBT <v> .Singleton(value));
private static TreeSet <v> New(ROrder <v, Unit> ord, WBT <v> .N t) => new TreeSet <v> { _ord = ord, _tree = t };
public TreeSet <v> Empty(ROrder <v, Unit> ord = null) => New(ord, null);
public TreeMap <k, v> Singleton(k key, v value, ROrder <k, Unit> ord = null) => New(ord, WBT <Pair <k, v> > .Singleton(Ctors.Pair(key, value)));
public TreeMap <k, v> Empty(ROrder <k, Unit> ord = null) => New(ord, null);
private static TreeMap <k, v> New(ROrder <k, Unit> ord, WBT <Pair <k, v> > .N t) => new TreeMap <k, v> { _ord = ord, _tree = t };
public static Func <a, Ord> MkComp(ROrder <a, Unit> ord, a value) => v => (ord ?? AOrdComparer.Create(Ctors.Func <a, a, int>(Comparer <a> .Default.Compare).Map(Orders.ToOrd))).Compare(value, v);
public static IComparer <val> Cmp <val>(ROrder <val, Unit> order) => new AOrdComparer <val>(order.Compare);