Control.Parallel compile issue in Haskell

删除回忆录丶 提交于 2019-12-05 01:42:26

You must install the parallel package from Hackage. In most sane setups, this should be as simple as typing

cabal install parallel # note: not sudo cabal install parallel!

at your command prompt.

Like Daniel said, you'll need the parallel package. However if you'd prefer to use your system's package manager (which some people think you should), you can.

Note that, at least in the Fedora repos, you'll need ghc-parallel-devel, not just ghc-parallel to build.

#yum install ghc-parallel-devel

I'm adding a new answer (instead of a comment) for visibility reasons.

After trying Daniel's answer, I still wasn't able to do import Control.Parallel, neither from ghci, nor with the compiler. The install command returned a warning message like this:

➜  ~ cabal install parallel
Resolving dependencies...
Up to date
Warning: You asked to install executables, but there are no executables in
target: parallel. Perhaps you want to use --lib to install libraries instead.

What ultimately resolved the issue was:

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