Refactor Compiler.hs.