Stack space overflow on function separation in different hs files

I have a huge haskell file that compiles and runs without any problems. I want to put some functions and type definitions in a separate module in a shared hs file, and then import it into my main module. Although the main program compiles without any error (it also compiles the imported module), I get a stack overflow when I try to start 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 correct to compile or am I missing something?

+5
source share
2 answers

. . , , , GHC -, .

, GHC , . , GHC , , .

, , .

+6

, GHC ( ), , . , , GHC , , .

. ., , Haskell Wiki RWH.

+5

All Articles