nixpkgs/lib
Robert Hensing afa6c51f27 lib: Use Nix's static scope checking, fix error message, optimize
Nix can perform static scope checking, but whenever code is inside
a `with` expression, the analysis breaks down, because it can't
know statically what's in the attribute set whose attributes were
brought into scope. In those cases, Nix has to assume that
everything works out.

Except it doesnt. Removing `with` from lib/ revealed an undefined
variable in an error message.

If that doesn't convince you that we're better off without `with`,
I can tell you that this PR results in a 3% evaluation performance
improvement because Nix can look up local variables by index.
This adds up with applications like the module system.

Furthermore, removing `with` makes the binding site of each
variable obvious, which helps with comprehension.
2020-10-22 13:46:47 +02:00
..
systems Merge branch 'staging-next' into staging 2020-09-20 18:41:15 -04:00
tests lib.splitString: use builtin.split 2020-10-18 13:19:50 +00:00
asserts.nix lib: move assertMsg and assertOneOf to their own library file 2018-09-06 18:14:27 +02:00
attrsets.nix lib/attrsets: add getMan function 2020-06-18 10:16:57 +02:00
cli.nix lib/cli: mkKey -> mkOptionName, use generators.mkValueStringDefault 2020-01-23 14:47:38 +01:00
customisation.nix lib.callPackages(With): guard against a repeated mistake 2020-03-12 09:40:15 +01:00
debug.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
default.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
deprecated.nix lib.fake{Sri => Hash}: fix and rename 2020-05-11 23:11:12 +01:00
fetchers.nix
filesystem.nix lib: Add readTree function to filesystem 2020-10-19 16:42:21 -07:00
fixed-points.nix lib.converge: optimise 2019-04-17 15:55:57 +01:00
generators.nix lib/generators.toPretty: functors should print as functions 2020-09-17 18:20:43 +02:00
kernel.nix Merge pull request #84032 from teto/fix_kernel_merge 2020-05-22 13:32:22 +02:00
licenses.nix lib.licenses: add Prosperity-3.0.0 license (#97832) 2020-09-12 22:13:27 +02:00
lists.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
meta.nix lib: implement setPrio 2018-11-22 08:59:48 +00:00
minver.nix Bump minver.nix to 2.2 2020-06-04 13:43:10 +02:00
modules.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
options.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
sources.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
strings-with-deps.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
strings.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
trivial.nix lib: add importTOML 2020-09-12 16:37:50 +02:00
types.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
versions.nix lib/versions: expose splitVersion 2019-09-26 17:42:42 +02:00
zip-int-bits.nix lib/trivial: move zipIntBits to its own file 2018-07-26 20:36:45 +02:00