Simplifier uses gigabytes of memory with large transformer stacks
Summary
When compiling the attached file with "-O", GHC hangs during optimization phases until the system runs out of memory. The problem seems to relate to deeply nested monad transformer stacks and the strict modify function.
Steps to reproduce
Run "ghc -O Main.hs" on the attached file. The out.txt file is the output from ghc using -v2.
Expected behavior
GHC should compile the program with optimizations without using gigabytes of memory.
Environment
- GHC version used: 8.10.1 or 8.8.2
Optional:
- Operating System: Nixos unstable
- System Architecture: x86-64