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
3
votes
2 answers

Can not install GHC-Mod

Hello guys i am trying to install ghc-mod for vscode and i am running into this issue: **$ stack install ghc-mod** Populated index cache. Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for…
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
3
votes
0 answers

Using stack, ghc-mod and NixOS all together

I'm having some trouble getting all these tools to work together, and I would be interested to hear if someone has managed. My main problem is the following: I have some external dependencies, which in my stack.yaml look like this: nix: enable:…
Sam van Herwaarden
  • 2,321
  • 14
  • 27
3
votes
0 answers

haskell's autocompletion in vim

I went through tutorials about how to create vim environment with autocomplete words and functions from other modules. And it's fine until I'll change something in my previously created modules. In other files those changes are invisible and vim…
Tunga
  • 93
  • 4
3
votes
0 answers

Get the full type signature using ghc-mod (M-x ghc-show-type)

Consider Foo.hs: module Foo where foo :: Num t => t foo = 3 running ghc-mod -type on it like this only gives me the type t for the signature of foo, even though the declaration already has the full type signature attached to it: $ ghc-mod type…
Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
3
votes
0 answers

View core for a snippet of code

Is there a way to get -ddump-simpl-like dump in repl/editor for a code snippet (or at least for a top-level function)? Assuming everything is accesible for ghci/ghc-mod to load an run.
wiz
  • 499
  • 4
  • 17
3
votes
1 answer

Missing ghc-mod packages in stack project

I recently broke something in my setup (probably stack upgrade) and found I cannot get it working again: ghc-mod: : cannot satisfy -package-id http-types-0.8.6-6a9e3ae2218aaee5f093c4f68fa256c5 $ stack list-dependencies | grep…
sevo
  • 4,559
  • 1
  • 15
  • 31
3
votes
1 answer

Emacs stuck on infinite loop when trying to use ghc-mod

I've been trying to learn Haskell the last couple of days so it was finally time to setup my environment. Thus, I installed Haskell Platform and cabal. My editor is emacs and my OS is Windows. I downloaded the ghc-mod's master branch from github and…
TheCrafter
  • 1,909
  • 2
  • 23
  • 44
3
votes
1 answer

Why does ghci not use relative paths?

If I have a project structured like this: project/ src/ Foo.hs Bar.hs With files Foo.hs: module Foo where foo :: String foo = "foo" and Bar.hs: module Bar where import Foo bar :: String bar = foo ++ "bar" If my current directory…
Ramith Jayatilleka
  • 2,132
  • 16
  • 25
3
votes
1 answer

ghc-mod expecting MonadBaseControl to have `StM` associated newtype instead of `StT` associated type

I'm getting this error from installing the latest ghc-mod (5.2.1.1) from Hackage in a sandbox: [15 of 38] Compiling Language.Haskell.GhcMod.CabalConfig ( Language/Haskell/GhcMod/CabalConfig.hs,…
Athan Clark
  • 3,886
  • 2
  • 21
  • 39
3
votes
2 answers

Why does "cabal init" break "ghc-mod check"?

ghc-mod works in a directory with just a haskell source file but if I run "cabal init" in that directory (/tmp/test), I get the following error: (p1)dave@peach:/tmp/test$ !ghc ghc-mod check Main.hs ghc-mod: /tmp/test/dist/setup-config:…
Dave Compton
  • 1,421
  • 1
  • 11
  • 18
3
votes
1 answer

How to make the debug function of haskell-idea-plugin work properly

I installed haskell-idea-plugin to make a Haskell IDE. The plugin can do the following things as claimed on https://github.com/Atsky/haskell-idea-plugin. Haskell syntax highlight Cabal syntax highlight Error checking with ghc-modi. Simple…
TorosFanny
  • 1,702
  • 1
  • 16
  • 25
3
votes
0 answers

Turn off warning highlight in ghc-mod

How can I turn off the highlights for warnings in ghc-mod? More specifically, I'd like to be able to toggle the warnings by warning type.
András Kovács
  • 29,931
  • 3
  • 53
  • 99
2
votes
1 answer

Cabal can't install ghc-mod

I'm trying to install ghc-mod to use with Atom-Haskell (the ide-haskell package) in Atom, but for some reason my Cabal doesn't want to. When I enter the command cabal install ghc-mod, I get the following errors in my terminal: Resolving…
Sophie
  • 31
  • 1
  • 3
2
votes
1 answer

Installing specific versions via stack

So I suppose the problem I'm really trying to solve is that when I run ghc-mod I get this error: CabalHelper/Licenses.hs|53 col 18 error| error: Ambiguous occurrence ‘lookupInstalledPackageId’ I found this relevant…
Chris Penner
  • 1,881
  • 11
  • 15
2
votes
1 answer

Haskell Stack: installed packages are not visible

I installed package with stack install but I cannot import the package unless I use stack ghc or stack ghci ... The problem is I have installed atom haskell ide, that uses ghc-mod backend, which also doesn't see packages installed by stack!
Ford O.
  • 1,394
  • 8
  • 25