Questions tagged [ghc-mod]

ghc-mod is a command to enrich Haskell programming on editors

ghc-mod is both an executable and a Haskell library. It is used to provide warnings, errors and type information in the context of Haskell programming. The official description is as follows:

Happy Haskell Programming

The ghc-mod command and ghc-modi command are backend commands to enrich Haskell programming on editors including Emacs, Vim, and Sublime. ghc-mod and ghc-modi are based on the ghc-mod library which is a wrapper of GHC API and Cabal.

ghc-mod gets used in vim, emacs, Sublime Text, and other editors.

See also:

External resources

57 questions
141
votes
2 answers

Does GHC-mod have to use full names for types?

I'm trying to use the ghc-mod vim plugin to do type/syntax checking etc. However, I found that ghc-mod always uses full paths of types in the error messages, for example: test.hs|71 col 13 error| Couldn't match type ‘Data.Text.Internal.Text’ …
xzhu
  • 5,675
  • 4
  • 32
  • 52
9
votes
1 answer

IntelliJ Haskell plugin: ghc-modi failed with error

I just installed IntelliJ idea and the official Haskell plugin. IntelliJ couldn't find ghc-modi.exe, so I installed ghc-mod through cabal. However, after importing my cabal project, I am still receiving the following error: ghc-modi failed with…
Schiavini
  • 2,869
  • 2
  • 23
  • 49
8
votes
2 answers

vim: call function on save

I am using ghc-mod in vim and would like GhcModCheck (:GhcModCheck) to be called every time I save a file (:w). Could you please tell me how I can achieve that? I guess there's a more general question: how can I invoke a function on save? Thank you!
denys.fridman
  • 165
  • 2
  • 7
8
votes
1 answer

ghc-mod only shows first line in *GHC info*

I am using emacs (24.3.1) in haskell-mode together with ghc-mod to play with Haskell. Now everything works fine aside from one annoying thing: Every output in the GHC info buffer contains only the first line. For example when I ask for ghc-show-info…
Random Dev
  • 51,810
  • 9
  • 92
  • 119
7
votes
3 answers

stack install ghc-mod fails with dependencies conflicts on OSX 10.13.4

When I try to install ghc-mod via stack I end up having these depencies conflicts Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for ghc-mod-5.8.0.0: Cabal-2.0.1.1 from stack…
Mo Hajr
  • 1,253
  • 1
  • 15
  • 31
7
votes
2 answers

Cannot install ghc-mod due to 'happy' cannot be installed?

On Mac OS X, I'm not able to install ghc-mod due to that a dependency called 'happy' cannot be installed: bash> cabal install ghc-mod Resolving…
qazwsx
  • 25,536
  • 30
  • 72
  • 106
7
votes
1 answer

GHC-mod looking for settings file in wrong directory

I use a number of Haskell plugins in my editor (Neovim), one of which is ghcmod-vim, which works together with syntastic to provide syntax checking as I write Haskell code. At one point, I had installed GHC for Mac OS X as a temporary workaround for…
Jules
  • 14,200
  • 13
  • 56
  • 101
7
votes
3 answers

How can I use `cabal repl` instead of `ghci` in `ghc-mod`?

I want to use cabal repl to instead of ghci (. My goal is being able to use other modules in my project ).
AmirHossein
  • 1,310
  • 1
  • 12
  • 19
5
votes
0 answers

cannot install ghc-mod locally

I have ghc 8.2.1 installed on my MacOS. But my global ghc-mod is still using 8.0.2, as I recently upgrade ghc to 8.2.1. I wanted to upgrade ghc-mod. I tried the following command, it returned errors as below: ▸ ghc --version The Glorious Glasgow…
Leo Zhang
  • 3,040
  • 3
  • 24
  • 38
4
votes
0 answers

How to install ghc-mod using cabal

I am trying to install ghc-mod. Running MacOS Mojave 10.14.1. Right now, when running cabal install ghc-mod I get: clang: warning: argument unused during compilation: '- nopie' [-Wunused-command-line-argument] Resolving dependencies... cabal: Could…
Schluhm
  • 41
  • 3
4
votes
1 answer

Haskell ghc-mod fails with error

I've had nothing but trouble using cabal, not sure if it's due to a lack of understanding, or a faulty mental model, but things have been tough. At the moment I'm just trying to get ghc-mod to work for my vim plugins. It usually works for a day or…
Chris Penner
  • 1,881
  • 11
  • 15
4
votes
1 answer

ghc-mod: After update, `cannot satisfy -package-id base-4.8.2.0`

So, an apt-get update in Ubuntu updated my GHC-version to 7.10.3 from this repository. After this update, everything broke, so I switched to 7.10.2, from that same repository. Almost everything is working now, except for ghc-mod, which when run,…
jmite
  • 8,171
  • 6
  • 40
  • 81
4
votes
1 answer

Is there a way to use Djinn to auto-generate Haskell code in Emacs?

Title pretty much says it all. I'm looking for something like this: f :: Int -> Bool -> Int f = _body Djinn can use theorem proving to generate code for such a function by proving that the type is inhabited. I'm wondering, is there an existing way…
jmite
  • 8,171
  • 6
  • 40
  • 81
4
votes
1 answer

ghc-mod does not use my cabal sandbox. why?

runghc -package-db=.cabal-sandbox/.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d hellowai.hs Works perfect for me. Similarly, with ghci -package-db=.cabal-sandbox/.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d I am also able to import…
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
4
votes
2 answers

ide-haskell for atom editor isn't working

I'm trying to use the Ide-Haskell package for atom, but for some reason, it's not working. First, I have ghc-mod and stylish haskell installed in sandboxes under ~/lib/. Here is what my config.cson file looks like: athan@THETA ~> cat…
Athan Clark
  • 3,886
  • 2
  • 21
  • 39
1
2 3 4