haskell-unordered-containers / unordered-containers

Efficient hashing-based container types
BSD 3-Clause "New" or "Revised" License
221 stars 98 forks source link

Could not find module ‘Data.HashMap.Strict’ #290

Closed GeorgeCo closed 4 years ago

GeorgeCo commented 4 years ago

bash-3.2$ ghc-pkg list|fgrep unorder unordered-containers-0.2.11.0 bash-3.2$ ghc spell.hs Loaded package environment from /Users/gcolpitts/.ghc/x86_64-darwin-8.10.1/environments/default [1 of 1] Compiling Main ( spell.hs, spell.o )

spell.hs:9:1: error: Could not find module ‘Data.HashMap.Strict’ Perhaps you meant Data.IntMap.Strict (from containers-0.6.2.1) Data.Map.Strict (from containers-0.6.2.1) Use -v (or :set -v in ghci) to see a list of the files searched for. | 9 | import qualified Data.HashMap.Strict as M | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bash-3.2$ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.10.1 bash-3.2$ cabal --version cabal-install version 3.2.0.0 compiled using version 3.2.0.0 of the Cabal library bash-3.2$ uname -a Darwin macMini-2018.local 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64 bash-3.2$ ghc -v spell.hs Glasgow Haskell Compiler, Version 8.10.1, stage 2 booted by GHC version 8.6.5 initializing package database: Loaded package environment from /Users/gcolpitts/.ghc/x86_64-darwin-8.10.1/environments/default Using binary package database: /usr/local/lib/ghc-8.10.1/package.conf.d/package.cache Using binary package database: /Users/gcolpitts/.cabal/store/ghc-8.10.1/package.db/package.cache package flags [-package-id ghc-8.10.1{unit ghc-8.10.1 True ([])}, -package-id bytestring-0.10.10.0{unit bytestring-0.10.10.0 True ([])}, -package-id unix-2.7.2.2{unit unix-2.7.2.2 True ([])}, -package-id base-4.14.0.0{unit base-4.14.0.0 True ([])}, -package-id time-1.9.3{unit time-1.9.3 True ([])}, -package-id hpc-0.6.1.0{unit hpc-0.6.1.0 True ([])}, -package-id filepath-1.4.2.1{unit filepath-1.4.2.1 True ([])}, -package-id process-1.6.8.2{unit process-1.6.8.2 True ([])}, -package-id array-0.5.4.0{unit array-0.5.4.0 True ([])}, -package-id integer-gmp-1.0.3.0{unit integer-gmp-1.0.3.0 True ([])}, -package-id containers-0.6.2.1{unit containers-0.6.2.1 True ([])}, -package-id ghc-boot-8.10.1{unit ghc-boot-8.10.1 True ([])}, -package-id binary-0.8.8.0{unit binary-0.8.8.0 True ([])}, -package-id ghc-prim-0.6.1{unit ghc-prim-0.6.1 True ([])}, -package-id ghci-8.10.1{unit ghci-8.10.1 True ([])}, -package-id rts{unit rts True ([])}, -package-id terminfo-0.4.1.4{unit terminfo-0.4.1.4 True ([])}, -package-id transformers-0.5.6.2{unit transformers-0.5.6.2 True ([])}, -package-id deepseq-1.4.4.0{unit deepseq-1.4.4.0 True ([])}, -package-id ghc-boot-th-8.10.1{unit ghc-boot-th-8.10.1 True ([])}, -package-id pretty-1.1.3.6{unit pretty-1.1.3.6 True ([])}, -package-id template-haskell-2.16.0.0{unit template-haskell-2.16.0.0 True ([])}, -package-id directory-1.3.6.0{unit directory-1.3.6.0 True ([])}, -package-id text-1.2.3.2{unit text-1.2.3.2 True ([])}, -package-id Cabal-3.2.0.0{unit Cabal-3.2.0.0 True ([])}] loading package database /usr/local/lib/ghc-8.10.1/package.conf.d loading package database /Users/gcolpitts/.cabal/store/ghc-8.10.1/package.db wired-in package ghc-prim mapped to ghc-prim-0.6.1 wired-in package integer-wired-in mapped to integer-gmp-1.0.3.0 wired-in package base mapped to base-4.14.0.0 wired-in package rts mapped to rts wired-in package template-haskell mapped to template-haskell-2.16.0.0 wired-in package ghc mapped to ghc-8.10.1 !!! initializing package database: finished in 34.96 milliseconds, allocated 16.711 megabytes initializing package database: package flags [-package-id ghc-8.10.1{unit ghc-8.10.1 True ([])}, -package-id bytestring-0.10.10.0{unit bytestring-0.10.10.0 True ([])}, -package-id unix-2.7.2.2{unit unix-2.7.2.2 True ([])}, -package-id base-4.14.0.0{unit base-4.14.0.0 True ([])}, -package-id time-1.9.3{unit time-1.9.3 True ([])}, -package-id hpc-0.6.1.0{unit hpc-0.6.1.0 True ([])}, -package-id filepath-1.4.2.1{unit filepath-1.4.2.1 True ([])}, -package-id process-1.6.8.2{unit process-1.6.8.2 True ([])}, -package-id array-0.5.4.0{unit array-0.5.4.0 True ([])}, -package-id integer-gmp-1.0.3.0{unit integer-gmp-1.0.3.0 True ([])}, -package-id containers-0.6.2.1{unit containers-0.6.2.1 True ([])}, -package-id ghc-boot-8.10.1{unit ghc-boot-8.10.1 True ([])}, -package-id binary-0.8.8.0{unit binary-0.8.8.0 True ([])}, -package-id ghc-prim-0.6.1{unit ghc-prim-0.6.1 True ([])}, -package-id ghci-8.10.1{unit ghci-8.10.1 True ([])}, -package-id rts{unit rts-1.0 True ([])}, -package-id terminfo-0.4.1.4{unit terminfo-0.4.1.4 True ([])}, -package-id transformers-0.5.6.2{unit transformers-0.5.6.2 True ([])}, -package-id deepseq-1.4.4.0{unit deepseq-1.4.4.0 True ([])}, -package-id ghc-boot-th-8.10.1{unit ghc-boot-th-8.10.1 True ([])}, -package-id pretty-1.1.3.6{unit pretty-1.1.3.6 True ([])}, -package-id template-haskell-2.16.0.0{unit template-haskell-2.16.0.0 True ([])}, -package-id directory-1.3.6.0{unit directory-1.3.6.0 True ([])}, -package-id text-1.2.3.2{unit text-1.2.3.2 True ([])}, -package-id Cabal-3.2.0.0{unit Cabal-3.2.0.0 True ([])}] loading package database /usr/local/lib/ghc-8.10.1/package.conf.d loading package database /Users/gcolpitts/.cabal/store/ghc-8.10.1/package.db wired-in package ghc-prim mapped to ghc-prim-0.6.1 wired-in package integer-wired-in mapped to integer-gmp-1.0.3.0 wired-in package base mapped to base-4.14.0.0 wired-in package rts mapped to rts-1.0 wired-in package template-haskell mapped to template-haskell-2.16.0.0 wired-in package ghc mapped to ghc-8.10.1 !!! initializing package database: finished in 9.23 milliseconds, allocated 5.716 megabytes Chasing dependencies: Chasing modules from: spell.hs !!! Chasing dependencies: finished in 1.70 milliseconds, allocated 0.779 megabytes Stable obj: {} Stable BCO: {} Ready for upsweep [NONREC ModSummary { ms_hs_date = 2018-09-23 02:02:52 UTC ms_mod = Main, ms_textual_imps = [(Nothing, Prelude), (Nothing, Data.ByteString.Lazy.Char8), (Nothing, Data.HashMap.Strict), (Nothing, Data.List), (Nothing, Data.Char), (Nothing, Control.Monad)] ms_srcimps = [] }] ** Deleting temp files: Deleting: compile: input file spell.hs Checking old interface for Main (use -ddump-hi-diffs for more details): [1 of 1] Compiling Main ( spell.hs, spell.o ) Parser [Main]: !!! Parser [Main]: finished in 2.00 milliseconds, allocated 2.193 megabytes Renamer/typechecker [Main]: !!! Renamer/typechecker [Main]: finished in 24.02 milliseconds, allocated 6.749 megabytes

