code: func Aggregate(ps []Prefix) []Prefix {
  	ps = newSortedPrefixes(ps, sortAscending, true)
  	sortByDescending(ps)
  	switch len(ps) {
  	case 0:
  		return nil
  	case 1:
  		return ps[:1]
  	}
  	bfFn, superFn := branchingFactorIPv6, supernetIPv6
  	if ps[0].IP.To4() != nil {
  		bfFn, superFn = branchingFactorIPv4, supernetIPv4
  	}
  	ps = aggregate(aggregateByBF(ps, bfFn, superFn))
  	sortByAscending(ps)
  	return ps
  }
docs: // Aggregate aggregates ps and returns a list of aggregated prefixes.