implement task types for unions and loops