spell.hs:9:1: error: Could not find module ‘Data.HashMap.Strict’ Perhaps you meant Data.IntMap.Strict (from containers-0.6.2.1) Data.Map.Strict (from containers-0.6.2.1) Locations searched: Data/HashMap/Strict.hs Data/HashMap/Strict.lhs Data/HashMap/Strict.hsig Data/HashMap/Strict.lhsig | 9 | import qualified Data.HashMap.Strict as M | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Upsweep partially successful. Deleting temp files: Deleting: link(batch): upsweep (partially) failed OR Main.main not exported; not linking. Deleting temp files: Deleting: *** Deleting temp dirs: Deleting: bash-3.2$

sjakobi commented 4 years ago

Looks like you're pretty new to Haskell and need some help with using cabal?

I'm not very familiar with cabal documentation that is targeted at beginners. Maybe you could start with this: https://cabal.readthedocs.io/en/3.4/getting-started.html#creating-a-new-application

This issue tracker is not a very good place for these questions though. https://www.reddit.com/r/haskellquestions/ would probably be better place.

GeorgeCo commented 4 years ago

Looks like you're pretty new to Haskell and need some help with using cabal?

I'm no expert but I'm not pretty new to Haskell. It turns out I needed to delete my .cabal directory. I deleted it then downloaded a cabal 3.2 binary, moved it to a newly, created empty ./cabal/bin, did a cabal update, reinstalled ghc 8.10.1, then did a cabal v1-install unordered-containers. This solved my issue.

I wasn't having any problems with other packages so filed a bug about the issue I was having. After filing it I thought about trying the preceding.

Since I was able to figure it out on my own I didn't look at the following.

I'm not very familiar with cabal documentation that is targeted at beginners. Maybe you could start with this: https://cabal.readthedocs.io/en/3.4/getting-started.html#creating-a-new-application

This issue tracker is not a very good place for these questions though. https://www.reddit.com/r/haskellquestions/ would probably be better place.