[Nix-dev] How lazy is // ?

Marc Weber marco-oweber at gmx.de
Tue Nov 24 16:28:07 CET 2009


("no attr" // { a = 20; }).a

should this fail?

I mean a does no longer depend on the "no attr" attrs value.
It's overridden anyway.

This makes a difference when using makeOverridable.

If you call pkg.override { .. }

this will evaluate pkg to see that it is an attr.
However this can be an expensive operation..

When using makeOverridable the overhead is small.
However when pkg was big computation such as resolving dependencies for
haskell packages the difference can be very noticable.

So what do you think about making // lazier?

Marc Weber



More information about the nix-dev mailing list