snoyberg / classy-prelude

A typeclass-based Prelude.
108 stars 15 forks source link

Failed to install: Not in scope: `HashMap.mapWithKey' #106

Closed baharev closed 9 years ago

baharev commented 9 years ago
$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library 

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

$ uname -rv 
3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015

$ lsb_release -a 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:        14.04
Codename:       trusty

$ cabal install classy-prelude 
Resolving dependencies...
Configuring keys-3.10.2...
Building keys-3.10.2...
Preprocessing library keys-3.10.2...
[1 of 1] Compiling Data.Key         ( src/Data/Key.hs, dist/build/Data/Key.o )

src/Data/Key.hs:856:16:
    Not in scope: `HashMap.mapWithKey'
    Perhaps you meant one of these:
      `IntMap.mapWithKey' (imported from Data.IntMap),
      `Map.mapWithKey' (imported from Data.Map),
      `HashMap.foldrWithKey' (imported from Data.HashMap.Lazy)
Failed to install keys-3.10.2
cabal: Error: some packages failed to install:
chunked-data-0.2.0 depends on keys-3.10.2 which failed to install.
classy-prelude-0.10.4 depends on keys-3.10.2 which failed to install.
keys-3.10.2 failed during the building phase. The exception was:
ExitFailure 1
mono-traversable-0.9.2.1 depends on keys-3.10.2 which failed to install.
vector-instances-3.3.0.1 depends on keys-3.10.2 which failed to install.

I would like to install classy-prelude. Any help is greatly appreciated.

snoyberg commented 9 years ago

I'm guessing you have an older version of GHC installed from the Ubuntu repos, possibly even the Haskell Platform. I'd recommend that, in order to get the smoothest experience, you use Stackage's installation instructions. In fact, these days, my best recommendation is to just use stack (which is in fact Stackage' primary recommendation).

https://github.com/commercialhaskell/stack#readme

That will ensure that you have a coherent set of packages. Note that stack is capable of downloading the new version of GHC and installing it for you.

baharev commented 9 years ago

Thanks! Yes, if you read my post, you will see that I was using GHC 7.6.3. I thought the package manager would pick up the correct package version for me.

Anyway, I have installed stack, bumped into stumbling blocks, but I have finally managed to get my code to compile. I will most likely post a bunch of questions to the mailing list about the difficulties that I have encountered.

So problem solved, thank you very much for your help!