about summary refs log tree commit diff
path: root/nixpkgs/doc/functions
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
committerAlyssa Ross <hi@alyssa.is>2021-02-16 18:32:21 +0000
commit9becdcc5df71b47a5da84ad670e9a7eae9e0c65a (patch)
tree2ddf0335eb393f89501e3753b50c3f7ab0552d12 /nixpkgs/doc/functions
parent49f2a77ac9abc88c253f68952eda26557fc3b555 (diff)
parentff96a0fa5635770390b184ae74debea75c3fd534 (diff)
downloadnixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.gz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.bz2
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.lz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.xz
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.tar.zst
nixlib-9becdcc5df71b47a5da84ad670e9a7eae9e0c65a.zip
nixpkgs: merge nixos-unstable
Diffstat (limited to 'nixpkgs/doc/functions')
-rw-r--r--nixpkgs/doc/functions/library/asserts.xml2
-rw-r--r--nixpkgs/doc/functions/library/attrsets.xml39
2 files changed, 40 insertions, 1 deletions
diff --git a/nixpkgs/doc/functions/library/asserts.xml b/nixpkgs/doc/functions/library/asserts.xml
index 10891039e869..7c94222ef139 100644
--- a/nixpkgs/doc/functions/library/asserts.xml
+++ b/nixpkgs/doc/functions/library/asserts.xml
@@ -103,7 +103,7 @@ stderr> assert failed
    <title>Ensuring a user provided a possible value</title>
 <programlisting><![CDATA[
 let sslLibrary = "bearssl";
-in lib.asserts.assertOneOf "sslLibrary" sslLibrary [ "openssl" "bearssl" ];
+in lib.asserts.assertOneOf "sslLibrary" sslLibrary [ "openssl" "libressl" ];
 => false
 stderr> trace: sslLibrary must be one of "openssl", "libressl", but is: "bearssl"
         ]]></programlisting>
diff --git a/nixpkgs/doc/functions/library/attrsets.xml b/nixpkgs/doc/functions/library/attrsets.xml
index 3c5823c25891..7ef0d16624c8 100644
--- a/nixpkgs/doc/functions/library/attrsets.xml
+++ b/nixpkgs/doc/functions/library/attrsets.xml
@@ -1711,4 +1711,43 @@ recursiveUpdate
   </example>
  </section>
 
+ <section xml:id="function-library-lib.attrsets.cartesianProductOfSets">
+  <title><function>lib.attrsets.cartesianProductOfSets</function></title>
+
+  <subtitle><literal>cartesianProductOfSets :: AttrSet -> [ AttrSet ]</literal>
+  </subtitle>
+
+  <xi:include href="./locations.xml" xpointer="lib.attrsets.cartesianProductOfSets" />
+
+  <para>
+    Return the cartesian product of attribute set value combinations.
+  </para>
+
+  <variablelist>
+   <varlistentry>
+    <term>
+     <varname>set</varname>
+    </term>
+    <listitem>
+     <para>
+      An attribute set with attributes that carry lists of values.
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+
+  <example xml:id="function-library-lib.attrsets.cartesianProductOfSets-example">
+   <title>Creating the cartesian product of a list of attribute values</title>
+<programlisting><![CDATA[
+cartesianProductOfSets { a = [ 1 2 ]; b = [ 10 20 ]; }
+=> [
+     { a = 1; b = 10; }
+     { a = 1; b = 20; }
+     { a = 2; b = 10; }
+     { a = 2; b = 20; }
+   ]
+]]></programlisting>
+  </example>
+ </section>
+
 </section>