[Nix-dev] The Future of Haskell Packaging in Nix

Peter Simons simons at cryp.to
Thu Oct 29 14:30:57 CET 2015


Hi Nicolas,

 > we need to up-lift the mkDerivation function above the arguments of
 > the function.

that is a really nice idea. You are right. The current idiom

  { mkDerivation, ... }: mkDerivation { ... }

is clumsy compared to a solution where we define a plain attribute set

  { base, binary, ... }: { haskellLibraryDepends = [base, binary]; ...  }

and call 'mkDerivation' on that at exactly those locations where we want
to view the package as a derivation.


 > We could remove the need for the argument list [...].

For Haskell package sets, the explicit argument list is preferable,
IMHO, because different attributes routinely refer to different versions
of the same build input with the same name, i.e. the name "binary" can
resolve to "binary1" or "binary2", depending on the attribute that's
evaluated. At the same time, the attributes don't know the correct name,
i.e. they cannot refer to "self.binary2" directly.

Best regards,
Peter



More information about the nix-dev mailing list