How to set ghci options for cabal repl?

后端 未结 1 1117
半阙折子戏
半阙折子戏 2021-02-19 09:49

I have a haskell project which I compile with -Werror by default. This means that when I run cabal repl it runs with the option -Werror tu

1条回答
  •  粉色の甜心
    2021-02-19 10:23

    You can set GHCi options in your ~/.ghci file:

    :set -w
    

    This overrides the -Wall from cabal repl for me.

    My understanding is that ghci has the same defaults a ghc: it's like calling the compiler with no flags. cabal repl gets its defaults from your .cabal file (like ghc-options: -Wall), but this is overridden by your ~/.ghci file.

    You can also create a .ghci file in your project directory, with per-project settings there. However, this seems to interact awkwardly with my global ~/.ghci file: adding a set -Wall does not override the :set -w from the global one. I'm not sure if this behavior is intended or I'm just misunderstanding something.

    0 讨论(0)
提交回复
热议问题