Handle abbreviated union types for code generation

Fixes #701 
Use `Entity` active patterns?