0

I recently started learning Haskell and switched over to Emacs as well.

I've installed haskell-mode.

This is what my haskell section in my .emacs file looks like

  79   (add-hook 'haskell-mode-hook 'font-lock-mode)                                                    
  80   (add-hook 'haskell-mode-hook 'interactive-haskell-mode)                                          
  81   (add-to-list 'company-backends 'company-ghc)                                                     
  82   (custom-set-variables                                                                            
  83    '(haskell-stylish-on-save t))

What I want to know is: if it's possible to get an IDE like autocomplete feature in emacs, where partially typing a function (user defined/from imported packages/from base) shows you its type and general info like you can get from hoogle search?

A brief search got me to This question which has a latest answer from 2014. I'm not sure if things have changed since.

I also found out about tags with hasktags or fast-tags but I'm not sure how to apply those methods to get autocomplete suggestions from imported packages or getting doc about written functions.

atis
  • 881
  • 5
  • 22
  • You may like to install [haskell-ide-engine and integrate it with emacs](https://github.com/haskell/haskell-ide-engine#user-content-using-hie-with-emacs). Autocompletion is a part of HIE among some other useful Haskell thingies. – Redu Nov 18 '18 at 16:18
  • Intero also does autocompletion with emacs. No integrated docs, AFAIK. – chi Nov 18 '18 at 17:03
  • @Redu Would you mind giving some general direction on how to go about installing it and making it work? I've installed hie from my package manager `arch's aur` and also generated hoogle db. `(add-to-list 'load-path "/home/path/to/lsp-mode/") (require 'lsp-mode) (require 'lsp-ui) (require 'lsp-haskell) (add-hook 'lsp-mode-hook 'lsp-ui-mode) (add-hook 'haskell-mode-hook #'lsp-haskell-enable) (add-hook 'haskell-mode-hook 'flycheck-mode) (add-hook 'lsp-mode-hook 'lsp-ui-mode) (add-hook 'haskell-mode-hook 'flycheck-mode)` are the hooks I added. But autocomplete doesn't seem to work at all. – atis Nov 18 '18 at 19:18
  • Please try to use intero, whit this configuration: https://commercialhaskell.github.io/intero/ – anquegi Nov 20 '18 at 14:43

0 Answers0