From 83c2ad80ca8c6087b034155e2a767c4f72a6df3f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 18 Sep 2019 22:12:54 +0200 Subject: doc: re-format --- doc/functions/library/asserts.xml | 13 +--- doc/functions/library/attrsets.xml | 145 +++++++++++-------------------------- 2 files changed, 46 insertions(+), 112 deletions(-) (limited to 'doc/functions/library') diff --git a/doc/functions/library/asserts.xml b/doc/functions/library/asserts.xml index 437850e408b..10891039e86 100644 --- a/doc/functions/library/asserts.xml +++ b/doc/functions/library/asserts.xml @@ -27,8 +27,7 @@ - Condition under which the msg should - not be printed. + Condition under which the msg should not be printed. @@ -64,9 +63,7 @@ stderr> assert failed - Specialized asserts.assertMsg for checking if - val is one of the elements of xs. - Useful for checking enums. + Specialized asserts.assertMsg for checking if val is one of the elements of xs. Useful for checking enums. @@ -76,8 +73,7 @@ stderr> assert failed - The name of the variable the user entered val into, - for inclusion in the error message. + The name of the variable the user entered val into, for inclusion in the error message. @@ -87,8 +83,7 @@ stderr> assert failed - The value of what the user provided, to be compared against the values in - xs. + The value of what the user provided, to be compared against the values in xs. diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 65d0b40e2e8..f9234069392 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -23,8 +23,7 @@ - A list of strings representing the path through the nested attribute set - set. + A list of strings representing the path through the nested attribute set set. @@ -34,8 +33,7 @@ - Default value if attrPath does not resolve to an - existing value. + Default value if attrPath does not resolve to an existing value. @@ -88,8 +86,7 @@ lib.attrsets.attrByPath [ "a" "b" ] 0 {} - A list of strings representing the path through the nested attribute set - set. + A list of strings representing the path through the nested attribute set set. @@ -125,8 +122,7 @@ lib.attrsets.hasAttrByPath - Create a new attribute set with value set at the nested - attribute location specified in attrPath. + Create a new attribute set with value set at the nested attribute location specified in attrPath. @@ -146,8 +142,7 @@ lib.attrsets.hasAttrByPath - The value to set at the location described by - attrPath. + The value to set at the location described by attrPath. @@ -171,8 +166,7 @@ lib.attrsets.setAttrByPath [ "a" "b" ] 3 - Like except - without a default, and it will throw if the value doesn't exist. + Like except without a default, and it will throw if the value doesn't exist. @@ -182,8 +176,7 @@ lib.attrsets.setAttrByPath [ "a" "b" ] 3 - A list of strings representing the path through the nested attribute set - set. + A list of strings representing the path through the nested attribute set set. @@ -235,8 +228,7 @@ lib.attrsets.getAttrFromPath [ "x" "y" ] { } - The list of attributes to fetch from set. Each - attribute name must exist on the attrbitue set. + The list of attributes to fetch from set. Each attribute name must exist on the attrbitue set. @@ -282,8 +274,7 @@ error: attribute 'd' missing - Provides a backwards-compatible interface of - builtins.attrValues for Nix version older than 1.8. + Provides a backwards-compatible interface of builtins.attrValues for Nix version older than 1.8. @@ -317,14 +308,11 @@ lib.attrsets.attrValues { a = 1; b = 2; c = 3; } - Collect each attribute named `attr' from the list of attribute sets, - sets. Sets that don't contain the named attribute are - ignored. + Collect each attribute named `attr' from the list of attribute sets, sets. Sets that don't contain the named attribute are ignored. - Provides a backwards-compatible interface of - builtins.catAttrs for Nix version older than 1.9. + Provides a backwards-compatible interface of builtins.catAttrs for Nix version older than 1.9. @@ -334,8 +322,7 @@ lib.attrsets.attrValues { a = 1; b = 2; c = 3; } - Attribute name to select from each attribute set in - sets. + Attribute name to select from each attribute set in sets. @@ -372,8 +359,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}] - Filter an attribute set by removing all attributes for which the given - predicate return false. + Filter an attribute set by removing all attributes for which the given predicate return false. @@ -386,8 +372,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}] String -> Any -> Bool - Predicate which returns true to include an attribute, or returns false to - exclude it. + Predicate which returns true to include an attribute, or returns false to exclude it. @@ -412,8 +397,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}] - Returns true to include the attribute, - false to exclude the attribute. + Returns true to include the attribute, false to exclude the attribute. @@ -447,8 +431,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; } - Filter an attribute set recursively by removing all attributes for which the - given predicate return false. + Filter an attribute set recursively by removing all attributes for which the given predicate return false. @@ -461,8 +444,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; } String -> Any -> Bool - Predicate which returns true to include an attribute, or returns false to - exclude it. + Predicate which returns true to include an attribute, or returns false to exclude it. @@ -487,8 +469,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; } - Returns true to include the attribute, - false to exclude the attribute. + Returns true to include the attribute, false to exclude the attribute. @@ -557,8 +538,7 @@ lib.attrsets.filterAttrsRecursive Any -> Any -> Any - Given a value val and a collector - col, combine the two. + Given a value val and a collector col, combine the two. @@ -578,8 +558,7 @@ lib.attrsets.filterAttrsRecursive - The result of previous op calls with other values - and nul. + The result of previous op calls with other values and nul. @@ -632,9 +611,7 @@ lib.attrsets.foldAttrs - Recursively collect sets that verify a given predicate named - pred from the set attrs. The recursion - stops when pred returns true. + Recursively collect sets that verify a given predicate named pred from the set attrs. The recursion stops when pred returns true. @@ -702,8 +679,7 @@ collect (x: x ? outPath) - Utility function that creates a {name, value} pair as - expected by builtins.listToAttrs. + Utility function that creates a {name, value} pair as expected by builtins.listToAttrs. @@ -747,13 +723,11 @@ nameValuePair "some" 6 - Apply a function to each element in an attribute set, creating a new - attribute set. + Apply a function to each element in an attribute set, creating a new attribute set. - Provides a backwards-compatible interface of - builtins.mapAttrs for Nix version older than 2.1. + Provides a backwards-compatible interface of builtins.mapAttrs for Nix version older than 2.1. @@ -814,9 +788,7 @@ lib.attrsets.mapAttrs - Like mapAttrs, but allows the name of each attribute to - be changed in addition to the value. The applied function should return both - the new name and value as a nameValuePair. + Like mapAttrs, but allows the name of each attribute to be changed in addition to the value. The applied function should return both the new name and value as a nameValuePair. @@ -829,10 +801,8 @@ lib.attrsets.mapAttrs String -> Any -> { name = String; value = Any } - Given an attribute's name and value, return a new - name - value pair. + Given an attribute's name and value, return a new name value pair. @@ -891,8 +861,7 @@ lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair ("foo_" + name) - Call fn for each attribute in the given - set and return the result in a list. + Call fn for each attribute in the given set and return the result in a list. @@ -962,9 +931,7 @@ lib.attrsets.mapAttrsToList (name: value: "${name}=${value}") - Like mapAttrs, except that it recursively applies - itself to attribute sets. Also, the first argument of the argument function - is a list of the names of the containing attributes. + Like mapAttrs, except that it recursively applies itself to attribute sets. Also, the first argument of the argument function is a list of the names of the containing attributes. @@ -989,10 +956,7 @@ lib.attrsets.mapAttrsToList (name: value: "${name}=${value}") The list of attribute names to this value. - For example, the name_path for the - example string in the attribute set { foo - = { bar = "example"; }; } is [ "foo" "bar" - ]. + For example, the name_path for the example string in the attribute set { foo = { bar = "example"; }; } is [ "foo" "bar" ]. @@ -1059,11 +1023,7 @@ mapAttrsRecursive - Like mapAttrsRecursive, but it takes an additional - predicate function that tells it whether to recursive into an attribute set. - If it returns false, mapAttrsRecursiveCond does not - recurse, but does apply the map function. It is returns true, it does - recurse, and does not apply the map function. + Like mapAttrsRecursive, but it takes an additional predicate function that tells it whether to recursive into an attribute set. If it returns false, mapAttrsRecursiveCond does not recurse, but does apply the map function. It is returns true, it does recurse, and does not apply the map function. @@ -1076,8 +1036,7 @@ mapAttrsRecursive (AttrSet -> Bool) - Determine if mapAttrsRecursive should recurse deeper - in to the attribute set. + Determine if mapAttrsRecursive should recurse deeper in to the attribute set. @@ -1114,10 +1073,7 @@ mapAttrsRecursive The list of attribute names to this value. - For example, the name_path for the - example string in the attribute set { foo - = { bar = "example"; }; } is [ "foo" "bar" - ]. + For example, the name_path for the example string in the attribute set { foo = { bar = "example"; }; } is [ "foo" "bar" ]. @@ -1181,8 +1137,7 @@ lib.attrsets.mapAttrsRecursiveCond - Generate an attribute set by mapping a function over a list of attribute - names. + Generate an attribute set by mapping a function over a list of attribute names. @@ -1241,8 +1196,7 @@ lib.attrsets.genAttrs [ "foo" "bar" ] (name: "x_${name}") - Check whether the argument is a derivation. Any set with { type = - "derivation"; } counts as a derivation. + Check whether the argument is a derivation. Any set with { type = "derivation"; } counts as a derivation. @@ -1320,8 +1274,7 @@ lib.attrsets.isDerivation "foobar" - Condition under which the as attribute set is - returned. + Condition under which the as attribute set is returned. @@ -1363,8 +1316,7 @@ lib.attrsets.optionalAttrs false { my = "set"; } - Merge sets of attributes and use the function f to merge - attribute values where the attribute name is in names. + Merge sets of attributes and use the function f to merge attribute values where the attribute name is in names. @@ -1451,11 +1403,8 @@ lib.attrsets.zipAttrsWithNames - Merge sets of attributes and use the function f to merge - attribute values. Similar to - where - all key names are passed for names. + Merge sets of attributes and use the function f to merge attribute values. Similar to where all key names are passed for names. @@ -1531,9 +1480,7 @@ lib.attrsets.zipAttrsWith - Merge sets of attributes and combine each attribute value in to a list. - Similar to - where the merge function returns a list of all values. + Merge sets of attributes and combine each attribute value in to a list. Similar to where the merge function returns a list of all values. @@ -1573,12 +1520,7 @@ lib.attrsets.zipAttrs - Does the same as the update operator // except that - attributes are merged until the given predicate is verified. The predicate - should accept 3 arguments which are the path to reach the attribute, a part - of the first attribute set and a part of the second attribute set. When the - predicate is verified, the value of the first attribute set is replaced by - the value of the second attribute set. + Does the same as the update operator // except that attributes are merged until the given predicate is verified. The predicate should accept 3 arguments which are the path to reach the attribute, a part of the first attribute set and a part of the second attribute set. When the predicate is verified, the value of the first attribute set is replaced by the value of the second attribute set. @@ -1681,10 +1623,7 @@ lib.attrsets.recursiveUpdateUntil (path: l: r: path == ["foo"]) - A recursive variant of the update operator //. The - recursion stops when one of the attribute values is not an attribute set, in - which case the right hand side value takes precedence over the left hand - side value. + A recursive variant of the update operator //. The recursion stops when one of the attribute values is not an attribute set, in which case the right hand side value takes precedence over the left hand side value. -- cgit 1.4.1