
Using Emacs for Haskell development - lelf
https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md
======
aaronem
There's no need to restart Emacs for a trivial config change; you just M-x
eval-buffer RET and go on about your business, and I've opened a pull request
with a patch which updates the document to reflect that fact. (You do still
want to restart after something like a major package update, because not every
module author is good about making sure that his code can be initialized more
than once per session, and the patch reflects that fact as well.)

------
mark_l_watson
Thanks for the article! I have been happily using just haskell-mode for a long
time, but as soon as I get back home from my vacation with my grand kids I
will work through the suggestions.

I have been using various Lisps professionally since 1981 and the more I use
Haskell, it seems like just another Lisp but with a different syntax, because
of the interactive, bottom up development style.

------
rakel_rakel
Nice writeup!

I've always wondered why functional programming-people seem to prefer emacs
over vim? I guess it could be the choice for people wanting more IDE-like
features, and aren't afraid of a little bloat(cause surely it can't just be
the lisp in the configs), am I right?

~~~
jeremyjh
Disclaimer: I'm a Haskeller who prefers Vim.

I think the reason for Emacs dominance is mostly historical: early on it was
probably due to good capability for integrating a REPL process. Also since it
is written in a lisp and can be grown organically to fit almost any purpose it
developed an ecosystem of useful tools more quickly than Vim - attracting more
developers who further developed tooling.

Today the only feature you can't get in Vim that Emacs has is structured
haskell mode. I haven't used that enough to know if its worth the switch...

I DID try to switch and while none of this is a real show-stopper and it all
could be fixed - I spent a dozen hours on trying to get an Emacs setup with
all the features I have in Vim and simply couldn't. For example the auto-
complete plugins do not list the type signatures in the pop-up window like
neco-ghc does and there is nothing that comes close to fugitive. Also Emacs
has an hdevtools plugin for flycheck but I doubt its used much because it
doesn't even have a way to pass command line arguments so I had to go hack
that in myself. Hdevtools is a killer feature, having _instant_ compilation
feedback is incredibly useful in Haskell...it makes it so easy to use the type
system interactively while designing a new module. I did get hdevtools to work
eventually but I would have to learn emacs lisp to get it working right and
since there are other gaps I never put in the effort. I could never figure out
how to launch a ghci process with custom arguments...I want the damn REPL to
be launched with cabal repl so that it has the same environment as my code and
... I'm sure its easy if you know what you are doing, but I spent at least a
couple of hours on that alone and failed. I spent probably 3-4 hours getting
Evil working the way I want, things like imap keybinds required a lot of
research for some reason. I did get it to work though...Emacs without Evil is
not even a contender in mind - modal editing is just way to powerful and my
left pinky will be out the goddamn door if I make it pound chords all day.

~~~
__Joker
I am a vim-er and I decided that I will stick to one editor and that will be
vim. I don't want to spent more time on learning one more editor. Emacs may be
great but I made my choice and I want to stick to it.

For some time I wanted dive into haskell, and could not afford time, but
recently I am getting some time freed up.

Can you suggest, how to set up vim for haskell like any plugins or scripts for
better development experience.

As a side not this
video([https://www.youtube.com/watch?v=ScS8Q32lMxA](https://www.youtube.com/watch?v=ScS8Q32lMxA))
of live haskell coding in vim looks interesting.

~~~
qubitcoder
I highly recommend haskell-vim-now [1]. The author has a nice demo showcasing
this setup, along with his virtual pair-coding environment [2].

With one install command, you get a polished Vim/Haskell setup with tab
completion, type inspection, Hoogle, hinting, unicode symbols, etc.

Also has a nice dark theme. In fact, I use it as my go-to Vim configuration on
new systems, even outside of Haskell.

It also lets you pipe code to the Haskell REPL for live evaluation (via tmux).

[1] [https://github.com/begriffs/haskell-vim-
now](https://github.com/begriffs/haskell-vim-now) [2]
[https://www.youtube.com/watch?v=7sr8cAIwdBs](https://www.youtube.com/watch?v=7sr8cAIwdBs)

EDIT: Add video

~~~
yepguy
That installation script is horrifying! I'm sure it has saved some people a
lot of time, but it's a terrible idea to point anyone to it who already has an
existing vim config.

------
swah
See also
[http://www.haskell.org/haskellwiki/Yi](http://www.haskell.org/haskellwiki/Yi)

Hehe. The "linux tiling wm" and "emacs-like editor" fads were cooler the
current one ("our own javascript ui framework").

