Apply the same foldBuilders thing to `distinctBy`.