functional compiler to merge in replace mode