如何在`ghc-mod`中使用`cabal repl`而不是`ghci`?

时间:2014-08-30 08:35:12

标签: haskell emacs cabal emacs24 ghc-mod

我想使用cabal repl代替ghci(。我的目标是能够在我的项目中使用其他模块)。

3 个答案:

答案 0 :(得分:5)

我的设置使用了这个:

(setq haskell-program-name "cabal repl")
(setq haskell-ghci-program-name "cabal repl")
(custom-set-variables
 ;; ...
 '(haskell-process-type 'cabal-repl)
 ;; ...
)

关于ghc和cabal并且运行正常(目前ghc-mod和emacs 24.3.1)

答案 1 :(得分:4)

GHC-mod对此有an issue,作者建议更改GHCi可执行文件:

(setq haskell-ghci-program-name "cabal")
(setq haskell-ghci-program-args '("repl"))

答案 2 :(得分:3)

您应该考虑设置Haskell Interactive Mode

与劣质Haskell模式不同,此模式与Cabal深深融合。它不仅使用cabal repl,还解释Cabal错误消息,并建议添加导入或语言扩展,并为模块提供完成。

相关问题