You could try using my fork which addresses exactly that for enums (I have to put together a PR): https://github.com/rowdaboat/futhark You could try using `henka`, my tool: https://github.com/rowdaboat/henka