Personal tools


From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(indicate lack of maintenance of eclipse plug-ins)
(Vim: comment out dead link)
Line 87: Line 87:
:* [ Ghcmod-vim]
:* [ Ghcmod-vim]
:* [ Hdevtools] - gives type information, quicker reloading and more.
:* [ Hdevtools] - gives type information, quicker reloading and more.
:* [ Addition list] with some missing here with screen shots of many of the above.
<!-- :* [ Addition list] with some missing here with screen shots of many of the above. --!>
=== [ Emacs] ===
=== [ Emacs] ===

Revision as of 07:41, 31 January 2017

The IDE world in Haskell is incomplete, but is in motion. There are many choices. When choosing your IDE, there are the following things to consider.


1 Notable features of interest to consider

This is a list of features that any Haskell IDE could or should have. The IDEs listed below generally support some subset of these features. Please add more to this list if you think of anything. In future this should be expanded into separate headings with more description of how they would desirably work. For a discussion of IDEs there is the haskell-ide mailing list and the haskell-ide repository

  • Syntax highlighting (e.g. for Haskell, Cabal, Literate Haskell, Core, etc.)
  • Macros (e.g. inserting imports/aligning/sorting imports, aligning up text, transposing/switching/moving things around)
  • Type information (e.g. type at point, info at point, type of expression)
  • IntelliSense/completion (e.g. jump-to-definition, who-calls, calls-who, search by type, completion, etc.)
  • Project management (e.g. understanding of Cabal, configuration/building/installing, package sandboxing)
  • Interactive REPL (e.g. GHCi/Hugs interaction, expression evaluation and such)
  • Knowledge of Haskell in the GHCi/GHC side (e.g. understanding error types, the REPL, REPL objects, object inspection)
  • Indentation support (e.g. tab cycle, simple back-forward indentation, whole area indentation, structured editing, etc.)
  • Proper syntactic awareness of Haskell (e.g. with a proper parser and proper editor transpositions a la the structured editors of the 80s and Isabel et al)
  • Documentation support (e.g. ability to call up documentation of symbol or module, either in the editor, or in the browser)
  • Debugger support (e.g. stepping, breakpoints, etc.)
  • Refactoring support (e.g. symbol renaming, hlint, etc.)
  • Templates (e.g. snippets, Zen Coding type stuff, filling in all the cases of a case, etc.)

2 Open Source

2.1 IntelliJ plugin for Haskell

See the announcement of the plugin and the Wikipedia article about IntelliJ.

2.2 EclipseFP plugin for Eclipse IDE

Eclipse is an open, extensible IDE platform for "everything and nothing in particular". It is implemented in Java and runs on several platforms. The Java IDE built on top of it has already become very popular among Java developers. The Haskell tools extend it to support editing (syntax coloring, code assist), compiling, and running Haskell programs from within the IDE. In more details, it features:
  • Syntax highlighting and errors/warning highlighting
  • A module browser showing all installed packages, their modules and the contents of the modules (functions, types, etc.)
  • Integration with Hoogle: select an identifier in your code, press F4 and see the results in hoogle
  • Code navigation: from within a Haskell source file, jump to the file where a symbol in declared, or everywhere a symbol is used (type sensitive search, not just a text search)
  • Outline view: quickly jump to definitions in your file
  • Quick fixes on common errors and import management
  • A cabal file editor and integration with Cabal (uses cabal configure, cabal build under the covers), and a graphical view of installed packages
  • Integration with GHCi: launch GHCi inside Eclipse on any module
  • Integration with the GHCi debugger: performs the GHCi debugging commands for you from the standard Eclipse debugging interface
  • Integration with HLint: gives you HLint warning on building and allows you to quick fix them
  • Integration with Stylish-Haskell: format your code with stylish-haskell
  • Test support: shows results of test-framework based test suite in a graphical format. HTF support to come soon.

