Questions tagged [haskell-mode]
a major-mode for editing code written in the Haskell programming language.
36 questions
0
votes
0
answers
17
views
getting jit-lock to consider more context (seems error-prone in haskell-mode)
I'm writing Haskell code using haskell-mode. Normally it does a good job of fontifying the buffer. However, there is one particular construct it does not handle well.
If I have a Haskell function ...
0
votes
0
answers
52
views
outline-minor-mode works for Haskell but not Python
I can use outline-minor-mode to fold Haddock-style headings in Haskell code. For instance, consider the following file:
-- (haskell-mode)
-- (outline-minor-mode)
-- (setq-local outline-regexp "-- ...
1
vote
2
answers
689
views
haskell-mode not able to find GHC installation
I installed haskell-mode and I want to launch the REPL GHCi with the command C-c C-z.
However, on typing C-c C-z, it shows error Could not find any installation of GHC.
And when I use same command ...
0
votes
0
answers
320
views
Emacs hangs on org-babel-execute-src-block for Haskell blocks
I have a minimal org file with a Haskell code block:
#+begin_src haskell
putStrLn "Hello World"
#+end_src
When I do M-x org-babel-execute-src-block, Emacs hangs with minibuffer saying: ...
1
vote
1
answer
2k
views
Haskell-mode in Doom emacs returns: 'Error running hook "lsp!" because (invalid-function lsp!)'
I am running Xmonad window manager together with Xmobar on ArchLinux 5.14.12-arch1-1. I have ghc, cabal, and stack installed. Suddenly Doom has started having a problem with Haskell files and is ...
1
vote
0
answers
149
views
Why does lsp-haskell format some projects and not others?
This is the message I get when I use lsp to format the current project:
lsp-request: No plugin enabled for STextDocumentFormatting, available: []
And then on another project:
LSP :: Applying 22 edits ...
2
votes
1
answer
764
views
How to Use Stack's GHCI when in Haskell Interactive Mode
I'm trying to maintain all of my package dependencies through Stack. However, when trying to use Haskell's Interactive Mode in Emacs, through haskell-mode, it won't find GHCI anymore, since it is only ...
0
votes
1
answer
638
views
File mode specification error: (void-variable lsp-csharp--action-client-find-references)
I'm using doom emacs.
my ~/.doom.d/config.el is -
(use-package! lsp-mode
:hook
(haskell-mode . lsp)
:commands
lsp)
(use-package! lsp-ui
:commands
lsp-ui-mode)
(use-package! lsp-haskell
:after ...
0
votes
0
answers
69
views
interactive-haskell-mode: Format specifier doesn't match argument type
Pressing C-c C-l (for a simple "Hello, world!" script) in interactive-haskell-mode gives me the error message
Format specifier doesn't match argument type
whereas I would have expected the ...
0
votes
1
answer
55
views
Emacs keeps overwriting files in Haskell mode
I'm using emacs:
GNU Emacs 26.3
Copyright (C) 2019 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU ...
2
votes
2
answers
261
views
How to disable stack with flycheck for Haskell?
I'm on nixos and due to stack's integration with Nix/Nixos the following command is very slow:
time stack ghc
ghc: no input files
Usage: For basic information, try the `--help' option.
stack ghc 1....
0
votes
0
answers
57
views
Retouching syntax highlight of major mode
I am writing a minor mode to complement haskell-mode,
and I am trying to color subwords in camelCased identifiers with slightly different shades of the same color.
Perhaps this can be done by "...
0
votes
2
answers
624
views
How to get flycheck to do a syntax check immediately after opening a file?
I can't get flycheck to do its thing immediately after opening a file.
It will check/find errors if I save the file.
And it will check/find errors if I execute the M-x flycheck-mode command twice (i.e....
3
votes
1
answer
360
views
Haskell code execution in Org-mode give error but in .hs file the code is good and working
i have this code:
qs [] = []
qs [x] = [x]
qs (x:xs) = qs [a | a <- xs, a < x] ++ [x] ++ qs [b | b <- xs, b >= x]
when i save it to some file .hs and load it to ghci i can execute ...
0
votes
0
answers
48
views
Haskell-mode-hook help window keeps opening
I installed haskell-mode, but every time I press RET or TAB on a Haskell file it keeps opening that window
Any idea on how to deactivate this ?
2
votes
2
answers
1k
views
How do I enable hlint for haskell linting?
I am trying to select hlint and use it as the default for haskell-mode. I recall accidentally finding the option for this once, but haven't been able to find it again.
I am new to Emacs and do not ...
1
vote
0
answers
119
views
How to set Haskell indentation with Prelude
I'm using Prelude and Haskell mode and trying to set the indentation. The default indentation gives me the following:
main = do
contents <- getContents
print (sumFile contents)
where sumFile ...
0
votes
1
answer
865
views
Recent problems with Haskell mode
I just downloaded a fresh installation of the Haskell platform on Mac El Capitàn:
brew cask install haskell-platform
and a fresh installation of the Haskell layer for spacemacs:
dotspacemacs-...
4
votes
1
answer
1k
views
how to get correct indentation after pressing 'o' in haskell-mode using evil-mode in spacemacs
When using haskell-mode (the Haskell layer) with evil-mode keybindings in spacemacs, the indentation created by pressing the o key is often incorrect.
For instance, imagine I want to write the ...
1
vote
1
answer
78
views
Flycheck-Haskell - "Opening Directory" "Not a directory"
I'm trying to get flycheck working in Haskell, however, when I try to do anything to do with flycheck, even running stuff like flycheck-verify-setup, I get an error "Not a directory".
Does anyone ...
0
votes
0
answers
75
views
Inline variable in Haskell
Is there any way to inline a top-level definition or let binding in Haskell? I can't find any built-in solutions in vanilla haskell mode, HaRe, or Intero.
1
vote
0
answers
469
views
Format Haskell type signatures to be multi-line
I want to have the following functionality on a save hook.
Given a buffer that has type signatures like this…
add :: Integer -> Integer -> Integer
add x y = x + y
…I want to have them ...
2
votes
1
answer
2k
views
Clear ghci screen of haskell-mode
I want to clear the ghci screen of the haskell-mode,
I used erase-buffer in emacs shell, and I works, but when I do so with ghci inside emacs, This message appears:
Text is read-only
2
votes
2
answers
4k
views
How to configure spacemacs to work correctly with haskell Stack?
The Haskell stack build doesn't install ghc to the system, only for itself, and using spacemacs without a systemwide configured ghc have been a painful experience (to me).
My question is, there is a ...
3
votes
1
answer
451
views
`haskell-mode-hook` is nil?
The haskell-mode-hook customizable variable in haskell-mode has a default value of (haskell-indentation-mode interactive-haskell-mode).
Yet, after starting Emacs, its value is nil; the "original ...
1
vote
1
answer
513
views
Symbol documentation and implementation code in haskell-mode
I'm learning Haskell. One of first steps was to make pleasant development environment. I've already found haskell-mode, intero and some more useful packages but I miss offline/online documentation for ...
2
votes
2
answers
535
views
Customize haddock comments color
How can I change the color of the comments starting with -- | in Haskell mode?
When I write a comment in Haskell I get a grey face, but when the comment starts with -- |, as required by Haddock ...
8
votes
2
answers
1k
views
No "full service" Haskell org mode?
I'm guessing that since Haskell's ghci is not a full-fledged REPL, you can't really use it for defining functions in orgmode source blocks, i.e.,
#+begin_src haskell
doubleMe x = x + x
#+end_src
...
1
vote
2
answers
830
views
Error with company-mode, using Haskell
I installed haskell-mode, and I follow this tutorial to install company here.
But it only ran once; now when I launch Emacs I get this error:
Warning (initialization): An error occurred while loading ...
3
votes
1
answer
2k
views
haskell-mode emacs not finding modules when using stack
Haskell mode doesn't seem to be resolving the modules in emacs when I use the stack command to build my project.
Is there a file that I have to edit to tell haskell-mode where to find the packages ...
1
vote
0
answers
107
views
ghc-mod template generation (M-t) not working
I've been following this Emacs+Haskell tutorial and I'm going through the Insertion Commands section.
With Emacs 24.4.1, GHC 7.10.1 and ghc-mod master build, I've managed to get C-u M-t to work, so ...
1
vote
1
answer
220
views
Avoid extra tabs when generating Haskell code with ghc-mod
I'm following the Haskell Emacs Tutorial here and Emacs is annoying me with the way it adds some extra TAB characters. E.g.
When I have this code:
data ExampleType = ExampleType Int Int
instance Eq ...
27
votes
7
answers
23k
views
Emacs and command line $PATH disagreements on OSX
Having some issues with PATH settings on Emacs that are affecting my Haskell environment:
I'm using ZSH, and when I go to the command line and call echo $PATH, it returns: /Users/g/Library/Haskell/...
1
vote
1
answer
65
views
Install haskell-mode failed via el-get-install
el-get manage my other packages properly and easily, so I tried to install haskell-mode by el-get-install; however, it failed:
sed -e 's/@@GIT_VERSION@@/13.10-301-g6e48791/g;s/@GIT_VERSION@/13.10-301-...
4
votes
1
answer
3k
views
Haskell Interactive Mode Setup - cabal unrecognised command: repl
I'm trying to set up haskell-mode following this instructions
[0] https://github.com/haskell/haskell-mode/wiki/Haskell-Interactive-Mode-Setup
[1] http://tim.dysinger.net/posts/2014-02-18-haskell-...
4
votes
1
answer
338
views
Add more symbols to haskell `haskell-font-lock-symbols-alist`
I'm trying to add more symbols to haskell-mode's haskell-font-lock.
The documentation for haskell-font-lock-symbols-alist says:
Alist mapping Haskell symbols to chars. Each element has the form
(...