haskell build phase is very slow

Hi Cafe, I came from the C/C++ world, recently I play with a haskell editor named yi-editor, I find haskell build phase is very slow: 1.Compile one .hs file is slow 2. When change a little, it will recompile many many files Compare to c, compile a c source file seems much quick then compile a haskell source file. And if i change a .c file, it only recompile the file i changed, and relink, it's awesome. How can i make my build phase more quick? Thanks!

yi is pretty heavy, as these things go. So it's not too surprising that it's taking a while. GHC does try to recompile as little as possible...but "as little as possible" can be quite a lot. Inlining, and other optimizations GHC performs, makes the recompilation checker's job tricky; see [1]. Generally if you change a file you'll need to recompile its dependencies, and *their* dependencies, and so on. If you're coding along and just need a typecheck, ghci is your friend. Specifically, the :reload command tends to be fast. (You'll need to :load yourFile.hs the first time, of course.) You might also see if yi's -fhacking flag is helpful. It looks like it might be relevant, though I don't know either yi or your use case well enough to say for sure. General advice on speeding compilation is here: [2]. Most of it isn't all that relevant to you at the moment, since you're hacking on someone else's package. But always good to know. Best of luck, Ben [1]: http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation... [2]: http://www.haskell.org/ghc/docs/latest/html/users_guide/sooner-faster-quicke...
participants (3)
-
Ben Doyle
-
Felipe Almeida Lessa
-
Junior White