code: function Set(a,_sorted) {
    if (a._Set) return a;
    if (!_sorted) a=sortUnique(a);
  
    //@returns Boolean. Detect if x is in set.
    //`cmp` is custom compare functions return -1,0,1.
    // function cmp(x,item):Ordering(LT=-1|EQ=0|GT=1);
    a.contains=function (x,cmp) {return !!~bsearch(a,x,cmp)};
    a.indexOf=function (x,cmp) {return bsearch(a,x,cmp)};
    a.toArray=function () {return copyArray(a);};
  
    /** Union with another Set
    @param {Set|Array} b If b is an array,it will be corrupted by sortUnqiue
    @return {Set} return new Set */
    a.union=function (b) {
      b=Set(b);
      var n=a.length+b.length,c=new a.constructor(n);
      for (var i=0,j=0,k=0;k<n;k++) {//merge
        if (a[i]===b[j]) {c[k]=a[i++];j++;n--;}
        else if (a[i]<b[j]) c[k]=a[i++];
        else c[k]=b[j++];
      }
      c.length=n;
      return Set(c.length===n?c:copyArray(c,n),true);
    };
  
    a.inspect=a.toArray;
    a._Set=true;
    return a;
  }
docs: Build sorted Set from array.
  This function will corrupt the original array
  Proper usage:a=Set(a);
  @param {ArrayLike} a
  @return {Set} return new ArrayLike Set