Generate TyFun and TyCon definitions for defunctionalization