update haskell README
Improve PATH section. As requested in #2142. Also make some minor improvements.
This commit is contained in:
parent
9119766d35
commit
9dab3b2e8e
1 changed files with 35 additions and 18 deletions
|
@ -22,9 +22,9 @@
|
||||||
- [[#cabal-commands][Cabal commands]]
|
- [[#cabal-commands][Cabal commands]]
|
||||||
- [[#cabal-files][Cabal files]]
|
- [[#cabal-files][Cabal files]]
|
||||||
- [[#faq][FAQ]]
|
- [[#faq][FAQ]]
|
||||||
- [[#repl-doesnt-work][REPL doesn't work.]]
|
- [[#repl-doesnt-work][REPL doesn't work]]
|
||||||
- [[#i-am-using-stack-and-ghc-mod-but-ghc-mod-doesnt-work][I am using =stack= and =ghc-mod=, but =ghc-mod= doesn't work.]]
|
- [[#i-am-using-stack-and-ghc-mod-but-ghc-mod-doesnt-work][I am using =stack= and =ghc-mod=, but =ghc-mod= doesn't work]]
|
||||||
- [[#repl-is-stuck][REPL is stuck.]]
|
- [[#repl-is-stuck][REPL is stuck]]
|
||||||
|
|
||||||
* Description
|
* Description
|
||||||
This layer adds support for the [[https://www.haskell.org/][Haskell]] language.
|
This layer adds support for the [[https://www.haskell.org/][Haskell]] language.
|
||||||
|
@ -36,7 +36,6 @@ This layer adds support for the [[https://www.haskell.org/][Haskell]] language.
|
||||||
*This layer is in construction, it needs your contributions and bug reports.*
|
*This layer is in construction, it needs your contributions and bug reports.*
|
||||||
|
|
||||||
* Install
|
* Install
|
||||||
|
|
||||||
** Layer
|
** Layer
|
||||||
To use this contribution add it to your =~/.spacemacs=
|
To use this contribution add it to your =~/.spacemacs=
|
||||||
|
|
||||||
|
@ -64,14 +63,35 @@ following command:
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Setup PATH
|
** Setup PATH
|
||||||
|
First of all make sure that your =$PATH= contains installation path for Haskell
|
||||||
|
tools like =ghc=, =ghci= etc. It depends on how you have installed =ghc=. But
|
||||||
|
you can always check it by calling =$ which ghc= in your terminal. =Stack= users
|
||||||
|
should add only installation path of =stack= itself, usually it's
|
||||||
|
=~/.local/bin=.
|
||||||
|
|
||||||
Make sure that your =$PATH= contains installation path for =cabal= packages. If
|
Then make sure that your =$PATH= contains installation path for =cabal=
|
||||||
you are using =cabal= it should be =~/.cabal/bin= or
|
packages. If you are using =cabal= it should be =~/.cabal/bin= or
|
||||||
=/Users/<username>/Library/Haskell/bin= (for Haskell for Mac users). If you are
|
=/Users/<username>/Library/Haskell/bin= (for 'Haskell for Mac' users). If you
|
||||||
using =stack= then it should be =~/.local/bin=. So if this path is not in
|
are using =stack= then it should be =~/.local/bin=.
|
||||||
=$PATH=, just add it and Spacemacs will automatically pick up shell =$PATH=.
|
|
||||||
|
|
||||||
_Alternatively_, you can add it to the Emacs =exec-path= variable in the
|
If you are using =bash=, =sh= or =zsh=, you could update your =$PATH= by using
|
||||||
|
following command:
|
||||||
|
|
||||||
|
#+BEGIN_SRC sh
|
||||||
|
$ export PATH=~/.local/bin:$PATH
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
If you are using =fish=, you could update your =$PATH= by using following
|
||||||
|
command:
|
||||||
|
|
||||||
|
#+BEGIN_SRC fish
|
||||||
|
$ set -x PATH ~/.local/bin $PATH
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
After you setup your =$PATH=, emacs should automatically pick it's value (after
|
||||||
|
restart).
|
||||||
|
|
||||||
|
_Alternatively_, you can add path to the Emacs =exec-path= variable in the
|
||||||
=dotspacemacs/user-config= function of your =.spacemacs= file:
|
=dotspacemacs/user-config= function of your =.spacemacs= file:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
@ -270,8 +290,7 @@ This commands are available in a cabal file.
|
||||||
|
|
||||||
* FAQ
|
* FAQ
|
||||||
|
|
||||||
** REPL doesn't work.
|
** REPL doesn't work
|
||||||
|
|
||||||
Usually =haskell-mode= is great at figuring out which interactive process to
|
Usually =haskell-mode= is great at figuring out which interactive process to
|
||||||
bring up. But if you are experiencing problems with it you can help
|
bring up. But if you are experiencing problems with it you can help
|
||||||
=haskell-mode= by setting =haskell-process-type= as in following code:
|
=haskell-mode= by setting =haskell-process-type= as in following code:
|
||||||
|
@ -289,13 +308,11 @@ Available options are:
|
||||||
- cabal-ghci
|
- cabal-ghci
|
||||||
- stack-ghci
|
- stack-ghci
|
||||||
|
|
||||||
** I am using =stack= and =ghc-mod=, but =ghc-mod= doesn't work.
|
** I am using =stack= and =ghc-mod=, but =ghc-mod= doesn't work
|
||||||
|
|
||||||
Make sure that =dist= directory doesn't exist in your project root. So if it
|
Make sure that =dist= directory doesn't exist in your project root. So if it
|
||||||
exists, just remove it and try again.
|
exists, just remove it and try again.
|
||||||
|
|
||||||
** REPL is stuck.
|
** REPL is stuck
|
||||||
|
|
||||||
Make sure that when you are typing anything in REPL there is a space between
|
Make sure that when you are typing anything in REPL there is a space between
|
||||||
what you type and =λ=. This problem usually happens when you switch from normal
|
what you type and =λ>=. This problem usually happens when you switch from normal
|
||||||
mode to edit mode.
|
mode to insert mode.
|
||||||
|
|
Reference in a new issue