Implement r set union

Resubmit from #239 .