I’m starting to read Parallel and Concurrent Programming in Haskell by Simon Marlow, and I wanted to get a nix flake working for the example code.
I usually adopt Jonas Carpay’s haskell template (with minor modifications that I haven’t yet put into a public fork) for new projects and it usually works without a hitch. This time, though, parconc
needed the accelerate
package.
I haven’t gotten to the part of the book about what
accelerate
actually does, but it looks like it is a DSL that compiles code for GPUs or WebGL. I also know that there was a 2024 Zurihac talk on it, but I didn’t see it.
The latest release of accelerate
on hackage is from 2020 and the haskellPackage.accelerate
was, unsurprisingly, marked as broken in nixpkgs
. One thing to note about the haskell package set in nixpkgs is that the packages are marked broken as a result of CI (see here) :
Roughly half of the 16K packages contained in
haskellPackages
don’t actually build and are marked as broken semi-automatically. Most of those packages are deprecated or unmaintained, but sometimes packages that should build, do not build. Very often fixing them is not a lot of work.
This is partially true. Fixing packages are not a lot of work once you know how to do it (+24, -3 on the PR), but doing it for the first time is still an accomplishment.
I’m fairly certain that accelerate
will need some additional work to actually get working (given this thread), and I’ll try to update the upstream package once I’ve reached that point in the book.
Other Resources
Here are some materials that helped me along the way: