How do you import Data.Heap?

自闭症网瘾萝莉.ら 提交于 2020-01-04 02:20:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!