Is there an easy way to override a GHC core library when building a Haskell package?
For instance, the current GHC-8.6.5 package set uses
$ nix-shell -p haskell.compiler.ghc865 $ ghc-pkg list # within nix-shell /nix/store/5adkvmak1j42pxpbhpjq33p16g0588a4-ghc-8.6.5/lib/ghc-8.6.5/package.conf.d ... bytestring-0.10.8.2 ...
I’d like to build a Haskell package linking to
I came up with something like the following:
This seems relatively complicated. I’m wondering if there is an easier way to do this?
Here are two parts I don’t really like:
Having to pass a constraint to every package to force the version of
bytestringI want, even if the package doesn’t use bytestring:
I might be able to clean this up a little bit by checking if the package actually depends on
bytestring, but it would be nice to completely handle this sort of thing in Nix code. Maybe doing something similar to
stackand hiding all packages by default, and only enabling those explicitly asked for by the user.
Having to override all GHC core packages that use
I understand why this is needed, but it would be nice if something like this could happen automatically (somehow).