In this recipe, we will use the parallel library. This library provides a set of strategies to allow us to program concurrent tasks easily.
Working with strategies
How to do it...
- Create a new project called working-with-eval with the simple stack template:
stack new working-with-eval simple
- Add a dependency on the parallel library in the build-depends sub-section of the executable section. Also add -threaded and -fprof-auto -rtsopts -eventlog to enable multithreading and profiling:
executable working-with-eval hs-source-dirs: src main-is: Main.hs
ghc-options: -threaded -fprof-auto -rtsopts -eventlog default-language: Haskell2010 ...