How to prevent recompilation when switching between ghci and ghc

When I use both ghci with -fobject-codeand the ghc command line, the code compiles completely when switching from one to the other. For example, when I work interactively in Emacs using the haskell inferior mode configured to use cabal repl, code loading and compilation are fine. Then I do cabal build, and the same code is recompiled.

How can I prevent this double compilation from assuming that -fobject-codeghci actually uses the same kind of binary format as ghc?

+4
source share
1 answer

ghci, . ~/.ghci :

:set -hisuf i_hi
:set -osuf i_o

... ghci foo.i_hi foo.i_o, .hi .o ghc.

0

Source: https://habr.com/ru/post/1608787/


All Articles