functor version of unbalanced-set