[Nix-dev] haskell: overriding mtl/any builtin

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Mon Sep 8 17:50:07 CEST 2014


On 09/08/2014 07:36 AM, Peter Simons wrote:
> Hi Mateusz,
> 
>  > Notably if I specify mtl = mtl_2_2_1; then it complains that it needs
>  > transformers == 0.4 but there seems to be no clues in nixpkgs as to how
>  > to achieve this. Currently mtl = 2.2.1 for HEAD but I know it should
>  > work with 7.8.3
> 
> transformers is a core library in GHC 7.8.3. We cannot override that
> package, because it's shipped with the compiler and other core libraries
> are linked against that version.
> 
> Best regards,
> Peter
> 
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 

Right, yes, it is, yet somehow there are packages around on Hackage
which do depend on mtl-2.2.1 and by proxy on transformers-0.4, which do
compile with GHC 7.8.3. This must be somehow achieved one way or another
and currently with nix(pkgs) we can not accommodate for those packages.
Recent release of JuicyPixels is a good example, we had to ask upstream
to relax the bound a bit so that we could use it but just relaxing the
bound is not always possible. I expect more and more packages to start
using the new mtl over time.

I found myself yesterday in need of hacking a bit on a project which
happened to actually need mtl-2.2.1 and I just could not do it with
7.8.3 whereas that's exactly what the original developer was using. My
hack there was to comment out the 2.2.1 imports and manually stick
undefined everywhere but that's obviously not acceptable for any actual
work.

The only other way I could think of would be to use the (outdated) GHC
‘HEAD’ version from nixpkgs which would not help me because it was to
try and chase down a bug appearing with 7.8.3.

-- 
Mateusz K.


More information about the nix-dev mailing list