haskell-mode can complete symbols, pragma directives, language
extensions, and language keywords out-of-box.
completes identifiers (symbols) using tags (see “Tags”), however you
can get more precise completions with
In interactive mode completion candidates are produced by querying
haskell-interactive-mode is enabled and working Haskell mode
provides completions for import statements taking into account
currently loaded and available packages. Also it completes symbols
querying REPL with
:complete command, hence completion
candidate list also includes symbols from imported modules.
Unfortunately, it is not possible to provide candidates for
identifiers defined locally in
where blocks even
in interactive mode. But if you’re using
company-mode you can override
company-backends variable for Haskell buffers to combine
completion candidates from completion-at-point function
company-capf backend) and dynamic abbrevs.
company-mode provides special backend for dabbrev code
company-dabbrev-code. To combine
completions from diffrent backends you can create grouped backends, it
is very easy — a grouped backend is just a list of backends, for
(add-hook 'haskell-mode-hook (lambda () (set (make-local-variable 'company-backends) (append '((company-capf company-dabbrev-code)) company-backends))))
If you use a GHCi version prior to 8.0.1 you might want to set
nil, if you
experience major slowdown while trying to complete after an Haskell
operator (See GHC-Bug 10576).