Skip to content

Instantly share code, notes, and snippets.

@DarinM223
Created January 27, 2018 13:29
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DarinM223/b375a1be3fb9381a76f748f085cb1c8e to your computer and use it in GitHub Desktop.
Save DarinM223/b375a1be3fb9381a76f748f085cb1c8e to your computer and use it in GitHub Desktop.
Installing GHC Mod

Installing GHC Mod

  1. Go to ~/.stack/global-project/stack.yaml and change the resolver: section to lts-10.3.

  2. Add:

- https://hackage.haskell.org/package/ghc-mod-5.9.0.0/candidate/ghc-mod-5.9.0.0.tar.gz
- cabal-helper-0.8.0.0
- extra-1.5.3
- monad-journal-0.7.2
- optparse-applicative-0.13.2.0
- either-4.4.1.1

to the extra-deps: section of the stack.yaml file.

  1. Run stack build ghc-mod
  2. Run stack install ghc-mod
  3. Make sure ~/.local/bin is in your path.
  4. Run ghc-mod version to verify the version of ghc-mod. If it still shows an older version, then look into other paths like ~/.cabal/bin that might overlap with the installed ghc-mod and remove the conflicting ghc-mod binary.
@bucketsize
Copy link

bucketsize commented Nov 4, 2020

The ghc-mod exec gets installed in a stack masked location and is only accessible via stack exec -- ghc-mod.

Ex:
ghc-mod > Installing executable ghc-mod in /mnt/f1aa/home/jb/.stack/snapshots/x86_64-linux-tinfo6/5eeb9fd020d42f87f773a9099a02c1dfbad876eb385e8ab34ae25f1820910130/8.2.2/bin
ghc-mod > Registering library for ghc-mod-5.9.0.0..
Completed 98 action(s).
...

$ stack exec -- ghc-mod
Missing: COMMAND

Usage: ghc-mod [-v] ([--verbose LEVEL] | [-s|--silent]) [-l|--tolisp]
[-b|--boundary|--line-separator SEP] [--line-prefix OUT,ERR]
[--with-ghc ARG] [--with-ghc-pkg ARG] [--with-cabal ARG]
[--with-stack ARG] [-g|--ghc-option|--ghcOpt OPT]
[--map-file MAPPING] [--encoding ARG] [--stack-build-deps]
COMMAND [--version]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment