Rather than copy/paste/edit, how about defining and using CPP macros as in Data.Boolean ? Or TH macros.