I have a huge haskell file which compiles and runs without any problem. I want to put some functions and type definitions in a separate module in a generic hs file and then import it in my main module. While the main program compiles without any error (it also compiles the imported module), I get a stack space overflow when I try to run it.
I tried:
ghc --make -O2 Main.hs
./Main -- stack space overflow
Also:
ghc --make -O2 Main.hs Other.hs -o RunMe
./RunMe -- again, stack space overflow
Is it the right way to compile or am I missing anything?