© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. Serrano MenaPractical Haskellhttps://doi.org/10.1007/978-1-4842-8581-7_8

8. Working in Several Cores

Alejandro Serrano Mena1  
(1)
Utrecht, The Netherlands
 

One of the main advantages of the purity that Haskell embodies is the ability to run code in parallel easily. The absence of side effects means that all data dependencies are explicit in the code. Thus, the compiler (and you) can schedule different tasks with no dependencies between them to be performed in parallel.

The Par monad enables you to make explicit which parts of your code would benefit from being run in parallel. The model supported by Par allows you to write code using both the futures model ...

Get Practical Haskell: A Real-World Guide to Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.