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/...
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:
let doubleSmallNumber4 x = if x > 0
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:
qs  = 
qs [x] = [x]
qs (x:xs) = qs [a | a <- xs, a < ...
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:
On my system (Fedora 20) the default cabal version that comes with the haskell-platform package is 184.108.40.206. 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 ...
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 ...
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")))
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:
Per a comment on the issue in the haskell-mode repository, here is a temporary fix for the "o" ...
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"))...
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.
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:
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:...
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.
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 ...
(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 ...
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:
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
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)
hoogle (optional for haskell-mode and helm-hoogle)
ghc-mod (optional for completion)
intero (optional for completion)
You can ...
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
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">