about summary refs log tree commit diff
path: root/doc/manual
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-18T23·03+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-18T23·04+0100
commit77c13cdf566ffedc70d8860571afae8a6d43b552 (patch)
tree80d2c35c450911d0401e8a95d28ff9d8904b53fc /doc/manual
parent285df765b91588e39d6f35a32e30b84c3cb5be75 (diff)
Add a toJSON primop
Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/builtins.xml12
-rw-r--r--doc/manual/release-notes.xml5
2 files changed, 17 insertions, 0 deletions
diff --git a/doc/manual/builtins.xml b/doc/manual/builtins.xml
index 3958297989a1..6a472291c363 100644
--- a/doc/manual/builtins.xml
+++ b/doc/manual/builtins.xml
@@ -750,6 +750,18 @@ in foo</programlisting>
   </varlistentry>
 
 
+  <varlistentry><term><function>builtins.toJSON</function> <replaceable>e</replaceable></term>
+
+    <listitem><para>Return a string containing a JSON representation
+    of <replaceable>e</replaceable>.  Strings, integers, booleans,
+    nulls and lists are mapped to their JSON equivalents.  Sets
+    (except derivations) are represented as objects.  Derivations are
+    translated to a JSON string containing the derivation’s output
+    path.  Paths are copied to the store and represented as a JSON
+    string of the resulting store path.</para></listitem>
+
+  </varlistentry>
+
   <varlistentry><term><function>builtins.toPath</function> <replaceable>s</replaceable></term>
 
     <listitem><para>Convert the string value
diff --git a/doc/manual/release-notes.xml b/doc/manual/release-notes.xml
index 3db083870405..37bb730f4063 100644
--- a/doc/manual/release-notes.xml
+++ b/doc/manual/release-notes.xml
@@ -13,6 +13,11 @@
 
 <itemizedlist>
 
+  <listitem>
+    <para>New built-in function: <function>builtins.toJSON</function>,
+    which returns a JSON representation of a value.</para>
+  </listitem>
+
   <listitem><para><command>nix-setuid-helper</command> is
   gone.</para></listitem>