问题
Sorry for such a dumb question. I'm trying to import Data.Heap, but I get this error message:
> import Data.Heap
<no location info>: error:
Could not find module ‘Data.Heap’
Perhaps you meant
Data.Map (from containers-0.5.7.1@containers-0.5.7.1)
Haven't had trouble with other imports.
Thanks.
回答1:
As was described in the comments, you need to install the package which contains the module Data.Heap
. (See this related question on the difference between packages and modules in Haskell)
On the Hackage page, in the upper left-hand corner you will see the name and version of the package you are looking at:
If you are using stack, then add heap
to your build-depends
section of project.cabal
file, and rebuild. If you are just using cabal, simply run cabal install heap
to get the most recent version of the package installed on your system.
来源:https://stackoverflow.com/questions/45362161/how-do-you-import-data-heap