code generation for upg from the library to Haste