haskellghchaskell-stackhaskell-platform

Stack always downloads ghc even though it is in path


I want to use Haskell on my computer currently running Windows 10 build 1803, and I am using a broadband connection of 25 Mbps. As of 2018, the Haskell compiler version known as ghc is 8.4.3.

First I download the stack from www.haskellstack.org/ The download is pretty fast since the file is small.

Upon installing stack and updating the stack to its path, I download ghc. The download is extremely slow. After downloading a mere 2.40 or 1.32 MB's it becomes still and after 30 minutes or so, it shows a socket connection error. I copied the error and searched for it in Stack Overflow, but it seemed futile.

As a solution to this, I uninstalled the sole version of stack and installed the Haskell platform which came bundled with ghc and other features along with Cabal and Stack. However upon starting a project using stack, it does not detect the ghc compiler and automatically tries to download the ghc version 8.4.3. Please note that I have added ghc to the path because whenever I type ghc in command line, it gives me the Haskell terminal, and also I have checked the environment variables.

No matter what I do I cannot let stack detect the ghc already coming from Haskell platform and prevent it from automatically downloading its own version of ghc, prior to which it gets stuck at 0.66% forever.

I am from India. Is the server providing the ghc through stack have no support in my country? Or is there any way out! I seemingly cannot install any Haskell packages, for my Haskell project!

enter image description here


Solution

  • You can try adding a mirror to speed it up, take a look at TsingHua stackage mirror.

    Reference:

    A set of useful alternative package index mirrors?

    use alternative mirror with stack 2.1.1