It's quite nice to have ghci integrated with Emacs through inferior-haskell-mode: this adds a wonderful possibility to quickly navigate to compile error locations, interactively inspect types, definitions, etc. Nevertheless, the major feature I'm missing in this setup is inability to use ghci tab-completion, which is quite helpful for completing functions available from imported modules, language extensions and ghci commands.
I assume that this functionality may be implemented rather trivially by passing raw "TAB" character to the ghci process, reading its output back and pasting the result into the Emacs buffer. Note that I haven't worked with "comint-mode" in Emacs, so I may be totally wrong.
Finally, we have come to my question: why this feature is missing from haskell-mode? Are there any obvious problems which I am unaware of, is it hard to implement, or is it just due to some historical reasons? (like "no one bothered to write it"). Do you have any workarounds for the problem? (except running ghci outside Emacs)
Introduction. GHCi is GHC's interactive environment, in which Haskell expressions can be interactively evaluated and programs can be interpreted.
Open a command window and navigate to the directory where you want to keep your Haskell source files. Run Haskell by typing ghci or ghci MyFile. hs. (The "i" in "GHCi" stands for "interactive", as opposed to compiling and producing an executable file.)
Quits GHCi. You can also quit by typing control-D at the prompt. Attempts to reload the current target set (see :load ) if any of the modules in the set, or any dependent module, has changed.
Check out ghc-mode that builds on top of haskell-mode and adds autocompletion and some other features.
There's also a haskell-emacs mode, which is different from haskell-mode. It also has autocompletion. Although it was quirky and not always worked when i tried it.
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