Skip to content

Commit

Permalink
update haskell README file
Browse files Browse the repository at this point in the history
- update section about setting up PATH by updating value of
  =exec-path= (previously it was saying to update it in =user-init=
  function, but looks like you need to do it in =user-config=) -
  following syl20bnr#1718
- add FAQ section
  - add note about setting up =stack-ghci= as =haskell-process= (as
  noted in syl20bnr#2142)
  - add note about fixing problems with =ghc-mod= and =stack=
  - add note about fixing stuck REPL (following syl20bnr#3271)
  • Loading branch information
Boris Buliga committed Oct 7, 2015
1 parent 377ac14 commit e90320f
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions layers/+lang/haskell/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
- [[#repl][REPL]]
- [[#cabal-commands][Cabal commands]]
- [[#cabal-files][Cabal files]]
- [[#faq][FAQ]]
- [[#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.]]
- [[#repl-is-stuck][REPL is stuck.]]

* Description
This layer adds support for the [[https://www.haskell.org/][Haskell]] language.
Expand Down Expand Up @@ -68,7 +72,7 @@ using =stack= then it should be =~/.local/bin=. So if this path is not in
=$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
=dotspacemacs/user-init= function of your =.spacemacs= file:
=dotspacemacs/user-config= function of your =.spacemacs= file:

#+BEGIN_SRC emacs-lisp
(add-to-list 'exec-path "~/.cabal/bin/")
Expand All @@ -80,9 +84,6 @@ Or for =stack= users:
(add-to-list 'exec-path "~/.local/bin/")
#+END_SRC

*Note:* it is important to add the path in the =dotspacemacs/user-init=
function, so that the path is added before any layers is loaded.

** OS X
Note that =emacs.app= for OS X does not pick up =$PATH= from =~/.bashrc= or
=~/.zshrc= when launched from outside a terminal.
Expand Down Expand Up @@ -265,3 +266,32 @@ This commands are available in a cabal file.
| ~SPC m N~ | go to next section |
| ~SPC m P~ | go to previous section |
| ~SPC m f~ | find or create source-file under the cursor |

* FAQ

** REPL doesn't work.

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
=haskell-mode= by setting =haskell-process-type= as in following code:

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((haskell :variables haskell-process-type 'stack-ghci)))
#+END_SRC

Available options are:

- ghci
- cabal-repl
- cabal-dev
- cabal-ghci
- stack-ghci

** 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 exists, just remove it and try again.

** REPL is stuck.

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 mode to edit mode.

0 comments on commit e90320f

Please sign in to comment.