Are you using monad-par
(or some alternative)?
I have never used monad-par
, not even just to experiment with. These days I will occasionally use the massiv
library or, less commonly but more happily, par
and seq
. Related to par
and seq
is the parallel
package, which is more theoretically appealing to me than monad-par
, but I have never actually had a reason to use it in anger. That’s about it as far as parallelism for me.
Why/why not?
From the very beginning, I felt like its interface was too imperative for my tastes. Explicitly getting and setting from mutable references may be something I do occasionally, but parallelism is supposed to be something that purely functional programming is theoretically great for (although, admittedly, there is some misalignment between theory and practice so far), so ivars, especially with restrictions that result in runtime exceptions if you violate them, don’t hold much appeal for me.
What would make you use it?
I think it is just not the abstraction I’m looking for, so anything that would make me use it would change it at such a fundamental level as not be monad-par
anymore.
I vaguely remember it being a poster child for Haskell, look what Haskell can do!
Although I do remember a bit of promotion for it, and some due attention simply because of its author’s reputation, I do not remember it ever holding “poster child” status. IMO, there are two (kind of weak) candidates as poster children for parallelism with Haskell:
par
(i.e., sparks)
- “data parallelism.” Although the exact library/research getting the most hype has changed a few times, I remember being very excited about the now-abandoned nested data parallelism research, and there have been some interesting libraries for non-nested parallelism, like
accelerate
, repa
, and massiv
, the latter being the one I currently view most favorably.
I know the topic here is parallelism, not concurrency, but I’ll add that I think there is a lot more convergence on what the poster children in the area of concurrency are. There are several, but I would say the ones that stand out the most are:
- GHC itself, for its excellent support for lightweight threads
- STM
There are other indispensable things in this space, but they feel a bit less unique to Haskell, so I would not go as far as to call them poster children.