High-memory usage during compilation using Template Haskell
When trying to embed some files into an executable using Template Haskell, I find that memory usage during compilation exceeds 4GB and often crashes my laptop. The files I am trying to embed are only about 25MB in size (totally 35MB in size).
I made a somewhat minimal example to demonstrate this problem. To embed the files, I am using the `file-embed` package (the issue persists when using the alternative `wai-app-static` package too). The code to demonstrate runs in Linux and is available here - https://github.com/donatello/file-embed-exp. To try it out, just clone the repository and run
make (it uses the Haskell Stack tool and the Linux dd utility).
This appear to be an issue in GHC. Is there anyway to mitigate the issue in the current version?
Related discussion: https://github.com/snoyberg/file-embed/issues/24