1. 11
  1.  

  2. 2

    Wouldn’t parMap :: Strategy b -> (a -> b) -> [a] -> [b] be better fit for this example, instead of using the infix notation?

    On a related note: Is it true that future versions of GHC want to make maps and related functions parallel by default? I remember reading about it maybe 1 1/2 years ago, but I don’t think it was an authoritative source?

    1. 2

      parMap would achieve the same thing and is probably more idiomatic. I suppose I went with the more verbose version because I wanted to show how the primitives compose into something larger.

      The idea of automatic parallelization is interesting. My initial reaction is that just parallelizing everything would probably slow things down due to overhead (starting a spark is cheap but not free). Perhaps you could come up with some heuristics that would work well though.

      1. 1

        Are you sure you’re not thinking of data parallel haskell? I don’t see that mentioned in the linked page.

        https://wiki.haskell.org/GHC/Data_Parallel_Haskell

        Which is mostly abandoned now.