I'm following this guide and I got to the "Write your first parallel Haskell program", where you have you use Control.Parallel. When i try to compile it, I get:
A.hs:1:1: error:
Could not find module `Control.Parallel'
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
1 | import Control.Parallel
| ^^^^^^^^^^^^^^^^^^^^^^^
Nowhere does it say that I have to install anything. Despite that, I ran cabal install --lib parallel and it installed okay but It still cannot find the package. When I run ghc-pkg list parallel is not on the list.
How do I go about solving that?
You can do either of two things here:
parallel as a dependency. To do so, I'll refer you to Cabal's quickstart guide.parallel package. In the example you listed, you need to import Control.Parallel to make use of par and pseq. However, these functions are also part of GHC.Conc, which is part of the base package. So, to get your program to work without any package management involved, simply replace import Control.Parallel by import GHC.Conc, and you should be good.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With