Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haskell development Environment Setup for Spacemacs tutorial #8

Open
soupi opened this issue Sep 6, 2015 · 6 comments
Open

Haskell development Environment Setup for Spacemacs tutorial #8

soupi opened this issue Sep 6, 2015 · 6 comments

Comments

@soupi
Copy link

soupi commented Sep 6, 2015

Can someone write a step by step tutorial on how to setup a good Haskell development environment for Spacemacs for beginner users of Spacemacs?

Thanks in advance!

@ajnsit
Copy link

ajnsit commented Sep 8, 2015

Spacemacs comes with solid Haskell support built in, you simply need to enable it in your layers config. I wrote a comment on reddit with some notes - https://www.reddit.com/r/haskell/comments/3jww0s/can_you_post_your_emacs_configuration_for/cut7u3q

@soupi
Copy link
Author

soupi commented Sep 8, 2015

Saying "you simply need to enable it in your layers config" is exactly what I'd like a tutorial for. I haven't used Emacs or Spacemacs so I haven't got a clue on what I need to do.

@ajnsit
Copy link

ajnsit commented Sep 8, 2015

Ah, apologies :) I understand how difficult it can be to simply get started.

In absence of a complete tutorial, see if these steps make sense to you -

  1. Assuming you have spacemacs installed and running, use <SPC> : dotspacemacs/install to generate a .spacemacs configuration file.
  2. Run the following command to start editing the config file - <SPC> f e d
  3. In your config file, look for the section which starts with dotspacemacs-configuration-layers '(. It should have a list of default layers. If the list is 'all then haskell is already enabled. Else, add haskell to the list.
  4. Press : w q to exit. Then restart emacs. Spacemacs should start installing the haskell mode files. It may ask you to restart emacs once or twice.
  5. You would need to open a Haskell file from your project to be in haskell mode. The first time you do that (per project), ghc-mod will configure and build your project.

That's it! You would also need to have ghc-mod, hindent, and cabal executables on your $PATH so emacs can pick them up. How to do that is platform dependent.

@soupi
Copy link
Author

soupi commented Sep 12, 2015

Thank you for your reply, though I did have some hard time setting things up.
I did as you suggested but only got syntax highlighting and indentation. after also adding haskell-mode after haskell I also got "go to definition` and hoogle support, but no type error checks and auto completion.
Also, I had a problem when running spacemacs that it did not get pass the initialization stage but somehow this got fix. now everytime I open a Haskell file I get stuck at "Initializing" until I press some buttons (maybe C-g?).
I'm not really sure what causing these problems or how to fix them :I

@ajnsit
Copy link

ajnsit commented Sep 13, 2015

Hmm looks like DanielG/ghc-mod#575. Did you
look at the notes I wrote on Reddit? It gives a potential solution.

On Saturday 12 September 2015, suppi [email protected] wrote:

Thank you for your reply, though I did have some hard time setting things
up.
I did as you suggested but only got syntax highlighting and indentation.
after also adding haskell-mode after haskell I also got "go to
definition` and hoogle support, but no type error checks and auto
completion.
Also, I had a problem when running spacemacs that it did not get pass the
initialization stage but somehow this got fix. now everytime I open a
Haskell file I get stuck at "Initializing" until I press some buttons
(maybe C-g?).
I'm not really sure what causing these problems or how to fix them :I


Reply to this email directly or view it on GitHub
#8 (comment).

Sent from my hyper-communicator

@mrkgnao
Copy link

mrkgnao commented Sep 13, 2015

Hey, @soupi asked me to share any solution I might have here. Here's a Reddit post in which I detail my setup. Everything works now, with stack. I just have to get the hang of Emacs and everything now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants