Evolution and merging of binaries with compact objects