It's simpler to write:
```
OpamPackage.Set.(add nv (union (get_dependencies nv) set))
```