0

I am new to haskell and want to deploy haskell on vs code. When I try to install ghc-mod by using "stack install ghc-mod --resolver lts-8.24". The action fails. If anyone could help me, it would be so appreciated! The erro log is as follow:

happy           >      warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
happy           >
happy           > /Users/a2/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/include/rts/storage/ClosureMacros.h:503:56: error:
happy           >      note: expanded from macro 'ZERO_SLOP_FOR_SANITY_CHECK'
happy           > #define ZERO_SLOP_FOR_SANITY_CHECK (defined(DEBUG) && !defined(THREADED_RTS))
happy           >                                                        ^
happy           > 9 warnings generated.
happy           > clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
happy           > copy/register
happy           > Installing executable(s) in
happy           > /Users/a2/.stack/snapshots/x86_64-osx/e87c8df95ec9518f8408232a2e3513d766cdb2d97a442d1257a73460a8d14994/8.0.2/bin

--  While building package profunctors-5.2 using:
      /Users/a2/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options ""
    Process exited with code: ExitFailure 1
Erick li
  • 1
  • 1

1 Answers1

0

If you just want to get haskell working on vscode, then I found ghcide to work very well.

https://github.com/digital-asset/ghcide

Check it out to a local directory, and modify the stack.yaml that comes with it so that it has the same resolver as the project that you want to work with.

e.g. change this line:

resolver: nightly-2019-09-21

to:

resolver: lts-14.12

Then install it using: (make a note of where it puts the executable)

stack install

Finally, open vscode and add the ghcide extension and point it to your ghcide executable in the configuration.

torrlane
  • 23
  • 1