24

You can also install exec-path-from-shell package and add this to your init file: (exec-path-from-shell-initialize)


10

This is an OSX annoying environment issue, the $PATH appearing in Emacs is coming from /etc/paths file, which then gets appended with whatever I've set in the shell. I added /Users/g/Library/Haskell/bin to the top of the /etc/paths file and it then worked fine. Going into shell and calling echo $PATH in Emacs shows now: /Users/g/Library/Haskell/bin:/usr/...


9

You need to enable multi-line commands support in GHCi. Put :set +m to GHCi config file or execute it directly in org-babel session as shown in the following code: #+begin_src haskell :set +m let doubleSmallNumber4 x = if x > 0 then x else x*2 doubleSmallNumber4 42 #+end_src #+RESULTS: : 42


5

Well i got answer from #haskell in freenode (thanks dmwit!). the problem is that the REPL run the code line by line (and not as a whole), thus every line create a new qs, shadowing the old one. so what i need to do is add a parentheses before and after the code, like that: #+BEGIN_SRC haskell :{ qs [] = [] qs [x] = [x] qs (x:xs) = qs [a | a <- xs, a < ...


5

If you start emacs from your GUI environment (gnome, kde, ...) your shell startup scripts will not be sourced into your environment. So the $PATH that you carefully set in your .zsh will not be loaded. GUI environments do not generally source these, though they may load your ~/.profile file. You can try adding this to your .pam_environment: PATH DEFAULT=${...


4

On my system (Fedora 20) the default cabal version that comes with the haskell-platform package is 1.16.0.2. After installing the latest cabal-install (cabal install cabal-install), I have a new cabal binary in ~/.cabal/bin/cabal. If I don't do any particular configuration in Emacs, haskell-interactive-bring will fail with the same error you report. When ...


4

The important value at runtime is haskell-font-lock-keywords, which is generated from the alist when loading haskell-font-lock.el. After changing haskell-font-lock-symbols-alist you will also have to recompute the value of hakskell-font-lock-keywords. This snippet will add the heart character to the alist and recompute haskell-font-lock-keywords such that ...


3

If some part of the PATH gets lost then you can add it in your ~/.emacs ;;; We add /path/to/something/extra by appending it to the path (setenv "PATH" (concat (getenv "PATH") ":/path/to/something/extra")) ;;; /path/to/something/extra is now at the end of the PATH. ;;; or you can use: ;(setenv "PATH" (concat "/path/to/something/extra:" (getenv "PATH"))) ;;; /...


3

This appears to be a problem with the interaction between evil and haskell-mode. Here are some relavent issues on the spacemacs and haskell-mode bug trackers: https://github.com/syl20bnr/spacemacs/issues/5010 https://github.com/haskell/haskell-mode/issues/1265 Per a comment on the issue in the haskell-mode repository, here is a temporary fix for the "o" ...


3

Another way to accomplish this is to simply tell the shell that it's a login shell so that it sources all of the right files. I do this for bash by setting explicit-bash-args to ("--noediting" "--login"). It looks like the equivalent for zsh would be to set explicit-zsh-args to ("-l"). So in my .emacs: (setq explicit-bash-args '("--noediting" "--login"))...


2

All you (should) need to do is insert the following line in your emacs config: (setq haskell-process-type 'stack-ghci) That tells emacs that you want to use stack's repl command instead of whatever haskell-mode tries to infer automatically for you.


2

In haskell-mode, C-c C-l calls haskell-process-load-or-reload, and you go into a sub-mode called haskell-cabal-mode-map. In that mode there is a command haskell-interactive-mode-clear to clear the ghci buffer. (erase-buffer does not work, because the buffer is read-only so you cannot erase it) So You can map haskell-interactive-mode-clear like that: (eval-...


2

Hoogle is what I serching for. At this moment there is (at least) two ways to integrate it nicely with Emacs. Directly through haskell-mode. Fuction which should be called with cursor on desired symbol is haskell-hoogle-lookup-from-local. It will ask you to run hoogle local server for the first time. You also have to install hoogle in your stack sandbox via:...


1

You can use this line in your Emacs configuration in order to use Stack's GHCI: (custom-set-variables '(haskell-process-type 'stack-ghci)) Then use the haskell-session-change command to change the buffer mode and enter interactive Haskell. You can find more info in this tutorial.


1

In my case, and in case anyone else using dante stumbles on this: this seems to be a feature of Dante for typechecking to work. And this was removed in favour of using temp. files as discussed in this issue. The resolution, in my case, was to upgrade dante from 1.5 -> 1.6, which doesn't have this issue. You'd want to watch out if you are a heavy user of ...


1

(add-to-list 'flycheck-disabled-checkers 'haskell-stack-ghc) The first argument to add-to-list is the name (more precisely the symbol) of the variable to modify. The second argument is the element (here again a symbol) to add. Both symbols need to be quoted since you need to pass the symbol itself to the function and not the value that the variable is bound ...


1

This was frustrating me too :| It's got to do with how Flycheck searches for the stack.yaml file. It's being fixed on Flycheck: https://github.com/flycheck/flycheck/issues/1291 https://github.com/flycheck/flycheck/pull/1292


1

I would like to change the color of the doc-comments only for Haskell, not globally. You can combine the buffer-local effects of Face Remapping with a mode hook to achieve this. For example, in order to display Haddock comments with the same face as plain comments, you can write something like (add-hook 'haskell-mode-hook (lambda () (...


1

Spacemacs already have the Haskell layer. This layer has the following dependencies: apply-refact (required by hlint-refactor) hlint (required by hlint-refactor) stylish-haskell (optional for haskell-mode) hasktags (optional) hoogle (optional for haskell-mode and helm-hoogle) ghc-mod (optional for completion) intero (optional for completion) You can ...


1

I use intero for programming Haskell in Emacs. It has superior stack support. Check it out at its homepage.


1

Here's what happens, for those of you who write and hack on packages: Emacs tries balancing the customization abilities and expressiveness of its extension language. This is why defvar (and by extension, defcustom) behaves in a somewhat surprising way. Consider this: (defvar foo 42) ; define foo with 42 as value (setq foo 13) ; set foo to 13 Nothing ...


1

If you want to have the ELPA packages activated already when the init script runs, you should call (package-initialize) first.


1

I found the answer in this Stackoverflow post. Adding the following to your init file avoids the issue: ;; Avoid extra TAB indents when pasting or auto-generating code (electric-indent-mode 0)


1

You can also set an OS X-wide default path by for example saving a property list like this as ~/Library/LaunchAgents/my.startup.plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key>...


1

This was an upstream bug that has been fixed in the meantime.


Only top voted, non community-wiki answers of a minimum length are eligible