Brief Look at Haskell Editing Tools

Posted on September 27, 2014 by Richard Goulter
Tags: programming.haskell, programming.editors

Recently I used Haskell in a school project. It was unclear to me whether there’s a “killer” Haskell editor. (e.g. Leksah looks damn cool, but also looks quite old now). The Haskell Wiki does list a bunch, and some time I’d like to go through and do a better examination of these. My current understanding is as follows:

EclipseFP

The excellent Haskell editing plugin for Eclipse. I used this quite well with Eclipse Kepler some time ago when I was playing around with Haskell; though, I think I ran into some issues when I was trying this with Eclipse Luna.

The easiest way to get this plugin is from a standard Eclipse installation, and using the update-site to download the plugin. Now that Cabal supports cabal sandboxes, EclipseFP is able to download its dependencies without messing up your cabal setup.

For some reason I didn’t opt for EclipseFP, but wanted to try out Haskell support for various editors.

Atom + IDE-Haskell

Atom (or, the free equivalent to Sublime Text) + IDE-Haskell is reasonably easy to install; though there are some dependencies which IDE-Haskell requires. I liked this setup quite a lot, although I never bothered to customise or adjust Atom very much. (By default, it gave me an awful variable-width font, so that had to change).

I think this is what I would recommend in general; it’s inferior to EclipseFP in that the latter has a nice interface for editing Cabal project files, but it’s nice for by-default having a UI which emphasised text editing. (On the downside to Atom, though, is sometimes I encountered the Chrome dev-tools bar, which completely threw-off the look & feel of Atom).
- Maybe it’s possible to customise Eclipse to be nice to use like this (beyond just double-clicking on the edit window), but Eclipse is a beast.

Vim + …?

I’m a big Vim fan. Certainly the text motions, as well as a bunch of plugins (like fuzzy-finding autocompletion in YCM) are features I really want in a text editor. (If your editor has things like that, great!).

But previously I wasn’t able to get Vim + Haskell working well together. It’s not due to a lack of support, but rather, a fragmentation in what support there is, and so it’s unclear what option to go with.

I was fortunate to stumble upon the StackOverflow question Is haskellmode-vim dead?, where the author adds:

Just in case someone stumbles over this question in the future. My current (haskell specific) vim configuration contains these plugins: ghcmod-vim (type exploring), neco-ghc (auto completion), syntactic [sic] (error highlighting), vim2hs (misc utils)

Thank you, Florian. :-) Indeed, this setup is fantastic. Slightly difficult to install if you’re using Vundle to manage plugin dependencies (I’ve heard NeoBundle takes care of these things), since ghcmod-vim requires vimproc, which needs to be natively-compiled.

The one downside to this setup is that the “checking” done by syntastic(?) (and/or ghcmod-vim?) would be slow whenever I saved the file. My understanding is this is due to Vim’s single-threaded, synchronous nature of dealing with computations. One hopes that NeoVim, in addition to being well tested, will come with a community to make use of its nifty new features.

Summary

Off the top of my head (and from what I used), I can’t recall all the features each of these had. That’s why it would be nice to have a round-up and summary/analysis of the current state of Haskell editing tools.

I know the Vim one had both TagBar support (at least with lushtags, maybe?), and some level of auto-completion; errors from :GhcModCheck were linked with quickfix, and :GhcModType was able to give me the type of the current item. (Things which would be nicer with proper key bindings).


Newer post Older post