I want to use cabal repl to instead of ghci (. My goal is being able to use other modules in my project ).
I would recommend using an editor in a separate terminal, and using :r to reload, but :e can still be useful for quick edits from within GHCi. :set editor vim ... -- rest of file ... -- Use :rr to reload this file. :def! rr \_ -> return ":script ~/.ghci" -- Turn on output of types.
GHCi and the continual typechecking tool called ghcid are useful for fast feedback loops while you code, but GHCi has a lot of other features besides. This is a very basic introduction to some of those. You open a new GHCi session with the ghci command.
GHCi and the continual typechecking tool called ghcid are useful for fast feedback loops while you code, but GHCi has a lot of other features besides. This is a very basic introduction to some of those.
My setups uses this:
(setq haskell-program-name "cabal repl")
(setq haskell-ghci-program-name "cabal repl")
(custom-set-variables
;; ...
'(haskell-process-type 'cabal-repl)
;; ...
)
concerning ghc and cabal and is running fine as it is (current ghc-mod and emacs 24.3.1)
GHC-mod has an issue about this, where the author suggests changing the GHCi executable:
(setq haskell-ghci-program-name "cabal")
(setq haskell-ghci-program-args '("repl"))
You should consider to setup Haskell Interactive Mode.
Unlike Inferior Haskell Mode, this mode is deeply integrated into Cabal. It does not only use cabal repl
, but also interprets Cabal error messages and suggests to add imports or language extensions, and provides completion for modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With