Recently Installed VS Code in my Ubuntu14.04 . Installed Haskell using Stack.
Getting these errors. Kindly help.
Error: Couldn't start ghc-mod process Error: Command failed: ghc-mod version
Error: Cannot hlint the haskell file. The hlint program was not found. Use the 'haskell.hlint.executablePath' setting to configure the location of 'hlint'
It looks like you've installed 2 extensions for vscode, one for linting and one for running ghc-mod, but you don't have hlint or ghc-mod installed.
If you are using this ghc-mod extension, make sure you have ghc-mod installed through cabal or through stack.
IF you are using this linter extension, make sure you have hlint installed through cabal or through stack.
To install with cabal, run:
cabal install hlint
and
cabal install ghc-mod
To install via stack, see the stack documentation.
Related
I'm new to Haskell, and have found the :type command in the ghci REPL to be really useful for interactively figuring out how things work. So far I've only used things from the base package, but now I'd like to use something from distributive with the :type command in the REPL.
How in the world do I do this? If it matters, I'm on macOS and have done brew install ghc cabal-install. But nothing I've tried will either install or import the distributive package, and the error messages are not very good. I've found lots of related questions and documentation, but nothing shows a worked example, and I'm unable to infer what commands to use.
I eventually figured this out. The missing pieces were needing to first update cabal (even though I had just installed it), and to use --lib as an argument when installing:
brew install ghc cabal-install
cabal update
cabal install --lib distributive
ghci
import Data.Distributive
I have both ghci versions 7.10 and 8 installed on my Ubuntu 16.04. I want to install something based on cabal. I already have cabal installed as the command
cabal --version
yields
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
But when I go to update with
cabal update
I get
Downloading the latest package list from hackage.haskell.org
cabal: does not exist
So I am not sure what is going on or how to resolve this. I hope to afterwards install gloss which is based on cabal. But
cabal install gloss-examples
yields
Resolving dependencies...
Downloading bindings-DSL-1.0.23...
Downloading bmp-1.2.6.3...
Failed to install bmp-1.2.6.3
Downloading vector-0.10.12.3...
Build log ( /home/username/.cabal/logs/bmp-1.2.6.3.log ):
cabal: /home/username/.cabal/logs/bmp-1.2.6.3.log: does not exist
EDIT: I originally installed ghci 7.10. Then later installed ghci 8. Could this have any effect?
EDIT2: After installing
cabal install Cabal cabal-install
I still get the same error with
cabal update
Also I still cannot
cabal install gloss-examples
But I get a different error this time
Resolving dependencies...
Downloading bindings-DSL-1.0.23...
Downloading bmp-1.2.6.3...
Failed to install bindings-DSL-1.0.23
Downloading vector-0.10.12.3...
Build log ( /home/aa/.cabal/logs/bindings-DSL-1.0.23.log ):
cabal: /home/aa/.cabal/logs/bindings-DSL-1.0.23.log: does not exist
EDIT3: When I installed Cabal, it says that I installed
Installed cabal-install-1.24.0.2
But when I check with
cabal --version
I am still stuck at
cabal-install version 1.22.6.0
which tells me somehow they are not linked.
After cabal install random, I try ghc-mod list but it still doesn't see the package.
cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library
ghc-mod --version
ghc-mod version 5.5.0.0 compiled by GHC 7.10.3
I have now also tried adding random-1.1 to my global stack.yaml (trying to make a simple script here...) and installed via stack install random to no avail.
My file seems to run fine with runhaskell though.
When you type stack install random, and then run stack ghci or install with stack, the import succeeds
> import System.Random --succeeds
If you run ghc outside of stack, it won't necessarily use the same setup.
To include Cabal dependencies I run cabal install mypackage
I then run cabal repl and from REPL use import library
This allows to use newly added library from GHCi.
Is same possible using WinGhci ? Run a WinGhci REPL which has access to installed Cabal dependencies ?
You can use :! to execute shell commands. I.e. run :!cabal install mypackage from within the WinGHCi repl. But then you can't import mypackage until you restart WinGHCi. That's my experience at least. I'm interested in an answer as well...
Running :!cabal repl inside WinGHCi repl is just not sensible (which answers the title to your question literally).
This error message failing my installation of haskell-src-exts-1.15.0.1
ld: library not found for -lHScpphs-1.18.5-ghc7.8.2
So I guess my cpphs is missing. When I tried to install cpphs, however
$ cabal install cpphs
Resolving dependencies...
All the requested packages are already installed:
cpphs-1.18.5
Use --reinstall if you want to reinstall anyway.
The similar error happens for text-1.1.1.3.
I have tried erasing everything and reinstalling haskell-platform but it doesnt work.
I use haskell-platform installed from homebrew, but I had already had the latest version of cabal and ghc
λ ~/cabal --version
cabal-install version 1.20.0.3
using version 1.20.0.1 of the Cabal library
λ ~/ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.2
find ing the *.dylib gives no result.