The plug-ins seem not to be maintained; the github pages says:

   Latest commit 2875908 on May 14, 2015 @JPMoresmau JPMoresmau Not maintained

2.3 Colorer plugin for Eclipse IDE

Syntax highlighting in Eclipse can be achieved using the Colorer plugin. This is more light weight than using the EclipseFP plugin which has much functionality but can be messy to install and has sometimes been a bit shaky.
Eclipse Colorer is a plugin that enables syntax highlighting for a wide range of languages. It uses its own XML-based language for describing syntactic regions of languages. It does not include support for Haskell by default, but this can be added using the syntax description files attached below.
Installation instructions
  1. Install the Colorer from the update site (for more detailed instructions see the project page).
  2. Download the Haskell syntax description files in Haskell_Eclipse_Colorer.tar.gz.
  3. Extract its contents (haskell.hrc and proto.hrc) into the following directory (overwriting proto.hrc): eclipse_installation_dir/plugins/net.sf.colorer_0.9.9/colorer/hrc (sometimes the wiki seems to create a nesting tar file, so you might have to unpack twise).
  4. Finished. A restart of Eclipse might be required. .hs files should open with syntax highlighting.
  • If .hs files open with another kind of syntax highlighting check that they are associated with the Colorer Editor (Preferences -> General -> Editors -> File Associations). Or right click on them and choose Open With -> Other -> Colorer Editor.
  • Sometimes the highlighting gets confused. Then it might help to press Ctrl+R and re-colour the editor.
  • Use the Word Completion feature (Shift+Alt+7) as a poor man's content assist.
  • Use the standard External Tools feature in Eclipse to invoke the compiler from inside the IDE.
  • Use the Block selection feature (Shift+Alt+A) to insert/remove line comments on multiple lines at the same time.
  • Some other useful standard Eclipse features include the Open resource command (Ctrl+Shift+R), the File search command (Ctrl+H) and the bookmarks feature (Edit -> Add bookmark). Make sure to check Include in next/prev navigation box (Windows -> Preferences -> General -> Editors -> Text Editors -> Annotations -> Bookmarks).

2.4 Leksah

Leksah is an IDE for Haskell written in Haskell. Leksah is intended as a practical tool to support the Haskell development process. Leksah uses GTK+ as GUI Toolkit with the gtk2hs binding. It is platform independent and should run on any platform where GTK+, gtk2hs and GHC can be installed.

2.5 KDevelop

This IDE supports many languages. For Haskell it currently supports project management, syntax highlighting, building (with GHC) & executing within the IDE.

2.6 Vim

This may or may not be up to date. A Vim user should update it.

  • Haskell-vim-now -- Full-featured Vim config with install script. Supports type inspection, linting, Hoogle, tagging with codex+hasktags, unicode concealing, and refactoring.
  • Haskell mode for Vim by Claus Reinke - These plugins provide Vim integration with GHC and Haddock.
  • Syntastic -- An extremely useful Vim plugin which will interact with ghc_mod (when editing a Haskell file) every time the source file is saved to check for syntax and type errors.
  • SHIM by Lars Kotthoff -- Superior Haskell Interaction Mode (SHIM) plugin for Vim providing full GHCi integration (requires Vim compiled with Ruby support).
  • Haskell Conceal -- shows Unicode symbols for common Haskell operators such as ++ and other lexical notation in Vim window (source file itself remains unchanged).
  • by Ian Lynagh: distinguishes different literal Haskell styles (Vim 7.0 includes a syntax file which supersedes these plugins).
  • There's a copy of lhaskell.vim on the Wiki.
  • by Marc Weber -- Vim script-based function/module completion, cabal support, tagging by one command, context completion ( w<tab> -> where ), module outline, etc
  • Vim indenting mode for Haskell
  • neco-ghc pragma, module, function completion.
  • Ghcmod-vim
  • Hdevtools - gives type information, quicker reloading and more.