Before this PR, HNix provided an implementation for interpolating free variables as Nix expressions. This was not called correctly, because the types did not match: it looked for NExprLoc instead of NExpr.
This PR fixes interpolation such that the following code works as expected:
let foo = "foo" :: String
[nix|
{
foo = foo;
}
|]
produces:
{
foo = "foo";
}
To do this, we fix the ToExpr typeclass to generate NExpr. We also provide some additional instances.
The diff also includes some lines that have been reformatted when running Brittany on the source file.
Before this PR, HNix provided an implementation for interpolating free variables as Nix expressions. This was not called correctly, because the types did not match: it looked for
NExprLoc
instead ofNExpr
.This PR fixes interpolation such that the following code works as expected:
produces:
To do this, we fix the
ToExpr
typeclass to generateNExpr
. We also provide some additional instances.The diff also includes some lines that have been reformatted when running Brittany on the source file.