Skip to content

Is it possible to use ghci-ng with "stack-ghci" haskell-process-type? #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rrnewton opened this issue Sep 20, 2015 · 7 comments
Closed

Comments

@rrnewton
Copy link
Member

I'm trying to get the :type-at based haskell-process-do-type working with stack based projects.

@geraldus
Copy link
Contributor

I'm missing this feature too!

@gracjan
Copy link
Contributor

gracjan commented Sep 20, 2015

I do not see a fundamental problem why this should not work. What does *haskell-process-log* say?

@rrnewton
Copy link
Member Author

Well, I can see that *haskell-process-log* says haskell-mode is calling stack ghci.

But, based on stack ghci --help, I don't see any way to change the ghci implementation to use ghci-ng. It does have a --with-ghc option, but stack ghci --with-ghc=ghci-ng is bogus because ghci-ng isn't a full command line replacement for ghc.

@gracjan
Copy link
Contributor

gracjan commented Sep 20, 2015 via email

@chrisdone
Copy link
Member

with-ghc is the proper flag, it's just poorly named. I copied this name from cabal-repl. See comment here: commercialhaskell/stack#1024 (comment)

I noticed recently that stack-ghci was added as a supported REPL type, so probably there can be a variable for specifying extra args like in the GHCi case, or otherwise use the wrapper. E.g.

(setq haskell-process-wrapper-function
                    (lambda (args)
                       (append args (list "--with-ghc" "ghci-ng"))))

@rrnewton
Copy link
Member Author

Wow, great, that works.

In this case I had to modify haskell-process-args-stack-ghci to include the --with-ghc option, but now I'm in Haskell IDE paradise being able to use both stack and errors right in my editor buffer...

@da-x
Copy link
Contributor

da-x commented Dec 26, 2015

The version of ghci-ng needs to match the version of GHC, and when you have both 7.10.3 and 7.10.2 as compilers under .stack, then ghci-ng can't just sit in the ~/local/.bin, it needs to sit as two different compiled versions, under ~/.stack/programs/x86_64-linux/ghc-7.10.2/bin and ~/.stack/programs/x86_64-linux/ghc-7.10.3/bin.

My question is, would it our work out of the box for haskell-mode, or do we need to do something else? Where's the best place to put the ghci-ng exe therefore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants