Generalize join()