diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2017-04-14 10:32:13 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2017-04-14 10:32:13 +0200 |
commit | 24444513fb5cc0cf1f56c6b3b87bcdd36db8b101 (patch) | |
tree | b856f7236de8e12ef201ababecb22e9b32a0e493 /lib | |
parent | 3085e95a20349f957c793f22547363231fa471a8 (diff) | |
parent | 304d30ce3f22ca8b275236de6e2c2e7f6e0b1934 (diff) |
Merge branch 'staging'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 5 | ||||
-rw-r--r-- | lib/tests.nix | 10 | ||||
-rw-r--r-- | lib/trivial.nix | 9 |
3 files changed, 0 insertions, 24 deletions
diff --git a/lib/default.nix b/lib/default.nix index 632b12510e82..09a64f754d8f 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,8 +1,3 @@ -/* Library of low-level helper functions for nix expressions. - * - * Please implement (mostly) exhaustive unit tests - * for new functions in `./tests.nix'. - */ let # trivial, often used functions diff --git a/lib/tests.nix b/lib/tests.nix index d93cadf25335..1a9a5accd1c0 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -277,14 +277,4 @@ runTests { expected = [ "2001" "db8" "0" "0042" "" "8a2e" "370" "" ]; }; - testComposeExtensions = { - expr = let obj = makeExtensible (self: { foo = self.bar; }); - f = self: super: { bar = false; baz = true; }; - g = self: super: { bar = super.baz or false; }; - f_o_g = composeExtensions f g; - composed = obj.extend f_o_g; - in composed.foo; - expected = true; - }; - } diff --git a/lib/trivial.nix b/lib/trivial.nix index 62906339e605..6cdc869b300b 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -85,15 +85,6 @@ rec { # argument, but it's nice this way if several uses of `extends` are cascaded. extends = f: rattrs: self: let super = rattrs self; in super // f self super; - # Compose two extending functions of the type expected by 'extends' - # into one where changes made in the first are available in the - # 'super' of the second - composeExtensions = - f: g: self: super: - let fApplied = f self super; - super' = super // fApplied; - in fApplied // g self super'; - # Create an overridable, recursive attribute set. For example: # # nix-repl> obj = makeExtensible (self: { }) |