A tool to automatically select and add (almost) only the necessary extensions to code that compiles successfully with -fglasgow-exts would be quite nice to have, especially if it could run on a whole package. The easiest thing would probably be to compile the module and then add extensions included in -fglasgow-exts based on error messages, repeating until the module compiles successfully. The included extension I'm familiar with that seems hardest to handle is ScopedTypeVariables, as that can (in some cases) change the meaning of code that compiles either way. So the easiest thing would be to just include it unconditionally.