[Haskell-cafe] Using haskell with emacs

Thomas Schilling nominolo at googlemail.com
Mon Aug 6 16:40:50 EDT 2007

On 6 aug 2007, at 22.11, Paulo J. Matos wrote:

> Hi all,
> I'm starting to learn haskell by my own, being currently mostly a
> Common Lisp, Scheme, C++ programmer... I've got the haskell emacs mode
> but can't find a manual. Moreover, I've found some keybindings on the
> net but nothing that allows me to start an interpreter in emacs and
> send definitions, one by one to the interpreter. Is this possible? Is
> there any good reference of the emacs keybindings for haskell mode?

If you're used to Slime+Paredit, then there isn't something really  
comparable, but you get some basic interactive programming with the  
standard key-bindings:

   C-c C-b ... when pressed for the first time this will start an  
interpreter (ghci or hugs most of the time), when pressed with a  
running interpreter it'll switch to that buffer.

   C-c C-l ... Load the current file into the editor.  There is no  
function-wise compilation.

With the latest Haskell mode, you get clickable error messages, too.

Then there is shim[1], which is a start of a Slime-like emacs mode,  
it can:

  - compile and show compile errors directly in the source (C-c C-k)

  - insert the type of a function (C-c C-t)

The big problem with shim is, that it is only really useful as long  
as your code compiles.  To have anything more useful you need to have  
good (incremental) parsing facilities, which Emacs isn't particularly  
good at.  Every once in a while I do some hacking towards this goal,  
but it's rather low-priority (and I'm no particular Emacs guru  
either, though with (require 'cl) it get's somewhat more fun.)

Many Haskell hackers also prefer Vim, so that doesn't help, either ;)

Oh, and there's hoogle.el, which is pretty similar to Hyperspec  
lookup (actually, I think it's better; more like Lisp-doc lookup).

/ Thomas

[1] ..  http://shim.haskellco.de/trac/shim

More information about the Haskell-Cafe mailing list